Commit 2a51936c authored by Christian Engwer's avatar Christian Engwer Committed by Steffen Müthing

[densematrix] reenable and fix broken check, to avoid aliasing in mv and mtv

(cherry picked from commit 2abb3bd4)
Signed-off-by: Steffen Müthing's avatarSteffen Müthing <>
parent da48c095
......@@ -390,6 +390,7 @@ namespace Dune
void mv (const X& x, Y& y) const
assert( (void*)(&x) != (void*)(&y) );
if (x.N()!=M()) DUNE_THROW(FMatrixError,"Index out of range");
if (y.N()!=N()) DUNE_THROW(FMatrixError,"Index out of range");
......@@ -406,10 +407,7 @@ namespace Dune
void mtv ( const X &x, Y &y ) const
//assert( &x != &y );
//This assert did not work for me. Compile error:
// comparison between distinct pointer types ‘const
// Dune::FieldVector<double, 3>*’ and ‘Dune::FieldVector<double, 2>*’ lacks a cast
assert( (void*)(&x) != (void*)(&y) );
if( x.N() != N() )
DUNE_THROW( FMatrixError, "Index out of range." );
if( y.N() != M() )
Markdown is supported
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