33 #ifndef __H__UG__COMMON__MATH_MATRIX_FUNCTIONS__
34 #define __H__UG__COMMON__MATH_MATRIX_FUNCTIONS__
49 template <
typename matrix_t>
51 MatAdd(matrix_t& mOut,
const matrix_t& m1,
const matrix_t& m2);
59 template <
typename matrix_t>
61 MatSubtract(matrix_t& mOut,
const matrix_t& m1,
const matrix_t& m2);
69 template <
size_t N,
size_t M,
size_t L,
typename T>
72 const MathMatrix<N, L, T>& m1,
const MathMatrix<L, M, T>& m2);
76 template <
size_t N,
size_t M,
size_t L,
size_t P,
typename T>
78 MatMultiply(MathMatrix<N, M, T>& mOut,
const MathMatrix<N, L, T>& m1,
79 const MathMatrix<L, P, T>& m2,
const MathMatrix<P, M, T>& m3);
83 template <
size_t N,
size_t M,
size_t L,
typename T>
86 const MathMatrix<L, N, T>& m1,
const MathMatrix<M, L, T>& m2);
90 template <
size_t N,
size_t M,
typename T>
92 MatMultiplyMTM(MathMatrix<N, N, T>& mOut,
const MathMatrix<M, N, T>& m);
96 template <
size_t N,
size_t M,
typename T>
98 MatMultiplyMMT(MathMatrix<M, M, T>& mOut,
const MathMatrix<M, N, T>& m);
102 template <
size_t N,
size_t M,
size_t L,
typename T>
104 MatMultiplyMBT(MathMatrix<N, M, T>& mOut,
const MathMatrix<N, L, T>& m1,
105 const MathMatrix<M, L, T>& m2);
109 template <
size_t N,
size_t M,
size_t L,
typename T>
111 MatMultiplyMTB(MathMatrix<N, M, T>& mOut,
const MathMatrix<L, N, T>& m1,
112 const MathMatrix<L, M, T>& m2);
117 template <
size_t N,
size_t M,
typename T>
119 MatMultiplyMBMT(MathMatrix<N, N, T>& mOut,
const MathMatrix<N, M, T>& m1,
120 const MathMatrix<M, M, T>& m2);
125 template <
size_t N,
size_t M,
typename T>
127 MatMultiplyMTBM(MathMatrix<N, N, T>& mOut,
const MathMatrix<M, N, T>& m1,
128 const MathMatrix<M, M, T>& m2);
134 template <
typename matrix_t>
142 template <
typename matrix_t>
152 template <
typename matrix_t>
158 template <
typename matrix_t>
167 template <
size_t N,
size_t M,
typename T>
169 Transpose(MathMatrix<N,M,T>& mOut,
const MathMatrix<M,N,T>& m);
172 template <
typename matrix_t>
188 template <
size_t N,
typename T>
192 template <
typename T>
196 template <
typename T>
200 template <
typename T>
216 template <
size_t N,
size_t M,
typename T>
220 template <
typename T>
224 template <
typename T>
228 template <
typename T>
245 template <
size_t N,
size_t M,
typename T>
249 template <
typename T>
253 template <
typename T>
257 template <
typename T>
275 template <
size_t N,
size_t M,
typename T>
277 Inverse(MathMatrix<N,M,T>& mOut,
const MathMatrix<M,N,T>& m);
279 template <
typename T>
281 Inverse(MathMatrix<1,1,T>& mOut,
const MathMatrix<1,1,T>& m);
283 template <
typename T>
285 Inverse(MathMatrix<2,2,T>& mOut,
const MathMatrix<2,2,T>& m);
287 template <
typename T>
289 Inverse(MathMatrix<3,3,T>& mOut,
const MathMatrix<3,3,T>& m);
305 template <
size_t N,
size_t M,
typename T>
309 template <
typename T>
313 template <
typename T>
317 template <
typename T>
346 template <
size_t N,
size_t M,
typename T>
348 RightInverse(MathMatrix<N,M,T>& mOut,
const MathMatrix<M,N,T>& m);
350 template <
typename T>
352 RightInverse(MathMatrix<1,1>& mOut,
const MathMatrix<1,1>& m);
354 template <
typename T>
356 RightInverse(MathMatrix<2,2>& mOut,
const MathMatrix<2,2>& m);
358 template <
typename T>
360 RightInverse(MathMatrix<3,3>& mOut,
const MathMatrix<3,3>& m);
387 template <
size_t N,
size_t M,
typename T>
389 LeftInverse(MathMatrix<N,M,T>& mOut,
const MathMatrix<M,N,T>& m);
391 template <
typename T>
393 LeftInverse(MathMatrix<1,1>& mOut,
const MathMatrix<1,1>& m);
395 template <
typename T>
397 LeftInverse(MathMatrix<2,2>& mOut,
const MathMatrix<2,2>& m);
399 template <
typename T>
401 LeftInverse(MathMatrix<3,3>& mOut,
const MathMatrix<3,3>& m);
420 template<
size_t N,
size_t M,
typename T>
434 template <
typename T>
436 Trace(
const MathMatrix<1,1,T>& m);
438 template <
typename T>
440 Trace(
const MathMatrix<2,2,T>& m);
442 template <
typename T>
444 Trace(
const MathMatrix<3,3,T>& m);
452 template <
typename matrix_t>
457 template <
typename matrix_t>
462 template <
typename matrix_t>
467 template <
typename matrix_t>
472 template <
typename matrix_t>
477 template <
typename matrix_t>
482 template <
typename matrix_t>
489 template <
typename matrix_t>
496 template <
typename matrix_t>
503 template <
typename matrix_t>
510 template <
typename matrix_t>
522 template <
typename matrix_t,
typename vector_t>
530 template <
typename matrix_t>
534 template <
typename matrix_t>
538 template <
typename matrix_t>
542 template <
typename matrix_t>
546 template <
typename matrix_t>
551 template <
size_t N,
size_t M,
typename T>
556 template <
size_t N,
size_t M,
typename T>
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
T value_type
Definition: math_matrix.h:65
void MatMultiplyMMT(MathMatrix< M, M, T > &mOut, const MathMatrix< M, N, T > &m)
multiply a matrix with its transposed and stores the result in a second one
Definition: math_matrix_functions_common_impl.hpp:164
matrix_t::value_type MatDeviatorTrace(const matrix_t &m, matrix_t &dev)
Definition: math_matrix_functions_common_impl.hpp:295
MathMatrix< N, M, T >::value_type SqrtGramDeterminant(const MathMatrix< N, M, T > &m)
Square root of Gram Determinant of a matrix.
Definition: math_matrix_functions_common_impl.hpp:508
matrix_t::value_type MatContraction(const matrix_t &m1, const matrix_t &m2)
Definition: math_matrix_functions_common_impl.hpp:275
MathMatrix< N, M, T >::value_type RightInverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Right-Inverse of a Matrix.
Definition: math_matrix_functions_common_impl.hpp:679
void MatMultiplyMBMT(MathMatrix< N, N, T > &mOut, const MathMatrix< N, M, T > &m1, const MathMatrix< M, M, T > &m2)
Definition: math_matrix_functions_common_impl.hpp:223
MathMatrix< N, M, T >::value_type MinAbsEigenvalue(const MathMatrix< M, N, T > &m)
Computes minimum eigenvalue of a (symmetric) matrix.
void MatRotationX(matrix_t &mOut, typename matrix_t::value_type rads)
Fills the matrix with a matrix that rotates around the x-axis in 3 dimensions.
Definition: math_matrix_functions_common_impl.hpp:873
void Transpose(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
transpose a matrix
Definition: math_matrix_functions_common_impl.hpp:345
MathMatrix< 1, 1, T >::value_type Trace(const MathMatrix< 1, 1, T > &m)
Trace of a Matrix.
Definition: math_matrix_functions_common_impl.hpp:769
matrix_t::value_type MatInftyNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:1006
void MatMultiplyMTB(MathMatrix< N, M, T > &mOut, const MathMatrix< L, N, T > &m1, const MathMatrix< L, M, T > &m2)
multiply the transposed of a matrix with a matrix and stores the result in mOut
Definition: math_matrix_functions_common_impl.hpp:205
MathMatrix< N, M, T >::value_type GeneralizedInverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Definition: math_matrix_functions_common_impl.hpp:751
void MatMultiplyMBT(MathMatrix< N, M, T > &mOut, const MathMatrix< N, L, T > &m1, const MathMatrix< M, L, T > &m2)
multiply a matrix with the transposed of a second one and stores the result in mOut
Definition: math_matrix_functions_common_impl.hpp:187
void MatMultiplyTransposed(MathMatrix< N, M, T > &mOut, const MathMatrix< L, N, T > &m1, const MathMatrix< M, L, T > &m2)
multiply two transposed matrices and stores the result in a third one
Definition: math_matrix_functions_common_impl.hpp:125
void MatIdentity(matrix_t &mOut)
Fills the matrix with the identity matrix.
Definition: math_matrix_functions_common_impl.hpp:865
void MatSet(matrix_t &mInOut, typename matrix_t::value_type s)
Set each matrix entry to a scalar (componentwise)
Definition: math_matrix_functions_common_impl.hpp:794
MathMatrix< N, N, T >::value_type Determinant(const MathMatrix< N, N, T > &m)
Determinant of a matrix.
Definition: math_matrix_functions_common_impl.hpp:382
void MatDiagSet(matrix_t &mInOut, typename matrix_t::value_type s)
Set diagonal entries of a matrix to a scalar (other entries are not changed)
Definition: math_matrix_functions_common_impl.hpp:806
void MatRotationZ(matrix_t &mOut, typename matrix_t::value_type rads)
Fills the matrix with a matrix that rotates around the y-axis in 2 or 3 dimensions.
Definition: math_matrix_functions_common_impl.hpp:903
matrix_t::value_type MatOneNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:988
void MatRotationY(matrix_t &mOut, typename matrix_t::value_type rads)
Fills the matrix with a matrix that rotates around the y-axis in 3 dimensions.
Definition: math_matrix_functions_common_impl.hpp:888
matrix_t::value_type MatFrobeniusNormSq(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:966
matrix_t::value_type MatMaxNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:1024
void MatMultiplyMTM(MathMatrix< N, N, T > &mOut, const MathMatrix< M, N, T > &m)
multiply a transposed matrix with itself and stores the result in a second one
Definition: math_matrix_functions_common_impl.hpp:141
MathMatrix< N, M, T >::value_type GramDeterminant(const MathMatrix< N, M, T > &m)
Gram Determinant of a matrix.
Definition: math_matrix_functions_common_impl.hpp:444
void MatAdd(matrix_t &mOut, const matrix_t &m1, const matrix_t &m2)
adds two matrices and stores the result in a third one
Definition: math_matrix_functions_common_impl.hpp:52
void MatScale(matrix_t &mOut, typename matrix_t::value_type s, const matrix_t &m)
scales a matrix_t
Definition: math_matrix_functions_common_impl.hpp:317
void MatRotationYawPitchRoll(matrix_t &mOut, typename matrix_t::value_type yaw, typename matrix_t::value_type pitch, typename matrix_t::value_type roll)
Creates a rotation matrix given yaw, pitch and roll in radiants.
Definition: math_matrix_functions_common_impl.hpp:919
MathMatrix< N, M, T >::value_type LeftInverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Left-Inverse of a Matrix.
Definition: math_matrix_functions_common_impl.hpp:715
matrix_t::value_type MatFrobeniusNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:981
MathMatrix< N, M, T >::value_type InverseTransposed(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix)
Definition: math_matrix_functions_common_impl.hpp:622
void MatMultiply(MathMatrix< N, M, T > &mOut, const MathMatrix< N, L, T > &m1, const MathMatrix< L, M, T > &m2)
multiply two matrices and stores the result in a third one
Definition: math_matrix_functions_common_impl.hpp:85
void MatMultiplyMTBM(MathMatrix< N, N, T > &mOut, const MathMatrix< M, N, T > &m1, const MathMatrix< M, M, T > &m2)
Definition: math_matrix_functions_common_impl.hpp:247
MathMatrix< N, M, T >::value_type Inverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Inverse of a matrix.
Definition: math_matrix_functions_common_impl.hpp:560
void MatSubtract(matrix_t &mOut, const matrix_t &m1, const matrix_t &m2)
subtracts m2 from m1 and stores the result in a mOut
Definition: math_matrix_functions_common_impl.hpp:68
MathMatrix< N, M, T >::value_type MaxAbsEigenvalue(const MathMatrix< M, N, T > &m)
Computes maximum eigenvalue of a (symmetric) matrix.
Definition: math_matrix_functions_common_impl.hpp:1041
void MatScaleAppend(matrix_t &mOut, typename matrix_t::value_type s, const matrix_t &m)
scales a matrix_t and adds to result to a second matrix
Definition: math_matrix_functions_common_impl.hpp:329
void MatHouseholder(matrix_t &mOut, const vector_t &orthoVec)
Definition: math_matrix_functions_common_impl.hpp:942
void MatDivide(matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
Devide a matrix by a scalar (componentwise)
Definition: math_matrix_functions_common_impl.hpp:841
T value_type
Definition: sparsematrix_interface.h:2