<div>Hi,</div><div class="gmail_quote"> </div><div class="gmail_quote">I'm working now migrating the HG version. When finished I will communicate.<br></div><div class="gmail_quote">Guillermo</div><div class="gmail_quote">
</div><div class="gmail_quote"> </div><div class="gmail_quote">2011/3/29 Christian Engwer <span dir="ltr"><<a href="mailto:christi@uni-hd.de">christi@uni-hd.de</a>></span><br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
Hi Martin,<br>
<br>
I don't quite undestand, what happend here. How is the new<br>
construction different from the previous one? Can you enlight me?<br>
<br>
Thanks<br>
Christian<br>
<br>
On Tue, Mar 29, 2011 at 04:06:59PM +0200, <a href="mailto:mnolte@dune-project.org">mnolte@dune-project.org</a> wrote:<br>
> Author: mnolte<br>
> Date: 2011-03-29 16:06:59 +0200 (Tue, 29 Mar 2011)<br>
> New Revision: 7578<br>
><br>
> Modified:<br>
> trunk/dune/grid/genericgeometry/matrixhelper.hh<br>
> Log:<br>
> fix a problem with method overloading<br>
><br>
><br>
> Modified: trunk/dune/grid/genericgeometry/matrixhelper.hh<br>
> ===================================================================<br>
> --- trunk/dune/grid/genericgeometry/matrixhelper.hh 2011-03-21 23:22:41 UTC (rev 7577)<br>
> +++ trunk/dune/grid/genericgeometry/matrixhelper.hh 2011-03-29 14:06:59 UTC (rev 7578)<br>
> @@ -1,6 +1,8 @@<br>
> #ifndef DUNE_GENERICGEOMETRY_MATRIXHELPER_HH<br>
> #define DUNE_GENERICGEOMETRY_MATRIXHELPER_HH<br>
><br>
> +#include <cmath><br>
> +<br>
> #include <dune/common/fvector.hh><br>
> #include <dune/common/fmatrix.hh><br>
> #include <dune/common/static_assert.hh><br>
> @@ -11,11 +13,31 @@<br>
> namespace GenericGeometry<br>
> {<br>
><br>
> + // FieldHelper<br>
> + // -----------<br>
> +<br>
> + template< class Field ><br>
> + struct FieldHelper<br>
> + {<br>
> + static Field abs ( const Field &x ) { return std::abs( x ); }<br>
> + };<br>
> +<br>
> +<br>
> +<br>
> + // MatrixHelper<br>
> + // ------------<br>
> +<br>
> template< class Traits ><br>
> struct MatrixHelper<br>
> {<br>
> - typedef typename Traits :: ctype FieldType;<br>
> + typedef typename Traits::ctype FieldType;<br>
><br>
> + static FieldType abs ( const FieldType &x )<br>
> + {<br>
> + //return std::abs( x );<br>
> + return FieldHelper< FieldType >::abs( x );<br>
> + }<br>
> +<br>
> template< int m, int n ><br>
> static void<br>
> Ax ( const typename Traits :: template Matrix< m, n > :: type &A,<br>
> @@ -373,7 +395,7 @@<br>
> if( (n == 2) && (m == 2) )<br>
> {<br>
> // Special implementation for 2x2 matrices: faster and more stable<br>
> - return std::abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] );<br>
> + return abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] );<br>
> }<br>
> else if( (n == 3) && (m == 3) )<br>
> {<br>
> @@ -381,7 +403,7 @@<br>
> const FieldType v0 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 1 ][ 1 ] * A[ 0 ][ 2 ];<br>
> const FieldType v1 = A[ 0 ][ 2 ] * A[ 1 ][ 0 ] - A[ 1 ][ 2 ] * A[ 0 ][ 0 ];<br>
> const FieldType v2 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 1 ][ 0 ] * A[ 0 ][ 1 ];<br>
> - return std::abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] );<br>
> + return abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] );<br>
> }<br>
> else if( n >= m )<br>
> {<br>
> @@ -438,7 +460,7 @@<br>
> ret[ 1 ][ 1 ] = A[ 0 ][ 0 ] * detInv;<br>
> ret[ 1 ][ 0 ] = -A[ 1 ][ 0 ] * detInv;<br>
> ret[ 0 ][ 1 ] = -A[ 0 ][ 1 ] * detInv;<br>
> - return std::abs( det );<br>
> + return abs( det );<br>
> }<br>
> else<br>
> {<br>
> @@ -464,8 +486,8 @@<br>
> }<br>
> };<br>
><br>
> - }<br>
> + } // namespace GenericGeometry<br>
><br>
> -}<br>
> +} // namespace Dune<br>
><br>
> #endif // #ifndef DUNE_GENERICGEOMETRY_MATRIXHELPER_HH<br>
><br>
><br>
> _______________________________________________<br>
> Dune-Commit mailing list<br>
> <a href="mailto:Dune-Commit@dune-project.org">Dune-Commit@dune-project.org</a><br>
> <a href="http://lists.dune-project.org/mailman/listinfo/dune-commit" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune-commit</a><br>
><br>
<br>
_______________________________________________<br>
Dune mailing list<br>
<a href="mailto:Dune@dune-project.org">Dune@dune-project.org</a><br>
<a href="http://lists.dune-project.org/mailman/listinfo/dune" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a><br>
</blockquote></div><br>