[Dune] Dune on Windows MinGW

Jö Fahlke jorrit at jorrit.de
Wed May 4 13:31:18 CEST 2011


Am Wed,  4. May 2011, 12:46:38 +0200 schrieb Martin Nolte:
> Ok, I just added a first implementation of such a class to dune-common.
> Improvements are, of course, welcome. I also think that naming can still be
> discussed.
> 
> The idea of the file math.hh is to have a "replacement" for the include of
> <cmath>, which is included by math.hh. Any objections, suggestions, etc.?

Yes.  Instead of

  static double e () { return std::exp( 1.0 ); }

use

  static const double &e () {
    static const double val = std::exp( 1.0 );
    return val;
  }

This should should also avoid recomputation of the value on every call.

Also, I don't see why this has to be specialized for every data type.  One
templated class should be good for most if not all relevant types.  Or are
there no overloads of std::exp() and std::acos() for GMPField?  Even so, at
least long double would benefit from a general template, and it would make
maintanance easier.

Thanks,
Jö.

-- 
Cernlib: turns your plain old PC into a quantum computer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110504/c4897f94/attachment.sig>


More information about the Dune mailing list