JWS C Library
C language utility library
|
Definitions for mathematical matrix operations. More...
#include <jwsc/config.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <inttypes.h>
#include "jwsc/base/error.h"
#include "jwsc/math/complex.h"
#include "jwsc/math/constants.h"
#include "jwsc/math/blas.h"
#include "jwsc/math/lapack.h"
#include "jwsc/vector/vector.h"
#include "jwsc/vector/vector_math.h"
#include "jwsc/matrix/matrix.h"
#include "jwsc/matrix/matrix_math.h"
Go to the source code of this file.
Functions | |
add_scalar_to_matrix | |
Adds a scalar to a matrix. | |
void | add_scalar_to_matrix_f (Matrix_f **m_out, const Matrix_f *m_in, float a) |
Adds a scalar to a single precision matrix. | |
void | add_scalar_to_matrix_d (Matrix_d **m_out, const Matrix_d *m_in, double a) |
Adds a scalar to a double precision matrix. | |
void | add_scalar_to_matrix_cf (Matrix_cf **m_out, const Matrix_cf *m_in, Complex_f z) |
Adds a scalar to a single precision complex matrix. | |
void | add_scalar_to_matrix_cd (Matrix_cd **m_out, const Matrix_cd *m_in, Complex_d z) |
Adds a scalar to a double precision complex matrix. | |
multiply_matrix_by_scalar | |
Multiplies a matrix by a scalar. | |
void | multiply_matrix_by_scalar_f (Matrix_f **m_out, const Matrix_f *m_in, float a) |
Multiplies a single precision matrix by a scalar. | |
void | multiply_matrix_by_scalar_d (Matrix_d **m_out, const Matrix_d *m_in, double a) |
Multiplies a double precision matrix by a scalar. | |
void | multiply_matrix_by_scalar_cf (Matrix_cf **m_out, const Matrix_cf *m_in, Complex_f z) |
Multiplies a single precision complex matrix by a scalar. | |
void | multiply_matrix_by_scalar_cd (Matrix_cd **m_out, const Matrix_cd *m_in, Complex_d z) |
Multiplies a double precision complex matrix by a scalar. | |
multiply_matrices | |
Multiplies a two matrices. | |
Error * | multiply_matrices_f (Matrix_f **m_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Multiples two single precision matrices. | |
Error * | multiply_matrices_d (Matrix_d **m_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Multiples two double precision matrices. | |
Error * | multiply_matrices_cf (Matrix_cf **m_out, const Matrix_cf *m_1, const Matrix_cf *m_2) |
Multiples two single precision complex matrices. | |
Error * | multiply_matrices_cd (Matrix_cd **m_out, const Matrix_cd *m_1, const Matrix_cd *m_2) |
Multiples two double precision complex matrices. | |
multiply_matrices_elt_wise | |
Multiplies a two matrices element by element. | |
Error * | multiply_matrices_elt_wise_f (Matrix_f **m_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Multiples two single precision matrices element by element. | |
Error * | multiply_matrices_elt_wise_d (Matrix_d **m_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Multiples two double precision matrices element by element. | |
Error * | multiply_matrices_elt_wise_cf (Matrix_cf **m_out, const Matrix_cf *m_1, const Matrix_cf *m_2) |
Multiples two single precision complex matrices element by element. | |
Error * | multiply_matrices_elt_wise_cd (Matrix_cd **m_out, const Matrix_cd *m_1, const Matrix_cd *m_2) |
Multiples two double precision complex matrices element by element. | |
transpose_matrix | |
Transposes a matrix. | |
void | transpose_matrix_f (Matrix_f **m_out, const Matrix_f *m_in) |
Transposes a single precision matrix. | |
void | transpose_matrix_d (Matrix_d **m_out, const Matrix_d *m_in) |
Transposes a double precision matrix. | |
void | transpose_matrix_cf (Matrix_cf **m_out, const Matrix_cf *m_in) |
Transposes a single precision matrix. | |
void | transpose_matrix_cd (Matrix_cd **m_out, const Matrix_cd *m_in) |
Transposes a double precision complex matrix. | |
multiply_matrix_and_vector | |
Multiplies a matrix and a vector. | |
Error * | multiply_matrix_and_vector_f (Vector_f **v_out, const Matrix_f *m_in, const Vector_f *v_in) |
Multiplies a single precision matrix and vector. | |
Error * | multiply_matrix_and_vector_d (Vector_d **v_out, const Matrix_d *m_in, const Vector_d *v_in) |
Multiplies a double precision matrix and vector. | |
Error * | multiply_matrix_and_vector_cf (Vector_cf **v_out, const Matrix_cf *m_in, const Vector_cf *v_in) |
Multiplies a single precision complex matrix and vector. | |
Error * | multiply_matrix_and_vector_cd (Vector_cd **v_out, const Matrix_cd *m_in, const Vector_cd *v_in) |
Multiplies a double precision complex matrix and vector. | |
add_matrices | |
Adds two matrices element-wise. | |
Error * | add_matrices_f (Matrix_f **m_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Adds two single precision matrices element-wise. | |
Error * | add_matrices_d (Matrix_d **m_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Adds two double precision matrices element-wise. | |
Error * | add_matrices_cf (Matrix_cf **m_out, const Matrix_cf *m_1, const Matrix_cf *m_2) |
Adds two single precision complex matrices element-wise. | |
Error * | add_matrices_cd (Matrix_cd **m_out, const Matrix_cd *m_1, const Matrix_cd *m_2) |
Adds two double precision complex matrices element-wise. | |
subtract_matrices | |
Subtracts two matrices element-wise. | |
Error * | subtract_matrices_f (Matrix_f **m_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Subtracts two single precision matrices element-wise. | |
Error * | subtract_matrices_d (Matrix_d **m_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Subtracts two double precision matrices element-wise. | |
Error * | subtract_matrices_cf (Matrix_cf **m_out, const Matrix_cf *m_1, const Matrix_cf *m_2) |
Subtracts two single precision complex matrices element-wise. | |
Error * | subtract_matrices_cd (Matrix_cd **m_out, const Matrix_cd *m_1, const Matrix_cd *m_2) |
Subtracts two double precision complex matrices element-wise. | |
calc_matrix_asum | |
Calculates the absolute sum of a real matrix. | |
void | calc_matrix_asum_f (float *sum_out, const Matrix_f *m) |
Calculates the absolute value sum of a single precision matrix. | |
void | calc_matrix_asum_d (double *sum_out, const Matrix_d *m) |
Calculates the absolute value sum of a double precision matrix. | |
normalize_matrix_sum | |
Normalizes a real matrix by its sum. | |
void | normalize_matrix_sum_f (Matrix_f **m_out, const Matrix_f *m_in) |
Normalizes a single precision matrix by its sum. | |
void | normalize_matrix_sum_d (Matrix_d **m_out, const Matrix_d *m_in) |
Normalizes a double precision matrix by its sum. | |
calc_frobenius_norm | |
Calculates the Frobenius norm (euclidean norm) of a matrix. | |
void | calc_frobenius_norm_f (float *norm_out, const Matrix_f *m) |
Calculates the Frobenius norm of a single precision matrix. | |
void | calc_frobenius_norm_d (double *norm_out, const Matrix_d *m) |
Calculates the Frobenius norm of a double precision matrix. | |
calc_frobenius_norm_diff | |
Calculates the Frobenius norm (euclidean norm) of a difference of two matrices. | |
Error * | calc_frobenius_norm_diff_f (float *norm_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Calculates the Frobenius norm of a difference of two single precision matrix. | |
Error * | calc_frobenius_norm_diff_d (double *norm_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Calculates the Frobenius norm of a difference of two double precision matrix. | |
calc_frobenius_norm_abs_diff | |
Calculates the Frobenius norm (euclidean norm) of a difference of two matrices, applying the absolute value to each matrix first. | |
Error * | calc_frobenius_norm_abs_diff_f (float *norm_out, const Matrix_f *m_1, const Matrix_f *m_2) |
Calculates the Frobenius norm of a difference of two single precision matrix, applying the absolute value to each matrix first. | |
Error * | calc_frobenius_norm_abs_diff_d (double *norm_out, const Matrix_d *m_1, const Matrix_d *m_2) |
Calculates the Frobenius norm of a difference of two double precision matrix, applying the absolute value to each matrix first. | |
calc_lu_matrix_determinant | |
Calculates the determinant of an LU decomposed matrix. | |
Error * | calc_lu_matrix_determinant_f (float *det_out, const Matrix_f *m, const Vector_i32 *pivot) |
Calculates the determinant of an LU decomposed single precision matrix. | |
Error * | calc_lu_matrix_determinant_d (double *det_out, const Matrix_d *m, const Vector_i32 *pivot) |
Calculates the determinant of an LU decomposed double precision matrix. | |
create_euler_rotation_matrix | |
Creates a standard Euler rotation matrix with angles phi, theta and psi. | |
void | create_euler_rotation_matrix_f (Matrix_f **m_out, float phi, float theta, float psi) |
Creates a single precision Euler rotation matrix. | |
void | create_euler_rotation_matrix_d (Matrix_d **m_out, float phi, float theta, float psi) |
Creates a double precision Euler rotation matrix. | |
create_3d_rotation_matrix | |
Creates a matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_rotation_matrix_1_f (Matrix_f **m_out, float phi, const Vector_f *v) |
Creates a single precision matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_rotation_matrix_1_d (Matrix_d **m_out, double phi, const Vector_d *v) |
Creates a double precision matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_rotation_matrix_2_f (Matrix_f **m_out, float phi, float x, float y, float z) |
Creates a single precision matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_rotation_matrix_2_d (Matrix_d **m_out, double phi, double x, double y, double z) |
Creates a double precision matrix for rotating points around an arbitrary vector. | |
create_3d_homo_rotation_matrix | |
Creates a homogeneous matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_homo_rotation_matrix_1_f (Matrix_f **m_out, float phi, const Vector_f *v) |
Creates a single precision homogeneous matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_homo_rotation_matrix_1_d (Matrix_d **m_out, double phi, const Vector_d *v) |
Creates a double precision homogeneous matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_homo_rotation_matrix_2_f (Matrix_f **m_out, float phi, float x, float y, float z) |
Creates a single precision homogeneous matrix for rotating points around an arbitrary vector. | |
Error * | create_3d_homo_rotation_matrix_2_d (Matrix_d **m_out, double phi, double x, double y, double z) |
Creates a double precision homogeneous matrix for rotating points around an arbitrary vector. | |
create_3d_scaling_matrix | |
Creates a matrix for scaling points. | |
Error * | create_3d_scaling_matrix_1_f (Matrix_f **m_out, const Vector_f *v) |
Creates a single precision matrix for scaling points. | |
Error * | create_3d_scaling_matrix_1_d (Matrix_d **m_out, const Vector_d *v) |
Creates a double precision matrix for scaling points. | |
Error * | create_3d_scaling_matrix_2_f (Matrix_f **m_out, float x, float y, float z) |
Creates a single precision matrix for scaling points. | |
Error * | create_3d_scaling_matrix_2_d (Matrix_d **m_out, double x, double y, double z) |
Creates a double precision matrix for scaling points. | |
create_3d_homo_scaling_matrix | |
Creates a homogeneous matrix for scaling points. | |
Error * | create_3d_homo_scaling_matrix_1_f (Matrix_f **m_out, const Vector_f *v) |
Creates a single precision homogeneous matrix for scaling points. | |
Error * | create_3d_homo_scaling_matrix_1_d (Matrix_d **m_out, const Vector_d *v) |
Creates a double precision homogeneous matrix for scaling points. | |
Error * | create_3d_homo_scaling_matrix_2_f (Matrix_f **m_out, float x, float y, float z) |
Creates a single precision homogeneous matrix for scaling points. | |
Error * | create_3d_homo_scaling_matrix_2_d (Matrix_d **m_out, double x, double y, double z) |
Creates a double precision homogeneous matrix for scaling points. | |
create_3d_homo_translation_matrix | |
Creates a homogeneous matrix for translating points in R^3. | |
Error * | create_3d_homo_translation_matrix_1_f (Matrix_f **m_out, const Vector_f *v) |
Creates a single precision homogeneous matrix for translating points in R^3. | |
Error * | create_3d_homo_translation_matrix_1_d (Matrix_d **m_out, const Vector_d *v) |
Creates a double precision homogeneous matrix for translating points in R^3. | |
Error * | create_3d_homo_translation_matrix_2_f (Matrix_f **m_out, float x, float y, float z) |
Creates a single precision homogeneous matrix for translating points in R^3. | |
Error * | create_3d_homo_translation_matrix_2_d (Matrix_d **m_out, double x, double y, double z) |
Creates a double precision homogeneous matrix for translating points in R^3. |
Definitions for mathematical matrix operations.
Many of the functions are accelerated if linked against an optimized BLAS library.
Definition in file matrix_math.c.
Adds a scalar to a single precision matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to add a to. |
a | Scalar to add to the values of m_in. |
Definition at line 87 of file matrix_math.c.
Adds a scalar to a double precision matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to add a to. |
a | Scalar to add to the values of m_in. |
Definition at line 122 of file matrix_math.c.
Adds a scalar to a single precision complex matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to add a to. |
z | Scalar to add to the values of m_in. |
Definition at line 157 of file matrix_math.c.
Adds a scalar to a double precision complex matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to add a to. |
z | Scalar to add to the values of m_in. |
Definition at line 193 of file matrix_math.c.
Multiplies a single precision matrix by a scalar.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply scalar with. |
a | Scalar to multiply by the values of m_in. |
Definition at line 241 of file matrix_math.c.
Multiplies a double precision matrix by a scalar.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply scalar with. |
a | Scalar to multiply by the values of m_in. |
Definition at line 289 of file matrix_math.c.
Multiplies a single precision complex matrix by a scalar.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply scalar with. |
z | Scalar to multiply by the values of m_in. |
Definition at line 337 of file matrix_math.c.
Multiplies a double precision complex matrix by a scalar.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply scalar with. |
z | Scalar to multiply by the values of m_in. |
Definition at line 390 of file matrix_math.c.
Multiples two single precision matrices.
The matrices must have the proper dimensions for multiplication.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | First (left) matrix in the multiply operation. |
m_2 | Second (right) matrix in the multiply operation. |
Definition at line 463 of file matrix_math.c.
Multiples two double precision matrices.
The matrices must have the proper dimensions for multiplication.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | First (left) matrix in the multiply operation. |
m_2 | Second (right) matrix in the multiply operation. |
Definition at line 544 of file matrix_math.c.
Multiples two single precision complex matrices.
The matrices must have the proper dimensions for multiplication.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | First (left) matrix in the multiply operation. |
m_2 | Second (right) matrix in the multiply operation. |
Definition at line 625 of file matrix_math.c.
Multiples two double precision complex matrices.
The matrices must have the proper dimensions for multiplication.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | First (left) matrix in the multiply operation. |
m_2 | Second (right) matrix in the multiply operation. |
Definition at line 715 of file matrix_math.c.
Error* multiply_matrices_elt_wise_f | ( | Matrix_f ** | m_out, |
const Matrix_f * | m_1, | ||
const Matrix_f * | m_2 | ||
) |
Multiples two single precision matrices element by element.
The matrices must have the same dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | First (left) matrix in the multiply operation. |
m_2 | Second (right) matrix in the multiply operation. |
Definition at line 816 of file matrix_math.c.
Error* multiply_matrices_elt_wise_d | ( | Matrix_d ** | m_out, |
const Matrix_d * | m_1, | ||
const Matrix_d * | m_2 | ||
) |
Multiples two double precision matrices element by element.
Definition at line 858 of file matrix_math.c.
Error* multiply_matrices_elt_wise_cf | ( | Matrix_cf ** | m_out, |
const Matrix_cf * | m_1, | ||
const Matrix_cf * | m_2 | ||
) |
Multiples two single precision complex matrices element by element.
Definition at line 902 of file matrix_math.c.
Error* multiply_matrices_elt_wise_cd | ( | Matrix_cd ** | m_out, |
const Matrix_cd * | m_1, | ||
const Matrix_cd * | m_2 | ||
) |
Multiples two double precision complex matrices element by element.
Definition at line 953 of file matrix_math.c.
Transposes a single precision matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to transpose. |
Definition at line 1019 of file matrix_math.c.
Transposes a double precision matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to transpose. |
Definition at line 1057 of file matrix_math.c.
Transposes a single precision matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to transpose. |
Definition at line 1095 of file matrix_math.c.
Transposes a double precision complex matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | matrix to transpose. |
Definition at line 1133 of file matrix_math.c.
Error* multiply_matrix_and_vector_f | ( | Vector_f ** | v_out, |
const Matrix_f * | m_in, | ||
const Vector_f * | v_in | ||
) |
Multiplies a single precision matrix and vector.
The vector is treated as a column vector in the multiplication. The matrix and vector must have compatible dimensions for the matrix and column vector multiplication.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply. |
v_in | Column vector to multiply. |
Definition at line 1194 of file matrix_math.c.
Error* multiply_matrix_and_vector_d | ( | Vector_d ** | v_out, |
const Matrix_d * | m_in, | ||
const Vector_d * | v_in | ||
) |
Multiplies a double precision matrix and vector.
The vector is treated as a column vector in the multiplication. The matrix and vector must have compatible dimensions for the matrix and column vector multiplication.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply. |
v_in | Column vector to multiply. |
Definition at line 1269 of file matrix_math.c.
Error* multiply_matrix_and_vector_cf | ( | Vector_cf ** | v_out, |
const Matrix_cf * | m_in, | ||
const Vector_cf * | v_in | ||
) |
Multiplies a single precision complex matrix and vector.
The vector is treated as a column vector in the multiplication. The matrix and vector must have compatible dimensions for the matrix and column vector multiplication.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply. |
v_in | Column vector to multiply. |
Definition at line 1344 of file matrix_math.c.
Error* multiply_matrix_and_vector_cd | ( | Vector_cd ** | v_out, |
const Matrix_cd * | m_in, | ||
const Vector_cd * | v_in | ||
) |
Multiplies a double precision complex matrix and vector.
The vector is treated as a column vector in the multiplication. The matrix and vector must have compatible dimensions for the matrix and column vector multiplication.
v_out | Result parameter. If *v_out is NULL, a vector is allocated; otherwise its space is re-used. |
m_in | Matrix to multiply. |
v_in | Column vector to multiply. |
Definition at line 1428 of file matrix_math.c.
Adds two single precision matrices element-wise.
The matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to add. |
m_2 | Matrix to add. |
Definition at line 1520 of file matrix_math.c.
Adds two double precision matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to add. |
m_2 | Matrix to add. |
Definition at line 1608 of file matrix_math.c.
Adds two single precision complex matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to add. |
m_2 | Matrix to add. |
Definition at line 1696 of file matrix_math.c.
Adds two double precision complex matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to add. |
m_2 | Matrix to add. |
Definition at line 1788 of file matrix_math.c.
Subtracts two single precision matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to subtract. |
m_2 | Matrix to subtract. |
Definition at line 1892 of file matrix_math.c.
Subtracts two double precision matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to subtract. |
m_2 | Matrix to subtract. |
Definition at line 1984 of file matrix_math.c.
Subtracts two single precision complex matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to subtract. |
m_2 | Matrix to subtract. |
Definition at line 2076 of file matrix_math.c.
Subtracts two double precision complex matrices element-wise.
The Matrix must have equal dimensions.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_1 | Matrix to subtract. |
m_2 | Matrix to subtract. |
Definition at line 2172 of file matrix_math.c.
void calc_matrix_asum_f | ( | float * | sum_out, |
const Matrix_f * | m | ||
) |
Calculates the absolute value sum of a single precision matrix.
sum_out | Result parameter. Sum of the absolute values of m. |
m | Matrix to calculate the sum of. |
Definition at line 2268 of file matrix_math.c.
void calc_matrix_asum_d | ( | double * | sum_out, |
const Matrix_d * | m | ||
) |
Calculates the absolute value sum of a double precision matrix.
sum_out | Result parameter. Sum of the absolute values of m. |
m | Matrix to calculate the sum of. |
Definition at line 2292 of file matrix_math.c.
Normalizes a single precision matrix by its sum.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to normalize. |
Definition at line 2331 of file matrix_math.c.
Normalizes a double precision matrix by its sum.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
m_in | Matrix to normalize. |
Definition at line 2354 of file matrix_math.c.
void calc_frobenius_norm_f | ( | float * | norm_out, |
const Matrix_f * | m | ||
) |
Calculates the Frobenius norm of a single precision matrix.
norm_out | Result parameter. |
m | Matrix to calcualte the norm of. |
Definition at line 2386 of file matrix_math.c.
void calc_frobenius_norm_d | ( | double * | norm_out, |
const Matrix_d * | m | ||
) |
Calculates the Frobenius norm of a double precision matrix.
norm_out | Result parameter. |
m | Matrix to calcualte the norm of. |
Definition at line 2411 of file matrix_math.c.
Calculates the Frobenius norm of a difference of two single precision matrix.
norm_out | Result parameter. |
m_1 | Matrix to calcualte the norm of. |
m_2 | Matrix to calcualte the norm of. |
Definition at line 2451 of file matrix_math.c.
Calculates the Frobenius norm of a difference of two double precision matrix.
norm_out | Result parameter. |
m_1 | Matrix to calcualte the norm of. |
m_2 | Matrix to calcualte the norm of. |
Definition at line 2493 of file matrix_math.c.
Error* calc_frobenius_norm_abs_diff_f | ( | float * | norm_out, |
const Matrix_f * | m_1, | ||
const Matrix_f * | m_2 | ||
) |
Calculates the Frobenius norm of a difference of two single precision matrix, applying the absolute value to each matrix first.
norm_out | Result parameter. |
m_1 | Matrix to calcualte the norm of. |
m_2 | Matrix to calcualte the norm of. |
Definition at line 2548 of file matrix_math.c.
Error* calc_frobenius_norm_abs_diff_d | ( | double * | norm_out, |
const Matrix_d * | m_1, | ||
const Matrix_d * | m_2 | ||
) |
Calculates the Frobenius norm of a difference of two double precision matrix, applying the absolute value to each matrix first.
norm_out | Result parameter. |
m_1 | Matrix to calcualte the norm of. |
m_2 | Matrix to calcualte the norm of. |
Definition at line 2590 of file matrix_math.c.
Error* calc_lu_matrix_determinant_f | ( | float * | det_out, |
const Matrix_f * | m, | ||
const Vector_i32 * | pivot | ||
) |
Calculates the determinant of an LU decomposed single precision matrix.
det_out | Result parameter. |
m | LU decomposed matrix to calculate the determinate of. |
pivot | Pivot elements of the LU decomposition. |
Definition at line 3086 of file matrix_math.c.
Error* calc_lu_matrix_determinant_d | ( | double * | det_out, |
const Matrix_d * | m, | ||
const Vector_i32 * | pivot | ||
) |
Calculates the determinant of an LU decomposed double precision matrix.
det_out | Result parameter. |
m | LU decomposed matrix to calculate the determinate of. |
pivot | Pivot elements of the LU decomposition. |
Definition at line 3127 of file matrix_math.c.
void create_euler_rotation_matrix_f | ( | Matrix_f ** | m_out, |
float | phi, | ||
float | theta, | ||
float | psi | ||
) |
Creates a single precision Euler rotation matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | 1st Euler rotation angle around the z-axis. |
theta | 2nd Euler rotation angle around the x-axis. |
psi | 3rd Euler rotation angle around the z-axis. |
Definition at line 3788 of file matrix_math.c.
void create_euler_rotation_matrix_d | ( | Matrix_d ** | m_out, |
float | phi, | ||
float | theta, | ||
float | psi | ||
) |
Creates a double precision Euler rotation matrix.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | 1st Euler rotation angle around the z-axis. |
theta | 2nd Euler rotation angle around the x-axis. |
psi | 3rd Euler rotation angle around the z-axis. |
Definition at line 3827 of file matrix_math.c.
Creates a single precision matrix for rotating points around an arbitrary vector.
The vector v must have 3 dimensions. The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
v | Vector to rotate around. |
Definition at line 3885 of file matrix_math.c.
Creates a double precision matrix for rotating points around an arbitrary vector.
The vector v must have 3 dimensions. The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
v | Vector to rotate around. |
Definition at line 3918 of file matrix_math.c.
Creates a single precision matrix for rotating points around an arbitrary vector.
The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
x | X-coord of the vector to rotate around. |
y | Y-coord of the vector to rotate around. |
z | Z-coord of the vector to rotate around. |
Definition at line 3952 of file matrix_math.c.
Error* create_3d_rotation_matrix_2_d | ( | Matrix_d ** | m_out, |
double | phi, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Creates a double precision matrix for rotating points around an arbitrary vector.
The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
x | X-coord of the vector to rotate around. |
y | Y-coord of the vector to rotate around. |
z | Z-coord of the vector to rotate around. |
Definition at line 4049 of file matrix_math.c.
Creates a single precision homogeneous matrix for rotating points around an arbitrary vector.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
v | Vector to rotate around. |
Definition at line 4157 of file matrix_math.c.
Creates a double precision homogeneous matrix for rotating points around an arbitrary vector.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
v | Vector to rotate around. |
Definition at line 4191 of file matrix_math.c.
Error* create_3d_homo_rotation_matrix_2_f | ( | Matrix_f ** | m_out, |
float | phi, | ||
float | x, | ||
float | y, | ||
float | z | ||
) |
Creates a single precision homogeneous matrix for rotating points around an arbitrary vector.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
x | X-coord of the vector to rotate around. |
y | Y-coord of the vector to rotate around. |
z | Z-coord of the vector to rotate around. |
Definition at line 4225 of file matrix_math.c.
Error* create_3d_homo_rotation_matrix_2_d | ( | Matrix_d ** | m_out, |
double | phi, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Creates a double precision homogeneous matrix for rotating points around an arbitrary vector.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
phi | Angle of rotation, in radians. Use a positive value for clockwise, negative for counter-clockwise. |
x | X-coord of the vector to rotate around. |
y | Y-coord of the vector to rotate around. |
z | Z-coord of the vector to rotate around. |
Definition at line 4322 of file matrix_math.c.
Creates a single precision matrix for scaling points.
The vector v must have 3 dimensions. The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to scale by. |
Definition at line 4427 of file matrix_math.c.
Creates a double precision matrix for scaling points.
The vector v must have 3 dimensions. The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to scale by. |
Definition at line 4457 of file matrix_math.c.
Creates a single precision matrix for scaling points.
The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to scale by. |
y | Y-coord of the vector to scale by. |
z | Z-coord of the vector to scale by. |
Definition at line 4486 of file matrix_math.c.
Creates a double precision matrix for scaling points.
The resulting matrix will have dimensions 3x3.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to scale by. |
y | Y-coord of the vector to scale by. |
z | Z-coord of the vector to scale by. |
Definition at line 4515 of file matrix_math.c.
Creates a single precision homogeneous matrix for scaling points.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to scale by. |
Definition at line 4557 of file matrix_math.c.
Creates a double precision homogeneous matrix for scaling points.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to rotate around. |
Definition at line 4588 of file matrix_math.c.
Creates a single precision homogeneous matrix for scaling points.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to scale by. |
y | Y-coord of the vector to scale by. |
z | Z-coord of the vector to scale by. |
Definition at line 4617 of file matrix_math.c.
Creates a double precision homogeneous matrix for scaling points.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to scale by. |
y | Y-coord of the vector to scale by. |
z | Z-coord of the vector to scale by. |
Definition at line 4646 of file matrix_math.c.
Creates a single precision homogeneous matrix for translating points in R^3.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to translate by. |
Definition at line 4688 of file matrix_math.c.
Creates a double precision homogeneous matrix for translating points in R^3.
The homogeneous vector v must have at least 3 dimensions. The homogeneous coordinate, if it has one, is ignored and assumed to be 1. The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
v | Vector to translate by. |
Definition at line 4719 of file matrix_math.c.
Creates a single precision homogeneous matrix for translating points in R^3.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to translate by. |
y | Y-coord of the vector to translate by. |
z | Z-coord of the vector to translate by. |
Definition at line 4748 of file matrix_math.c.
Creates a double precision homogeneous matrix for translating points in R^3.
The resulting matrix will be in homogeneous coordinates with dimensions 4x4.
m_out | Result parameter. If *m_out is NULL, a matrix is allocated; otherwise its space is re-used. |
x | X-coord of the vector to translate by. |
y | Y-coord of the vector to translate by. |
z | Z-coord of the vector to translate by. |
Definition at line 4777 of file matrix_math.c.