Skip to content
Snippets Groups Projects
Commit 2abb3bd4 authored by Christian Engwer's avatar Christian Engwer
Browse files

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

parent 522bc0e2
No related branches found
No related tags found
No related merge requests found
......@@ -390,6 +390,7 @@ namespace Dune
void mv (const X& x, Y& y) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
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");
#endif
......@@ -406,10 +407,7 @@ namespace Dune
void mtv ( const X &x, Y &y ) const
{
#ifdef DUNE_FMatrix_WITH_CHECKING
//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() )
......
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