Matrices |
The class matrix<C,V> implements matrices over C. All the available algorithms have a naive implementation in matrix_naive.hpp.
#include <algebramix/matrix.hpp>
...
matrix<C,V> M (C (0), 3, 2) // 3 x 2 matrix filled with 0
M (0,0)= C(0); M (1,0)= C(1); ...
matrix<C,V> N= M * transpose (M);
mmout << M << "\n";
mmout << det (N) << "\n";
mmout << column_reduced_echelon (M) << "\n";
As for vectors, matrices have a variant for unrolling loops, namely matrix_unrolled<s,V>, where s represents the number of steps to be unrolled.
Strassen product is implemented in the variant matrix_strassen<V>.
Support for SIMD instructions is available through the variant matrix_simd<n,m,V>: n is the size for unrolling SIMD data and m is the one for unrolling the data of the original type. Only SSE2 and SSE3 are supported at the present time.
Multi-threading is possible with the variant matrix_threads<V>.
matrix_double.hpp contains a recommanded default variant for double.
matrix_int.hpp contains a recommanded default variant for hardware integers.
matrix_modular_int.hpp contains a recommanded default variant for modulars over hardware integers.
matrix_integer.hpp contains a recommanded default variant for integers.
Mmx]
A == [ (i :> Rational) + j | i in 0..5 || j in 0..5 ]
:
Mmx]
det A
:
Mmx]
row_echelon A
:
Mmx]
rank A
:
Mmx]
ker A
: