29char 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"
93 if ((
ci.get_etat() == ETATZERO) || (
ci.get_etat() == ETATNONDEF)) {
98 assert( (
ci.get_etat() == ETATQCQ) || (
ci.get_etat() == ETATUN)) ;
115 if (
c1.get_etat() == ETATNONDEF)
117 if (
c2.get_etat() == ETATNONDEF)
122 if (
c1.get_etat() == ETATZERO) {
125 if (
c2.get_etat() == ETATZERO) {
128 if (
c1.get_etat() == ETATUN) {
129 return (
c2 +
double(1)) ;
131 if (
c2.get_etat() == ETATUN) {
132 return (
c1 +
double(1)) ;
139 if (
c1.dz_nonzero() &&
c2.dz_nonzero() ) {
140 if (
c1.get_dzpuis() !=
c2.get_dzpuis() ) {
141 cout <<
"Operation Scalar + Scalar: dzpuis conflict in the external " <<
endl;
142 cout <<
" compactified domain ! " <<
endl ;
150 if (
c1.dz_nonzero()) {
165 if ((
c1.get_etat() == ETATNONDEF) || (
mi.get_etat() == ETATNONDEF)) {
166 cerr <<
"Undifined state in Scalar + Mtbl !" <<
endl ;
172 if (
mi.get_etat() == ETATZERO) {
180 if (
c1.get_etat() == ETATZERO) {
184 if (
c1.get_etat() == ETATUN) {
210 assert(
t1.get_etat() != ETATNONDEF) ;
213 if (x ==
double(0)) {
221 if (
t1.get_etat() == ETATZERO) {
225 if (
t1.get_etat() == ETATUN) {
272 if (
c1.get_etat() == ETATNONDEF)
274 if (
c2.get_etat() == ETATNONDEF)
280 if (
c1.get_etat() == ETATZERO) {
283 if (
c2.get_etat() == ETATZERO) {
286 if (
c1.get_etat() == ETATUN) {
289 if (
c2.get_etat() == ETATUN) {
290 return (
c1 -
double(1)) ;
296 if (
c1.dz_nonzero() &&
c2.dz_nonzero() ) {
297 if (
c1.get_dzpuis() !=
c2.get_dzpuis() ) {
298 cout <<
"Operation Scalar - Scalar : dzpuis conflict in the external " <<
endl;
299 cout <<
" compactified domain ! " <<
endl ;
307 if (
c1.dz_nonzero()) {
323 assert(
t1.get_etat() != ETATNONDEF) ;
326 if (
mi.get_etat() == ETATZERO) {
334 if (
t1.get_etat() == ETATZERO) {
338 if (
t1.get_etat() == ETATUN) {
363 assert(
t1.get_etat() != ETATNONDEF) ;
366 if (x ==
double(0)) {
374 if (
t1.get_etat() == ETATZERO) {
378 if (
t1.get_etat() == ETATUN) {
427 if ((
c1.get_etat() == ETATZERO) || (
c1.get_etat() == ETATNONDEF)){
430 if ((
c2.get_etat() == ETATZERO)|| (
c2.get_etat() == ETATNONDEF)) {
433 if (
c1.get_etat() == ETATUN)
436 if (
c2.get_etat() == ETATUN)
461 if ((
c1.get_etat() == ETATZERO) || (
c1.get_etat() == ETATNONDEF)){
464 if ((
c2.get_etat() == ETATZERO)|| (
c2.get_etat() == ETATNONDEF)) {
467 if (
c1.get_etat() == ETATUN)
469 if (
c2.get_etat() == ETATUN)
495 if ((
c1.get_etat() == ETATZERO) || (
c1.get_etat() == ETATNONDEF)){
498 if ((
c2.get_etat() == ETATZERO)|| (
c2.get_etat() == ETATNONDEF)) {
501 if (
c1.get_etat() == ETATUN)
503 if (
c2.get_etat() == ETATUN)
530 if ((
c1.get_etat() == ETATZERO) || (
c1.get_etat() == ETATNONDEF)) {
535 if (
c1.get_etat() == ETATUN) {
544 if (
mi.get_etat() == ETATZERO) {
571 if ((
c1.get_etat() == ETATZERO) || (
c1.get_etat() == ETATNONDEF)) {
579 if (
c1.get_etat() == ETATUN) {
589 if (
a ==
double(0) ) {
640 assert(
c1.get_etat() != ETATNONDEF) ;
641 assert(
c2.get_etat() != ETATNONDEF) ;
645 if (
c2.get_etat() == ETATZERO) {
646 cout <<
"Division by 0 in Scalar / Scalar !" <<
endl ;
649 if (
c1.get_etat() == ETATZERO) {
652 if (
c1.get_etat() == ETATUN)
654 if (
c2.get_etat() == ETATUN)
677 if (
c1.get_etat() == ETATNONDEF)
return c1 ;
680 if (
mi.get_etat() == ETATZERO ) {
681 cout <<
"Division by 0 in Scalar / Mtbl !" <<
endl ;
684 if (
c1.get_etat() == ETATZERO) {
689 if (
c1.get_etat() == ETATUN) {
709 if (
c2.get_etat() == ETATNONDEF)
712 if (
c2.get_etat() == ETATZERO) {
713 cout <<
"Division by 0 in Mtbl / Scalar !" <<
endl ;
717 if (
c2.get_etat() == ETATUN) {
725 if (
mi.get_etat() == ETATZERO ) {
743 if (
c1.get_etat() == ETATNONDEF)
747 if ( x ==
double(0) ) {
748 cout <<
"Division by 0 in Scalar / double !" <<
endl ;
751 if (
c1.get_etat() == ETATZERO) {
756 if (
c1.get_etat() == ETATUN) {
777 if (
c2.get_etat() == ETATNONDEF)
780 if (
c2.get_etat() == ETATZERO) {
781 cout <<
"Division by 0 in double / Scalar !" <<
endl ;
785 if (
c2.get_etat() == ETATUN) {
794 if ( x ==
double(0) ) {
837 if (
etat == ETATNONDEF)
841 if (
ci.get_etat() == ETATZERO) {
845 if (
ci.get_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) {
872 if(
ci.dz_nonzero() ) {
890 if (
etat == ETATNONDEF)
894 if (
ci.get_etat() == ETATZERO) {
898 if (
ci.get_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) {
925 if(
ci.dz_nonzero() ) {
941 if (
etat == ETATNONDEF)
945 if (
ci.get_etat() == ETATZERO) {
950 if (
etat == ETATZERO) {
954 if (
ci.get_etat() == ETATUN) {
958 if (
etat == ETATUN) {
963 if (
ci.get_etat() == ETATNONDEF) {
Time evolution with partial storage (*** under development ***).
Tensor field of valence 0 (or component of a tensorial field).
virtual void del_deriv() const
Logical destructor of the derivatives.
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
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).
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
void set_dzpuis(int)
Modifies the dzpuis flag.
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...
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 *const mp
Mapping on which the numerical values at the grid points are defined.