33 #ifndef __H__UG__COMMON__MATH_MATRIX_FUNCTIONS_COMMON_IMPL__
34 #define __H__UG__COMMON__MATH_MATRIX_FUNCTIONS_COMMON_IMPL__
50 template <
typename matrix_t>
52 MatAdd(matrix_t& mOut,
const matrix_t& m1,
const matrix_t& m2)
54 typedef typename matrix_t::size_type size_type;
55 for(size_type i = 0; i < mOut.num_rows(); ++i)
56 for(size_type j = 0; j < mOut.num_cols(); ++j)
58 mOut(i,j) = m1(i,j) + m2(i,j);
66 template <
typename matrix_t>
68 MatSubtract(matrix_t& mOut,
const matrix_t& m1,
const matrix_t& m2)
70 typedef typename matrix_t::size_type size_type;
71 for(size_type i = 0; i < mOut.num_rows(); ++i)
72 for(size_type j = 0; j < mOut.num_cols(); ++j)
74 mOut(i,j) = m1(i,j) - m2(i,j);
83 template <
size_t N,
size_t M,
size_t L,
typename T>
88 for(
size_t i = 0; i < N; ++i)
89 for(
size_t j = 0; j < M; ++j)
92 for(
size_t k = 0; k < L; ++k)
94 mOut(i,j) += m1(i,k) * m2(k,j);
99 template <
size_t N,
size_t M,
size_t L,
size_t P,
typename T>
106 for(
size_t i = 0; i < N; ++i)
107 for(
size_t j = 0; j < M; ++j)
110 for(
size_t k = 0; k < L; ++k)
113 for(
size_t l = 0; l < P; ++l)
115 help(k,j) += m2(k,l) * m3(l,j);
118 mOut(i,j) += m1(i,k) * help(k,j);
123 template <
size_t N,
size_t M,
size_t L,
typename T>
128 for(
size_t i = 0; i < N; ++i)
129 for(
size_t j = 0; j < M; ++j)
132 for(
size_t k = 0; k < L; ++k)
134 mOut(i,j) += m1(k,i) * m2(j,k);
139 template <
size_t N,
size_t M,
typename T>
143 for(
size_t i = 0; i < N; ++i)
145 for(
size_t j = 0; j < i; ++j)
148 for(
size_t k = 0; k < M; ++k)
150 mOut(i,j) += m(k,i) * m(k,j);
152 mOut(j,i) = mOut(i,j);
155 for(
size_t k = 0; k < M; ++k)
157 mOut(i,i) += m(k,i) * m(k,i);
162 template <
size_t N,
size_t M,
typename T>
166 for(
size_t i = 0; i < M; ++i)
168 for(
size_t j = 0; j < i; ++j)
171 for(
size_t k = 0; k < N; ++k)
173 mOut(i,j) += m(i,k) * m(j,k);
175 mOut(j,i) = mOut(i,j);
178 for(
size_t k = 0; k < N; ++k)
180 mOut(i,i) += m(i,k) * m(i,k);
185 template <
size_t N,
size_t M,
size_t L,
typename T>
190 for(
size_t i = 0; i < N; ++i)
192 for(
size_t j = 0; j < M; ++j)
195 for(
size_t k = 0; k < L; ++k)
197 mOut(i,j) += m1(i,k) * m2(j,k);
203 template <
size_t N,
size_t M,
size_t L,
typename T>
208 for(
size_t i = 0; i < N; ++i)
210 for(
size_t j = 0; j < M; ++j)
213 for(
size_t k = 0; k < L; ++k)
215 mOut(i,j) += m1(k,i) * m2(k,j);
221 template <
size_t N,
size_t M,
typename T>
228 for(
size_t i = 0; i < N; ++i)
229 for(
size_t j = 0; j < N; ++j)
232 for(
size_t k = 0; k < M; ++k)
235 for(
size_t l = 0; l < M; ++l)
237 help(k,j) += m2(k,l) * m1(j,l);
240 mOut(i,j) += m1(i,k) * help(k,j);
245 template <
size_t N,
size_t M,
typename T>
252 for(
size_t i = 0; i < N; ++i)
253 for(
size_t j = 0; j < N; ++j)
256 for(
size_t k = 0; k < M; ++k)
259 for(
size_t l = 0; l < M; ++l)
261 help(k,j) += m2(k,l) * m1(l,j);
264 mOut(i,j) += m1(k,i) * help(k,j);
273 template <
typename matrix_t>
278 typedef typename matrix_t::size_type size_type;
279 for(size_type i = 0; i < m1.num_rows(); ++i)
280 for(size_type j = 0; j < m1.num_cols(); ++j)
282 norm += m1(i,j) * m2(i,j);
293 template <
typename matrix_t>
299 typedef typename matrix_t::size_type size_type;
300 for(size_type i = 0; i < m.num_rows(); ++i)
302 for(size_type j = 0; j < m.num_cols(); ++j)
306 dev(i,i) -= 1.0 / 3.0 * trace;
315 template <
typename matrix_t>
319 typedef typename matrix_t::size_type size_type;
320 for(size_type i = 0; i < mOut.num_rows(); ++i)
321 for(size_type j = 0; j < mOut.num_cols(); ++j)
323 mOut(i, j) = m(i, j) *
s;
327 template <
typename matrix_t>
331 typedef typename matrix_t::size_type size_type;
332 for(size_type i = 0; i < mOut.num_rows(); ++i)
333 for(size_type j = 0; j < mOut.num_cols(); ++j)
335 mOut(i, j) += m(i, j) *
s;
343 template <
size_t N,
size_t M,
typename T>
348 for(size_type i = 0; i < mOut.
num_rows(); ++i)
349 for(size_type j = 0; j < mOut.
num_cols(); ++j)
351 mOut(i, j) = m(j, i);
355 template <
typename matrix_t>
359 UG_ASSERT(m.num_rows()==m.num_cols(),
"Transpose: Square Matrix needed");
361 typedef typename matrix_t::size_type size_type;
363 for(size_type i = 1; i < m.num_rows(); ++i)
364 for(size_type j = 0; j < i; ++j)
365 _temp(i, j) = m(i, j);
367 for(size_type i = 1; i < m.num_rows(); ++i)
368 for(size_type j = 0; j < i; ++j)
371 for(size_type i = 0; i < m.num_rows()-1; ++i)
372 for(size_type j = i+1; j < m.num_cols(); ++j)
373 m(i, j) = _temp(j, i);
380 template <
size_t N,
typename T>
384 UG_THROW(
"Determinant for matrix of size "<<N<<
"x"<<N<<
" not implemented.");
387 template <
typename T>
394 template <
typename T>
401 template <
typename T>
405 return (m(0,0)*m(1,1) - m(1,0)*m(0,1));
408 template <
typename T>
412 return m(0,0)*m(1,1)*m(2,2)
413 + m(0,1)*m(1,2)*m(2,0)
414 + m(0,2)*m(1,0)*m(2,1)
415 - m(0,0)*m(1,2)*m(2,1)
416 - m(0,1)*m(1,0)*m(2,2)
417 - m(0,2)*m(1,1)*m(2,0);
420 template <
typename T>
424 return m(0,3)*m(1,2)*m(2,1)*m(3,0)-m(0,2)*m(1,3)*m(2,1)*m(3,0)
425 - m(0,3)*m(1,1)*m(2,2)*m(3,0)+m(0,1)*m(1,3)*m(2,2)*m(3,0)
426 + m(0,2)*m(1,1)*m(2,3)*m(3,0)-m(0,1)*m(1,2)*m(2,3)*m(3,0)
427 - m(0,3)*m(1,2)*m(2,0)*m(3,1)+m(0,2)*m(1,3)*m(2,0)*m(3,1)
428 + m(0,3)*m(1,0)*m(2,2)*m(3,1)-m(0,0)*m(1,3)*m(2,2)*m(3,1)
429 - m(0,2)*m(1,0)*m(2,3)*m(3,1)+m(0,0)*m(1,2)*m(2,3)*m(3,1)
430 + m(0,3)*m(1,1)*m(2,0)*m(3,2)-m(0,1)*m(1,3)*m(2,0)*m(3,2)
431 - m(0,3)*m(1,0)*m(2,1)*m(3,2)+m(0,0)*m(1,3)*m(2,1)*m(3,2)
432 + m(0,1)*m(1,0)*m(2,3)*m(3,2)-m(0,0)*m(1,1)*m(2,3)*m(3,2)
433 - m(0,2)*m(1,1)*m(2,0)*m(3,3)+m(0,1)*m(1,2)*m(2,0)*m(3,3)
434 + m(0,2)*m(1,0)*m(2,1)*m(3,3)-m(0,0)*m(1,2)*m(2,1)*m(3,3)
435 - m(0,1)*m(1,0)*m(2,2)*m(3,3)+m(0,0)*m(1,1)*m(2,2)*m(3,3);
442 template <
size_t N,
size_t M,
typename T>
460 template <
typename T>
467 template <
size_t N,
typename T>
474 template <
size_t M,
typename T>
481 template <
typename T>
488 template <
typename T>
495 template <
typename T>
506 template <
size_t N,
size_t M,
typename T>
513 template <
typename T>
520 template <
size_t N,
typename T>
527 template <
size_t M,
typename T>
534 template <
typename T>
541 template <
typename T>
548 template <
typename T>
559 template <
size_t N,
size_t M,
typename T>
563 UG_THROW(
"Inverse for matrix of size "<<N<<
"x"<<M<<
" not implemented.");
566 template <
typename T>
571 UG_ASSERT(&mOut != &m,
"Inverse: mOut and m have to be different");
572 UG_ASSERT(det != 0,
"Inverse: determinate is zero, can not Invert Matrix");
573 mOut(0,0) = 1./m(0,0);
578 template <
typename T>
583 UG_ASSERT(&mOut != &m,
"Inverse: mOut and m have to be different");
584 UG_ASSERT(det != 0,
"Inverse: determinate is zero, can not Invert Matrix");
587 mOut(0,0) = m(1,1)*invdet;
588 mOut(1,0) = -m(1,0)*invdet;
589 mOut(0,1) = -m(0,1)*invdet;
590 mOut(1,1) = m(0,0)*invdet;
595 template <
typename T>
600 UG_ASSERT(&mOut != &m,
"Inverse: mOut and m have to be different");
601 UG_ASSERT(det != 0,
"Inverse: determinate is zero, can not Invert Matrix");
604 mOut(0,0) = ( m(1,1)*m(2,2) - m(1,2)*m(2,1)) * invdet;
605 mOut(0,1) = (-m(0,1)*m(2,2) + m(0,2)*m(2,1)) * invdet;
606 mOut(0,2) = ( m(0,1)*m(1,2) - m(0,2)*m(1,1)) * invdet;
607 mOut(1,0) = (-m(1,0)*m(2,2) + m(1,2)*m(2,0)) * invdet;
608 mOut(1,1) = ( m(0,0)*m(2,2) - m(0,2)*m(2,0)) * invdet;
609 mOut(1,2) = (-m(0,0)*m(1,2) + m(0,2)*m(1,0)) * invdet;
610 mOut(2,0) = ( m(1,0)*m(2,1) - m(1,1)*m(2,0)) * invdet;
611 mOut(2,1) = (-m(0,0)*m(2,1) + m(0,1)*m(2,0)) * invdet;
612 mOut(2,2) = ( m(0,0)*m(1,1) - m(0,1)*m(1,0)) * invdet;
621 template <
size_t N,
size_t M,
typename T>
625 UG_THROW(
"InverseTransposed for matrix of size "<<M<<
"x"<<N<<
" not implemented.");
628 template <
typename T>
635 template <
typename T>
640 UG_ASSERT(&mOut != &m,
"InverseTransposed: mOut and m have to be different");
641 UG_ASSERT(det != 0,
"InverseTransposed: determinate is zero, can not Invert Matrix");
644 mOut(0,0) = m(1,1)*invdet;
645 mOut(1,0) = -m(0,1)*invdet;
646 mOut(0,1) = -m(1,0)*invdet;
647 mOut(1,1) = m(0,0)*invdet;
652 template <
typename T>
657 UG_ASSERT(&mOut != &m,
"InverseTransposed: mOut and m have to be different");
658 UG_ASSERT(det != 0,
"InverseTransposed: determinate is zero, can not Invert Matrix");
661 mOut(0,0) = ( m(1,1)*m(2,2) - m(2,1)*m(1,2)) * invdet;
662 mOut(0,1) = (-m(1,0)*m(2,2) + m(2,0)*m(1,2)) * invdet;
663 mOut(0,2) = ( m(1,0)*m(2,1) - m(2,0)*m(1,1)) * invdet;
664 mOut(1,0) = (-m(0,1)*m(2,2) + m(2,1)*m(0,2)) * invdet;
665 mOut(1,1) = ( m(0,0)*m(2,2) - m(2,0)*m(0,2)) * invdet;
666 mOut(1,2) = (-m(0,0)*m(2,1) + m(2,0)*m(0,1)) * invdet;
667 mOut(2,0) = ( m(0,1)*m(1,2) - m(1,1)*m(0,2)) * invdet;
668 mOut(2,1) = (-m(0,0)*m(1,2) + m(1,0)*m(0,2)) * invdet;
669 mOut(2,2) = ( m(0,0)*m(1,1) - m(1,0)*m(0,1)) * invdet;
678 template <
size_t N,
size_t M,
typename T>
684 UG_THROW (
"RightInverse: Type mismatch, cannot right-invert a MxN-matrix with M > N!");
698 template <
typename T>
702 template <
typename T>
706 template <
typename T>
714 template <
size_t N,
size_t M,
typename T>
720 UG_THROW (
"LeftInverse: Type mismatch, cannot right-invert a MxN-matrix with M < N!");
735 template <
typename T>
739 template <
typename T>
743 template <
typename T>
751 template <
typename T>
758 template <
typename T>
762 return (m(0,0)+m(1,1));
765 template <
typename T>
769 return (m(0,0)+m(1,1)+m(2,2));
776 template <
typename matrix_t>
780 typedef typename matrix_t::size_type size_type;
781 for(size_type i = 0; i < mInOut.num_rows(); ++i)
782 for(size_type j = 0; j < mInOut.num_cols(); ++j)
788 template <
typename matrix_t>
792 typedef typename matrix_t::size_type size_type;
793 for(size_type i = 0; i < mInOut.num_rows(); ++i)
799 template <
typename matrix_t>
803 typedef typename matrix_t::size_type size_type;
804 for(size_type i = 0; i < mOut.num_rows(); ++i)
805 for(size_type j = 0; j < mOut.num_cols(); ++j)
807 mOut(i, j) = m(i,j) +
s;
811 template <
typename matrix_t>
815 typedef typename matrix_t::size_type size_type;
816 for(size_type i = 0; i < mOut.num_rows(); ++i)
817 for(size_type j = 0; j < mOut.num_cols(); ++j)
819 mOut(i, j) = m(i,j) -
s;
823 template <
typename matrix_t>
827 typedef typename matrix_t::size_type size_type;
828 for(size_type i = 0; i < mOut.num_rows(); ++i)
829 for(size_type j = 0; j < mOut.num_cols(); ++j)
831 mOut(i, j) = m(i,j) /
s;
835 template <
typename matrix_t>
839 typedef typename matrix_t::size_type size_type;
840 for(size_type i = 0; i < mOut.num_rows(); ++i)
841 for(size_type j = 0; j < mOut.num_cols(); ++j)
843 mOut(i, j) = m(i,j) *
s;
847 template <
typename matrix_t>
855 template <
typename matrix_t>
866 mOut(1, 1) = c; mOut(1, 2) = -
s;
867 mOut(2, 1) =
s; mOut(2, 2) = c;
870 template <
typename matrix_t>
881 mOut(0, 0) = c; mOut(0, 2) =
s;
882 mOut(2, 0) = -
s; mOut(2, 2) = c;
885 template <
typename matrix_t>
893 mOut(0, 0) = c; mOut(0, 1) = -
s;
894 mOut(1, 0) =
s; mOut(1, 1) = c;
901 template <
typename matrix_t>
911 matrix_t tMat1, tMat2, tMat3;
924 template <
typename matrix_t,
typename vector_t>
928 assert(vector_t::Size == matrix_t::RowSize);
929 assert(vector_t::Size == matrix_t::ColSize);
933 typedef typename matrix_t::size_type size_type_mat;
934 for(size_type_mat i = 0; i < mOut.num_rows(); ++i)
936 for(size_type_mat j = 0; j < mOut.num_cols(); ++j){
937 mOut(i,j) = - 2.0/scalarProd * orthoVec[i] * orthoVec[j];
948 template <
typename matrix_t>
953 typedef typename matrix_t::size_type size_type;
954 for(size_type i = 0; i < m.num_rows(); ++i)
955 for(size_type j = 0; j < m.num_cols(); ++j)
957 norm += m(i,j)*m(i,j);
963 template <
typename matrix_t>
970 template <
typename matrix_t>
975 typedef typename matrix_t::size_type size_type;
976 for(size_type j = 0; j < m.num_cols(); ++j)
979 for(size_type i = 0; i < m.num_rows(); ++i)
983 max = (sum > max) ? sum : max;
988 template <
typename matrix_t>
993 typedef typename matrix_t::size_type size_type;
994 for(size_type i = 0; i < m.num_rows(); ++i)
997 for(size_type j = 0; j < m.num_cols(); ++j)
1001 max = (sum > max) ? sum : max;
1006 template <
typename matrix_t>
1011 typedef typename matrix_t::size_type size_type;
1012 for(size_type i = 0; i < m.num_rows(); ++i)
1013 for(size_type j = 0; j < m.num_cols(); ++j)
1015 max = (m(i,j) > max) ? m(i,j) : max;
1023 template <
size_t N,
size_t M,
typename T>
1027 UG_THROW(
"MaxAbsEigenvalue for matrix of size "<<N<<
"x"<<M<<
" not implemented.");
1030 template <
typename T>
1038 template <
typename T>
1043 minus_p_half = m(0,0)+m(1,1);
1044 val = minus_p_half*minus_p_half - (m(0,0)*m(1,1) - m(0,1)*m(1,0));
1045 UG_ASSERT(val >= 0.0,
"MaxAbsEigenvalues: Complex Eigenvalues???");
1047 if (minus_p_half >=0.0) {
return (minus_p_half + sqrt(val));}
1048 else {
return fabs(minus_p_half-sqrt(val));}
1052 template <
typename matrix_t>
Definition: math_matrix.h:261
T value_type
Definition: math_matrix.h:263
Definition: math_matrix.h:266
T value_type
Definition: math_matrix.h:268
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
std::size_t size_type
Definition: math_matrix.h:66
T value_type
Definition: math_matrix.h:65
std::size_t num_cols() const
Definition: math_matrix.h:216
std::size_t num_rows() const
Definition: math_matrix.h:215
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:680
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:857
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:753
matrix_t::value_type MatInftyNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:990
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
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:849
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:778
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:790
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:887
matrix_t::value_type MatOneNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:972
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:872
matrix_t::value_type MatFrobeniusNormSq(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:950
matrix_t::value_type MatMaxNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:1008
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:903
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:716
matrix_t::value_type MatFrobeniusNorm(matrix_t &m)
Definition: math_matrix_functions_common_impl.hpp:965
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:623
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:561
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:1025
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:926
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:825
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
vector_t::value_type VecDot(const vector_t &v1, const vector_t &v2)
returns the dot-product of two vector_ts
Definition: math_vector_functions_common_impl.hpp:385
T value_type
Definition: sparsematrix_interface.h:2