Releases: shiMusa/MathExtensions
Reordered arguments
To make the function calls unified, all functions will now store the (main) result in the first argument.
There are some function that also mutate the other arguments or have additional return arguments further in the back of the list.
operator overloading
This release re-introduces overloaded operators for Dense***
and DenseHeap***
.
It also offers versions of e.g. transpose
, conjugate
, etc, that return new (evtl. allocated) Dense***
/DenseHeap***
.
Be careful of unnecessary allocations!
Complete Refactor
The library was complete refactored to remove any unnecessary allocations.
Now, all the functions are storing their results (for vectors and matrices) in arguments (passed by pointer).
It is now also possible to easily extend any function with specialized high-performance code for special matrix/vector types.
Views on vectors and matrices were implemented (non-allocating).
Quaternions!
Added Quaternion(T)
to the library!
No more `Scalar`
I could finally get rid of the helper-struct Scalar
. This was probably because of the compiler update...
DenseHeapVector / DenseHeapMatrix
Added heap allocated versions of DenseVector
and DenseMatrix
: DenseHeapVector
, DenseHeapMatrix
.
In algorithms, x := make(T);
should be used the initialize any vector or matrix type T
to be independent of heap- or stack-allocation (see LinearAlgebra.jai
for examples).
Generic Complex(T)
Now also the complex numbers can be over any type via Complex($T)
!
generalized raw-access
The raw access to the data is now generalized by replacing the compile-time variable N_raw
with a procedure returning it during run time n_raw(m: $M/MatrixType) -> int
. I also removed the N_lin
variable since it's simply N * M
, where N
is the number of rows and M
is the number of columns.
This should enable sparse matrices/vectors as well, since the number of elements changes during run-time.
MatrixType/VectorType traits
All algorithms run over generic MatrixType
s and VectorType
s.
In future, some of the properties will be changed such that heap-allocated matrices are possible as well.
This should be possible by moving the compile-time parameters, i.e. N_lin
, N_raw
, of the traits to compile-time functions, e.g. nLin($M/MatrixType) -> int
.
Stack Allocated
Stack allocation
In this release, I rewrote the library to use stack allocation instead of heap allocation in all places.
This should make it much more usable for applications with a smaller number of dimensions (games, etc.).
the bad
I had to introduce a Scalar($T)
struct to make the compiler choose the right overloaded functions...
Will probably remove that once the compiler is further developed.