Skip to content
Snippets Groups Projects
Commit ac1d74bb authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

Introduce a global operator* for matrix-matrix multiplications and use it.

That makes the code more readable, which is more important to me than
speed.  The stuff is difficult enough as it is.

[[Imported from SVN: r6214]]
parent dfb7df42
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,24 @@
#include <dune/gfe/svd.hh>
//! calculates ret = A * B
template< class K, int m, int n, int p >
Dune::FieldMatrix< K, m, p > operator* ( const Dune::FieldMatrix< K, m, n > &A, const Dune::FieldMatrix< K, n, p > &B)
{
typedef typename Dune::FieldMatrix< K, m, p > :: size_type size_type;
Dune::FieldMatrix< K, m, p > ret;
for( size_type i = 0; i < m; ++i ) {
for( size_type j = 0; j < p; ++j ) {
ret[ i ][ j ] = K( 0 );
for( size_type k = 0; k < n; ++k )
ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ];
}
}
return ret;
}
/** \brief A function defined by simplicial geodesic interpolation
from the reference element to a Riemannian manifold.
......@@ -87,12 +105,9 @@ private:
UT[i] = 0;
}
Dune::FieldMatrix<double,targetDim,targetDim> pseudoInv;
Dune::FMatrixHelp::multMatrix(V,UT,pseudoInv);
return pseudoInv;
return V*UT;
}
/** \brief The coefficient vector */
std::vector<TargetSpace> coefficients_;
......@@ -164,8 +179,7 @@ evaluateDerivative(const Dune::FieldVector<ctype, dim>& local)
dFdw *= -1;
// multiply the two previous matrices: the result is the right hand side
Dune::FieldMatrix<ctype,targetDim,dim> RHS;
Dune::FMatrixHelp::multMatrix(dFdw,B, RHS);
Dune::FieldMatrix<ctype,targetDim,dim> RHS = dFdw * B;
// the actual system matrix
std::vector<ctype> w = barycentricCoordinates(local);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment