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";

1.Optimized variants

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>.

2.Special types of coefficients

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.

3.Mathemagix interface

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

:

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License. If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.