82 #include "type_parite.h" 132 return (c2 +
double(1)) ;
135 return (c1 +
double(1)) ;
144 cout <<
"Operation Scalar + Scalar: dzpuis conflict in the external " << endl;
145 cout <<
" compactified domain ! " << endl ;
169 cerr <<
"Undifined state in Scalar + Mtbl !" << endl ;
188 resu = double(1) + mi ;
191 assert(resu.get_etat() == ETATQCQ) ;
192 resu.va = resu.va + mi ;
213 assert(t1.
get_etat() != ETATNONDEF) ;
216 if (x ==
double(0)) {
229 resu = double(1) + x ;
232 assert(resu.get_etat() == ETATQCQ) ;
233 resu.va = resu.va + x ;
253 return t1 + double(m) ;
260 return t1 + double(m) ;
290 return -(c2 - double(1)) ;
293 return (c1 -
double(1)) ;
301 cout <<
"Operation Scalar - Scalar : dzpuis conflict in the external " << endl;
302 cout <<
" compactified domain ! " << endl ;
326 assert(t1.
get_etat() != ETATNONDEF) ;
342 resu = double(1) - mi ;
345 assert(resu.get_etat() == ETATQCQ) ;
346 resu.va = resu.va - mi ;
366 assert(t1.
get_etat() != ETATNONDEF) ;
369 if (x ==
double(0)) {
382 resu = double(1) - x ;
385 assert(resu.get_etat() == ETATQCQ) ;
386 resu.va = resu.va - x ;
405 return t1 - double(m) ;
412 return double(m) - t1 ;
484 r.va = c1.
va % c2.
va ;
518 r.va = c1.
va | c2.
va ;
592 if ( a ==
double(0) ) {
617 return t1 * double(m) ;
624 return double(m) * t1 ;
643 assert(c1.
get_etat() != ETATNONDEF) ;
644 assert(c2.
get_etat() != ETATNONDEF) ;
649 cout <<
"Division by 0 in Scalar / Scalar !" << endl ;
656 return double(1)/c2 ;
668 r.va = c1.
va / c2.
va ;
680 if (c1.
get_etat() == ETATNONDEF)
return c1 ;
684 cout <<
"Division by 0 in Scalar / Mtbl !" << endl ;
716 cout <<
"Division by 0 in Mtbl / Scalar !" << endl ;
750 if ( x ==
double(0) ) {
751 cout <<
"Division by 0 in Scalar / double !" << endl ;
784 cout <<
"Division by 0 in double / Scalar !" << endl ;
797 if ( x ==
double(0) ) {
815 return c1 / double(m) ;
824 return double(m) / c2 ;
840 if (
etat == ETATNONDEF)
858 cout <<
"Operation += Scalar : dzpuis conflict in the external " << endl;
859 cout <<
" compactified domain ! " << endl ;
864 if (
etat == ETATZERO) {
869 if (
etat == ETATUN) {
873 assert(
etat == ETATQCQ) ;
893 if (
etat == ETATNONDEF)
909 cout <<
"Operation -= Scalar : dzpuis conflict in the external " << endl;
910 cout <<
" compactified domain ! " << endl ;
916 if (
etat == ETATZERO) {
922 if (
etat == ETATUN) {
926 assert(
etat == ETATQCQ) ;
944 if (
etat == ETATNONDEF)
953 if (
etat == ETATZERO) {
961 if (
etat == ETATUN) {
973 assert(
etat == ETATQCQ) ;
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Tensor field of valence 0 (or component of a tensorial field).
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
void operator-=(const Scalar &)
-= Scalar
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
int dzpuis
Power of r by which the quantity represented by this must be divided in the compactified external do...
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
void operator*=(const Scalar &)
*= Scalar
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
void operator+=(const Scalar &)
+= Scalar
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
void set_dzpuis(int)
Modifies the dzpuis flag.
int get_etat() const
Gives the logical state.
virtual void del_deriv() const
Logical destructor of the derivatives.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void operator=(const Scalar &a)
Assignment to another Scalar defined on the same mapping.
Cmp operator+(const Cmp &)
int get_dzpuis() const
Returns dzpuis.
Valeur va
The numerical value of the Scalar.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_spectral_base(const Base_val &)
Sets the spectral bases of the Valeur va
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary)...
Cmp operator-(const Cmp &)
- Cmp
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...
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
const Map & get_mp() const
Returns the mapping.
const Valeur & get_spectral_va() const
Returns va (read only version)
const Base_val & get_base() const
Return the bases for spectral expansions (member base )