[LORENE] Arithmetics of Scalar, Mtbl and Coord

Eric Gourgoulhon eric.gourgoulhon at obspm.fr
Sun Nov 20 17:54:19 CET 2005


Dear all,

The arithmetical operations between Scalar and Mtbl have
been implemented in Lorene. Thanks to the implicit conversion
of Coord to Mtbl (realised by the constructor
Mtbl::Mtbl(const Coord &) ), this arithmetics also holds for
operations between Scalar and Coord.

For example (map being a mapping (class Map)):

Scalar a(map) ;
const Coord& x = map.x ;

a = 2 * x ;    // this was possible in previous versions
                   // because the function
                   // Scalar::operator=(const Mtbl& )
                   // was implemented

Scalar b = a + x ;  // this was not possible,
                             // because the operation Scalar + Coord
                             // did not exist; it is now implemented

Bon code !

Eric.

-- 
Eric Gourgoulhon
Laboratoire de l'Univers et de ses THeories (LUTH)
UMR 8102 du CNRS / Observatoire de Paris, F-92195 Meudon Cedex, France
tel: +33 1 45 07 74 33 (secretariat : +33 1 45 07 75 10)
e-mail: eric.gourgoulhon/at/obspm.fr   
http://www.luth.obspm.fr/~luthier/gourgoulhon/




More information about the Lorene.list mailing list