29 char scalar_arithm_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_arithm.C,v 1.10 2014/10/13 08:53:46 j_novak Exp $" ;
79 #include "type_parite.h"
129 return (c2 +
double(1)) ;
132 return (c1 +
double(1)) ;
141 cout <<
"Operation Scalar + Scalar: dzpuis conflict in the external " << endl;
142 cout <<
" compactified domain ! " << endl ;
166 cerr <<
"Undifined state in Scalar + Mtbl !" << endl ;
185 resu = double(1) + mi ;
188 assert(resu.
get_etat() == ETATQCQ) ;
189 resu.
va = resu.
va + mi ;
210 assert(t1.
get_etat() != ETATNONDEF) ;
213 if (x ==
double(0)) {
226 resu = double(1) + x ;
229 assert(resu.
get_etat() == ETATQCQ) ;
230 resu.
va = resu.
va + x ;
250 return t1 + double(m) ;
257 return t1 + double(m) ;
287 return -(c2 - double(1)) ;
290 return (c1 -
double(1)) ;
298 cout <<
"Operation Scalar - Scalar : dzpuis conflict in the external " << endl;
299 cout <<
" compactified domain ! " << endl ;
323 assert(t1.
get_etat() != ETATNONDEF) ;
339 resu = double(1) - mi ;
342 assert(resu.
get_etat() == ETATQCQ) ;
343 resu.
va = resu.
va - mi ;
363 assert(t1.
get_etat() != ETATNONDEF) ;
366 if (x ==
double(0)) {
379 resu = double(1) - x ;
382 assert(resu.
get_etat() == ETATQCQ) ;
383 resu.
va = resu.
va - x ;
402 return t1 - double(m) ;
409 return double(m) - t1 ;
589 if ( a ==
double(0) ) {
614 return t1 * double(m) ;
621 return double(m) * t1 ;
640 assert(c1.
get_etat() != ETATNONDEF) ;
641 assert(c2.
get_etat() != ETATNONDEF) ;
646 cout <<
"Division by 0 in Scalar / Scalar !" << endl ;
653 return double(1)/c2 ;
677 if (c1.
get_etat() == ETATNONDEF)
return c1 ;
681 cout <<
"Division by 0 in Scalar / Mtbl !" << endl ;
713 cout <<
"Division by 0 in Mtbl / Scalar !" << endl ;
747 if ( x ==
double(0) ) {
748 cout <<
"Division by 0 in Scalar / double !" << endl ;
781 cout <<
"Division by 0 in double / Scalar !" << endl ;
794 if ( x ==
double(0) ) {
812 return c1 / double(m) ;
821 return double(m) / c2 ;
837 if (
etat == ETATNONDEF)
855 cout <<
"Operation += Scalar : dzpuis conflict in the external " << endl;
856 cout <<
" compactified domain ! " << endl ;
861 if (
etat == ETATZERO) {
866 if (
etat == ETATUN) {
870 assert(
etat == ETATQCQ) ;
890 if (
etat == ETATNONDEF)
906 cout <<
"Operation -= Scalar : dzpuis conflict in the external " << endl;
907 cout <<
" compactified domain ! " << endl ;
913 if (
etat == ETATZERO) {
919 if (
etat == ETATUN) {
923 assert(
etat == ETATQCQ) ;
941 if (
etat == ETATNONDEF)
950 if (
etat == ETATZERO) {
958 if (
etat == ETATUN) {
970 assert(
etat == ETATQCQ) ;
int get_etat() const
Gives the logical state.
Tensor field of valence 0 (or component of a tensorial field).
virtual void del_deriv() const
Logical destructor of the derivatives.
int get_dzpuis() const
Returns dzpuis.
void operator=(const Scalar &a)
Assignment to another Scalar defined on the same mapping.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
void operator-=(const Scalar &)
-= Scalar
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
void operator+=(const Scalar &)
+= Scalar
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary).
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
void set_dzpuis(int)
Modifies the dzpuis flag.
const Valeur & get_spectral_va() const
Returns va (read only version)
void operator*=(const Scalar &)
*= Scalar
Valeur va
The numerical value of the Scalar
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
int dzpuis
Power of r by which the quantity represented by this must be divided in the compactified external d...
const Base_val & get_base() const
Return the bases for spectral expansions (member base )
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Cmp operator-(const Cmp &)
- Cmp
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Cmp operator+(const Cmp &)
Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
const Map & get_mp() const
Returns the mapping.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.