Minimal linear algebra for matrix vector operations.
More...
#include <math.h>
#include <stdbool.h>
|
#define | EPS ldexp(1, -32) |
| minimal distance of two vector elements considered unequal.
|
|
|
double | dot (unsigned int dim, const double *v1, const double *v2) |
| euclidean dot product.
|
|
void | matrix_intVector (unsigned int dim, const double *m, const int *v, double *res) |
| matrix - (integer) vector multiplication.
|
|
void | transpose (unsigned int dim, double *m) |
| square matrix transpose.
|
|
bool | equals (unsigned int dim, const double *v1, const double *v2) |
| check if two vectors are equal.
|
|
void | invert (unsigned int dim, double *m, int *p, double *r) |
| Invert matrix.
|
|
double | inf_norm (unsigned int dim, const double *m) |
| Compute infinity norm (maximum sum row norm).
|
|
Minimal linear algebra for matrix vector operations.
◆ dot()
double dot |
( |
unsigned int | dim, |
|
|
const double * | v1, |
|
|
const double * | v2 ) |
euclidean dot product.
- Parameters
-
[in] | dim | dimension of the input vectors |
[in] | v1 | first vector. |
[in] | v2 | second vector. |
- Returns
- dot product of v1 and v2.
◆ equals()
bool equals |
( |
unsigned int | dim, |
|
|
const double * | v1, |
|
|
const double * | v2 ) |
check if two vectors are equal.
- Parameters
-
[in] | dim | dimension of the vectors. |
[in] | v1 | first vector. |
[in] | v2 | second vector. |
- Returns
- true if the vectors are equal, false if the vectors are not equal.
◆ inf_norm()
double inf_norm |
( |
unsigned int | dim, |
|
|
const double * | m ) |
Compute infinity norm (maximum sum row norm).
- Parameters
-
[in] | dim | dimension of the vectors. |
[in] | m | matrix to compute infinity norm of. |
◆ invert()
void invert |
( |
unsigned int | dim, |
|
|
double * | m, |
|
|
int * | p, |
|
|
double * | r ) |
Invert matrix.
- Parameters
-
[in] | dim | dimension of the vectors. |
[in,out] | m | matrix to invert. overwritten bei LU-decomposition. |
[out] | p | permutation vector. |
[out] | r | where inverse matrix is stored. |
◆ matrix_intVector()
void matrix_intVector |
( |
unsigned int | dim, |
|
|
const double * | m, |
|
|
const int * | v, |
|
|
double * | res ) |
matrix - (integer) vector multiplication.
- Parameters
-
[in] | dim | dimension of the square matrix and the integer vector. |
[in] | m | square matrix. |
[in] | v | integer vector. |
[in,out] | res | solution vector of the vector matrix multiplication. |
◆ transpose()
void transpose |
( |
unsigned int | dim, |
|
|
double * | m ) |
square matrix transpose.
- Parameters
-
[in] | dim | dimension of the square matrix. |
[in,out] | m | square matrix. |