General size matrices

#include <gandalf/linalg/mat_gen.h>The structure for general size matrices is the

#include <gandalf/linalg/mat_square.h>The square matrix types are listed in

/* types of square matrix */ typedef enum { GAN_SYMMETRIC_MATRIX, /* symmetric */ GAN_DIAGONAL_MATRIX, /* diagonal */ GAN_SCALED_IDENT_MATRIX, /* identity times scalar */ GAN_LOWER_TRI_MATRIX, /* lower triangular */ GAN_UPPER_TRI_MATRIX, /* upper triangular */ GAN_ZERO_SQUARE_MATRIX } /* square matrix filled with zeros */ Gan_SquMatrixType;Use of the special matrix types producs savings both in memory and computation time, and should be exploited wherever appropriate. To use any functions specific to the above square matrix types (as opposed to general square matrix functions common to many types), you will need to include the header file for the specific type you need, for instance

#include <gandalf/linalg/mat_symmetric.h>for symmetric matrices, and

#include <gandalf/linalg/mat_triangular.h>for triangular matrices (covers lower and upper triangular matrices). The full list of header files for the specific square matrix types is

#include <gandalf/linalg/mat_symmetric.h> /* for symmetric matrices */ #include <gandalf/linalg/mat_triangular.h> /* lower/upper triangular matrices */ #include <gandalf/linalg/mat_diagonal.h> /* diagonal matrices */ #include <gandalf/linalg/mat_scaledI.h> /* scaled identity matrices */The square matrix routines are organised so that once the matrix has been set at a specific type and size, and filled with values, the functions that operate on it are general functions. The computational overhead is that whenever an operation is performed (such at matrix/matrix multiplication) there is an indirection to take the program into the correct routine for the current square matrix type. This design allows the programmer to easily design algorithms that will work correctly and efficiently for any square matrix type.

- Creating and freeing general size matrices
- Adjusting the size of a general size matrix
- Filling a general size matrix with values
- Accessing the elements of a general size matrix
- Copying a general size matrix
- Transposing a general size matrix
- General size matrix addition
- General size matrix subtraction
- Rescaling a general size matrix
- General size matrix/vector multiplication
- General size matrix/matrix multiplication
- Inverting a general size matrix
- Cholesky factorising a general size symmetric matrix
- Symmetric matrix eigendecomposition
- Accumulated symmetric matrix eigendecomposition