Go to the documentation of this file.
36#ifndef OPENRS_MATRIXINVERSE_HEADER
37#define OPENRS_MATRIXINVERSE_HEADER
54 typedef typename M::value_type T;
55 static_assert(!std::is_integral<T>::value, "");
56 assert(m.numRows() == 2 && m.numCols() == 2);
58 T det = m(0,0)*m(1,1) - m(0,1)*m(1,0);
59 M mi(2, 2, ( double*)0);
71 assert(m1.numCols() == m2.numRows());
72 int num_contracting = m1.numCols();
73 M m(m1.numRows(), m2.numCols(), ( double*)0);
74 for ( int r = 0; r < m1.numRows(); ++r) {
75 for ( int c = 0; c < m2.numCols(); ++c) {
77 for ( int kk = 0; kk < num_contracting; ++kk) {
78 m(r, c) += m1(r, kk)*m2(kk, c);
90 typedef typename M::value_type T;
91 static_assert(!std::is_integral<T>::value, "");
92 assert(m.numRows() == 3 && m.numCols() == 3);
112 M mi(3, 3, ( double*)0);
115 mi(0,2) = -(c*t1+f*t2)/(i*x);
118 mi(1,2) = -(c*t3+f*t4)/(i*x);
119 mi(2,0) = -(g*t1+h*t3)/(i*x);
120 mi(2,1) = -(g*t2+h*t4)/(i*x);
121 mi(2,2) = 1/i+1/(i*i*x)*(c*(g*t1+h*t3)+f*(g*t2+h*t4));
Definition: BlackoilFluid.hpp:32
M matprod(const M &m1, const M &m2) Definition: MatrixInverse.hpp:69
M inverse3x3(const M &m) Definition: MatrixInverse.hpp:86
M inverse2x2(const M &m) Definition: MatrixInverse.hpp:50
|