#346 FieldMatrix :: mv seems to be implemented wrong.
Metadata
Property | Value |
---|---|
Reported by | Robert K (robertk@posteo.org) |
Reported at | Feb 5, 2008 16:40 |
Type | Bug Report |
Version | Git (pre2.4) [autotools] |
Operating System | Unspecified / All |
Last edited by | Markus Blatt (markus@dr-blatt.de) |
Last edited at | Feb 7, 2008 12:05 |
Closed by | Markus Blatt (markus@dr-blatt.de) |
Closed at | Feb 7, 2008 12:05 |
Closed in version | Unknown |
Resolution | Fixed |
Comment |
Description
This is the current code:
//! y = A x template<class X, class Y> void mv (const X& x, Y& y) const { #ifdef DUNE_FMatrix_WITH_CHECKING if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range"); if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range"); #endif for (size_type i=0; i<n; i++) for (size_type j=0; j<m; j++) y[i] = (*this)[i][j] * x[j]; }
I suggest it to change to:
//! y = A x template<class X, class Y> void mv (const X& x, Y& y) const { #ifdef DUNE_FMatrix_WITH_CHECKING if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range"); if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range"); #endif for (size_type i=0; i<n; i++) y[i] = (*this)[i] * x; }