Commit f6ba2968 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[math][multiplymatrices] use correct size_type

parent 16cd926b
......@@ -583,15 +583,16 @@ template <class Scalar>
Dune::DynamicMatrix<Scalar> multiplyMatrices(const Dune::DynamicMatrix<Scalar> &M1,
const Dune::DynamicMatrix<Scalar> &M2)
{
DUNE_ASSERT_BOUNDS(M1.M() == M2.N());
using size_type = typename Dune::DynamicMatrix<Scalar>::size_type;
const size_type rows = M1.N();
const size_type cols = M2.M();
std::size_t rows = M1.N();
std::size_t cols = M2.M();
DUNE_ASSERT_BOUNDS(M1.M() == M2.N());
Dune::DynamicMatrix<Scalar> result(rows, cols, 0.0);
for (std::size_t i = 0; i < rows; i++)
for (std::size_t j = 0; j < cols; j++)
for (std::size_t k = 0; k < M1.M(); k++)
for (size_type i = 0; i < rows; i++)
for (size_type j = 0; j < cols; j++)
for (size_type k = 0; k < M1.M(); k++)
result[i][j] += M1[i][k]*M2[k][j];
return result;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment