[LORENE] New class Scalar

Eric Gourgoulhon Eric.Gourgoulhon at obspm.fr
Fri Oct 24 23:31:13 CEST 2003

Dear All, 

The new class Scalar has been introduced in Lorene in order
to replace the "old" class Cmp. 
The motivation for this replacement is mainly to reduce
the complexity of Lorene by getting rid of the redundancy 
between the Cmp's and the Tenseur's of valence 0. 
Indeed the new class Scalar is a derived class from the
new class Tensor. Consequently the hierarchy of Lorene's
objects is:

   New hierarchy:        Previous hierarchy:

   Scalar or Tensor            Cmp		
        |                       |	
      Valeur                  Valeur
        |                       |
  Mtbl and Mtbl_cf         Mtbl and Mtbl_cf
        |                       |
       Tbl                     Tbl

Apart from this, some differences between Scalar and Cmp

-- the data member Valeur va is now protected in Scalar 
   (it was public in Cmp); the access to it is performed
   by means of the methods get_spectral_va() and 
-- the Scalar methods which are specific to spectral methods
   are clearly identified by the keyword "spectral" in their
   name (e.g. set_spectral_base or display_spectral). 

-- Cmp::operator()(int ) and Cmp::set(int ) are replaced by 
   Scalar::domain(int ) and Scalar::set_domain(int ). 
-- Scalar class has methods dsdt() and stdsdp() to compute
   respectively d/dtheta and 1/sin(theta) d/dphi (these methods
   did not exist in class Cmp: only 1/r d/dtheta and
   1/(r sin(theta)) d/dphi was possible).
-- The Scalar class has the state ETATUN (for globally one), 
   in addition to the states ETATZERO, ETATQCQ and ETATNONDEF. 
-- Being a derived class of Tensor, any Scalar object can be
   used as the argument of a function with asks for a Tensor.
Any new project should employ the class Scalar instead of Cmp. 
To make the transition smooth a constructor of Scalar from
Cmp and a constructor of Cmp from Scalar have been introduced. 

Best wishes,


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 (secretariat : +33
e-mail: Eric.Gourgoulhon at obspm.fr    WWW: http://www.luth.obspm.fr/

More information about the Lorene.list mailing list