scalar_arithm.C
/*
* Arithmetical operations for class Scalar
*
*/
/*
* Copyright (c) 2003-2005 Eric Gourgoulhon & Jerome Novak
* Copyright (c) 1999-2001 Philippe Grandclement
*
* This file is part of LORENE.
*
* LORENE is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* LORENE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LORENE; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
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 $" ;
/*
* $Id: scalar_arithm.C,v 1.10 2014/10/13 08:53:46 j_novak Exp $
* $Log: scalar_arithm.C,v $
* Revision 1.10 2014/10/13 08:53:46 j_novak
* Lorene classes and functions now belong to the namespace Lorene.
*
* Revision 1.9 2014/10/06 15:16:15 j_novak
* Modified #include directives to use c++ syntax.
*
* Revision 1.8 2005/11/17 15:30:11 e_gourgoulhon
* Added arithmetics with Mtbl.
*
* Revision 1.7 2004/07/06 13:36:29 j_novak
* Added methods for desaliased product (operator |) only in r direction.
*
* Revision 1.6 2004/02/19 10:55:11 e_gourgoulhon
* Treatment of case ETATUN in double*Scalar, double/Scalar and
* Scalar/double: added the copy of the spectral bases from the
* input to the result.
*
* Revision 1.5 2003/11/03 22:35:45 e_gourgoulhon
* Changed output comment when dzpuis conflict.
*
* Revision 1.4 2003/10/28 21:34:47 e_gourgoulhon
* Corrected treatment of the case ETATUN in operator+=, operator-= and
* operator*=.
*
* Revision 1.3 2003/10/10 15:57:29 j_novak
* Added the state one (ETATUN) to the class Scalar
*
* Revision 1.2 2003/10/01 13:04:44 e_gourgoulhon
* The method Tensor::get_mp() returns now a reference (and not
* a pointer) onto a mapping.
*
* Revision 1.1 2003/09/24 15:21:45 j_novak
* New version
*
*
* $Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_arithm.C,v 1.10 2014/10/13 08:53:46 j_novak Exp $
*
*/
// headers C
#include <cassert>
#include <cstdlib>
// headers Lorene
#include "tensor.h"
#include "type_parite.h"
//********************//
// OPERATEURS UNAIRES //
//********************//
namespace Lorene {
Scalar operator+(const Scalar & ci) {
return ci ;
}
Scalar operator-(const Scalar & ci) {
// Cas particulier
if ((ci.get_etat() == ETATZERO) || (ci.get_etat() == ETATNONDEF)) {
return ci ;
}
// Cas general
assert( (ci.get_etat() == ETATQCQ) || (ci.get_etat() == ETATUN)) ;
Scalar r(ci.get_mp()) ; // Scalar resultat
r.set_etat_qcq() ;
r.va = - ci.va ;
r.set_dzpuis( ci.get_dzpuis() ) ;
// Termine
return r ;
}
//**********//
// ADDITION //
//**********//
// Scalar + Scalar
// ---------
Scalar operator+(const Scalar & c1, const Scalar & c2) {
if (c1.get_etat() == ETATNONDEF)
return c1 ;
if (c2.get_etat() == ETATNONDEF)
return c2 ;
assert(c1.get_mp() == c2.get_mp()) ;
// Cas particuliers
if (c1.get_etat() == ETATZERO) {
return c2 ;
}
if (c2.get_etat() == ETATZERO) {
return c1 ;
}
if (c1.get_etat() == ETATUN) {
return (c2 + double(1)) ;
}
if (c2.get_etat() == ETATUN) {
return (c1 + double(1)) ;
}
assert(c1.get_etat() == ETATQCQ) ;
assert(c2.get_etat() == ETATQCQ) ;
// Cas general
if ( c1.dz_nonzero() && c2.dz_nonzero() ) {
if ( c1.get_dzpuis() != c2.get_dzpuis() ) {
cout << "Operation Scalar + Scalar: dzpuis conflict in the external " << endl;
cout << " compactified domain ! " << endl ;
abort() ;
}
}
Scalar r(c1) ; // Le resultat
r.va += c2.va ;
if (c1.dz_nonzero()) {
r.set_dzpuis( c1.get_dzpuis() ) ;
}
else{
r.set_dzpuis( c2.get_dzpuis() ) ;
}
// Termine
return r ;
}
// Scalar + Mtbl
// -------------
Scalar operator+(const Scalar& c1, const Mtbl& mi) {
if ((c1.get_etat() == ETATNONDEF) || (mi.get_etat() == ETATNONDEF)) {
cerr << "Undifined state in Scalar + Mtbl !" << endl ;
abort() ;
}
// Cas particuliers
if (mi.get_etat() == ETATZERO) {
return c1 ;
}
assert( c1.check_dzpuis(0) ) ;
Scalar resu(c1) ;
if (c1.get_etat() == ETATZERO) {
resu = mi ;
}
else {
if (c1.get_etat() == ETATUN) {
resu = double(1) + mi ;
}
else{
assert(resu.get_etat() == ETATQCQ) ; // sinon ...
resu.va = resu.va + mi ;
}
}
resu.set_dzpuis(0) ;
return resu ;
}
// Mtbl + Scalar
// -------------
Scalar operator+(const Mtbl& mi, const Scalar& c1) {
return c1 + mi ;
}
// Scalar + double
// ------------
Scalar operator+(const Scalar& t1, double x)
{
// Protections
assert(t1.get_etat() != ETATNONDEF) ;
// Cas particuliers
if (x == double(0)) {
return t1 ;
}
assert( t1.check_dzpuis(0) ) ;
Scalar resu(t1) ;
if (t1.get_etat() == ETATZERO) {
resu = x ;
}
else {
if (t1.get_etat() == ETATUN) {
resu = double(1) + x ;
}
else{
assert(resu.get_etat() == ETATQCQ) ; // sinon ...
resu.va = resu.va + x ;
}
}
resu.set_dzpuis(0) ;
return resu ;
}
// double + Scalar
// ------------
Scalar operator+(double x, const Scalar& t1)
{
return t1 + x ;
}
// Scalar + int
// ---------
Scalar operator+(const Scalar& t1, int m)
{
return t1 + double(m) ;
}
// int + Scalar
// ---------
Scalar operator+(int m, const Scalar& t1)
{
return t1 + double(m) ;
}
//**************//
// SOUSTRACTION //
//**************//
// Scalar - Scalar
// ---------
Scalar operator-(const Scalar & c1, const Scalar & c2) {
if (c1.get_etat() == ETATNONDEF)
return c1 ;
if (c2.get_etat() == ETATNONDEF)
return c2 ;
assert(c1.get_mp() == c2.get_mp()) ;
// Cas particuliers
if (c1.get_etat() == ETATZERO) {
return -c2 ;
}
if (c2.get_etat() == ETATZERO) {
return c1 ;
}
if (c1.get_etat() == ETATUN) {
return -(c2 - double(1)) ;
}
if (c2.get_etat() == ETATUN) {
return (c1 - double(1)) ;
}
assert(c1.get_etat() == ETATQCQ) ; // sinon...
assert(c2.get_etat() == ETATQCQ) ; // sinon...
// Cas general
if ( c1.dz_nonzero() && c2.dz_nonzero() ) {
if ( c1.get_dzpuis() != c2.get_dzpuis() ) {
cout << "Operation Scalar - Scalar : dzpuis conflict in the external " << endl;
cout << " compactified domain ! " << endl ;
abort() ;
}
}
Scalar r(c1) ; // Le resultat
r.va -= c2.va ;
if (c1.dz_nonzero()) {
r.set_dzpuis( c1.get_dzpuis() ) ;
}
else{
r.set_dzpuis( c2.get_dzpuis() ) ;
}
// Termine
return r ;
}
// Scalar - Mtbl
// -------------
Scalar operator-(const Scalar& t1, const Mtbl& mi) {
// Protections
assert(t1.get_etat() != ETATNONDEF) ;
// Cas particuliers
if (mi.get_etat() == ETATZERO) {
return t1 ;
}
assert( t1.check_dzpuis(0) ) ;
Scalar resu(t1) ;
if (t1.get_etat() == ETATZERO) {
resu = - mi ;
}
else{
if (t1.get_etat() == ETATUN) {
resu = double(1) - mi ;
}
else{
assert(resu.get_etat() == ETATQCQ) ; // sinon ...
resu.va = resu.va - mi ;
}
}
resu.set_dzpuis(0) ;
return resu ;
}
// Mtbl - Scalar
// -------------
Scalar operator-(const Mtbl& mi, const Scalar& t1) {
return - (t1 - mi) ;
}
// Scalar - double
// ------------
Scalar operator-(const Scalar& t1, double x)
{
// Protections
assert(t1.get_etat() != ETATNONDEF) ;
// Cas particuliers
if (x == double(0)) {
return t1 ;
}
assert( t1.check_dzpuis(0) ) ;
Scalar resu(t1) ;
if (t1.get_etat() == ETATZERO) {
resu = - x ;
}
else{
if (t1.get_etat() == ETATUN) {
resu = double(1) - x ;
}
else{
assert(resu.get_etat() == ETATQCQ) ; // sinon ...
resu.va = resu.va - x ;
}
}
resu.set_dzpuis(0) ;
return resu ;
}
// double - Scalar
// ------------
Scalar operator-(double x, const Scalar& t1)
{
return - (t1 - x) ;
}
// Scalar - int
// ---------
Scalar operator-(const Scalar& t1, int m)
{
return t1 - double(m) ;
}
// int - Scalar
// ---------
Scalar operator-(int m, const Scalar& t1)
{
return double(m) - t1 ;
}
//****************//
// MULTIPLICATION //
//****************//
// Scalar * Scalar
// ---------
Scalar operator*(const Scalar& c1, const Scalar& c2) {
// Cas particuliers
if ((c1.get_etat() == ETATZERO) || (c1.get_etat() == ETATNONDEF)){
return c1 ;
}
if ((c2.get_etat() == ETATZERO)|| (c2.get_etat() == ETATNONDEF)) {
return c2 ;
}
if (c1.get_etat() == ETATUN)
return c2 ;
if (c2.get_etat() == ETATUN)
return c1 ;
assert(c1.get_etat() == ETATQCQ) ; // sinon...
assert(c2.get_etat() == ETATQCQ) ; // sinon...
// Protection
assert( c1.get_mp() == c2.get_mp() ) ;
// Cas general
Scalar r(c1) ; // Le resultat
r.va *= c2.va ;
r.set_dzpuis( c1.get_dzpuis() + c2.get_dzpuis() ) ;
// Termine
return r ;
}
// Scalar % Scalar (multiplication with desaliasing)
// -------------------------------------------
Scalar operator%(const Scalar& c1, const Scalar& c2) {
// Cas particuliers
if ((c1.get_etat() == ETATZERO) || (c1.get_etat() == ETATNONDEF)){
return c1 ;
}
if ((c2.get_etat() == ETATZERO)|| (c2.get_etat() == ETATNONDEF)) {
return c2 ;
}
if (c1.get_etat() == ETATUN)
return c2 ;
if (c2.get_etat() == ETATUN)
return c1 ;
assert(c1.get_etat() == ETATQCQ) ; // sinon...
assert(c2.get_etat() == ETATQCQ) ; // sinon...
// Protection
assert(c1.get_mp() == c2.get_mp()) ;
// Cas general
Scalar r( c1.get_mp() ) ; // Le resultat
r.set_etat_qcq() ;
r.va = c1.va % c2.va ;
r.set_dzpuis( c1.get_dzpuis() + c2.get_dzpuis() ) ;
// Termine
return r ;
}
// Scalar | Scalar (multiplication with desaliasing in r)
// ------------------------------------------------------
Scalar operator|(const Scalar& c1, const Scalar& c2) {
// Cas particuliers
if ((c1.get_etat() == ETATZERO) || (c1.get_etat() == ETATNONDEF)){
return c1 ;
}
if ((c2.get_etat() == ETATZERO)|| (c2.get_etat() == ETATNONDEF)) {
return c2 ;
}
if (c1.get_etat() == ETATUN)
return c2 ;
if (c2.get_etat() == ETATUN)
return c1 ;
assert(c1.get_etat() == ETATQCQ) ; // sinon...
assert(c2.get_etat() == ETATQCQ) ; // sinon...
// Protection
assert(c1.get_mp() == c2.get_mp()) ;
// Cas general
Scalar r( c1.get_mp() ) ; // Le resultat
r.set_etat_qcq() ;
r.va = c1.va | c2.va ;
r.set_dzpuis( c1.get_dzpuis() + c2.get_dzpuis() ) ;
// Termine
return r ;
}
// Mtbl * Scalar
// -------------
Scalar operator*(const Mtbl& mi, const Scalar& c1) {
// Particular cases
if ((c1.get_etat() == ETATZERO) || (c1.get_etat() == ETATNONDEF)) {
return c1 ;
}
Scalar r(c1.get_mp()) ;
if (c1.get_etat() == ETATUN) {
r = mi ;
}
else {
assert(c1.get_etat() == ETATQCQ) ; // sinon...
// Cas general
r.set_dzpuis( c1.get_dzpuis() ) ;
if ( mi.get_etat() == ETATZERO) {
r.set_etat_zero() ;
}
else {
r.set_etat_qcq() ;
r.va = mi * c1.va ;
}
}
// Termine
return r ;
}
// Scalar * Mtbl
// -------------
Scalar operator*(const Scalar& c1, const Mtbl& mi) {
return mi * c1 ;
}
// double * Scalar
// ------------
Scalar operator*(double a, const Scalar& c1) {
// Cas particuliers
if ((c1.get_etat() == ETATZERO) || (c1.get_etat() == ETATNONDEF)) {
return c1 ;
}
if (a == double(1))
return c1 ;
Scalar r(c1.get_mp()) ;
if (c1.get_etat() == ETATUN) {
r = a ;
r.set_spectral_base(c1.get_spectral_va().get_base()) ;
}
else {
assert(c1.get_etat() == ETATQCQ) ; // sinon...
// Cas general
r.set_dzpuis( c1.get_dzpuis() ) ;
if ( a == double(0) ) {
r.set_etat_zero() ;
}
else {
r.set_etat_qcq() ;
r.va = a * c1.va ;
}
}
// Termine
return r ;
}
// Scalar * double
// ------------
Scalar operator*(const Scalar& t1, double x)
{
return x * t1 ;
}
// Scalar * int
// ---------
Scalar operator*(const Scalar& t1, int m)
{
return t1 * double(m) ;
}
// int * Scalar
// ---------
Scalar operator*(int m, const Scalar& t1)
{
return double(m) * t1 ;
}
//**********//
// DIVISION //
//**********//
// Scalar / Scalar
// ---------
Scalar operator/(const Scalar& c1, const Scalar& c2) {
// Protections
assert(c1.get_etat() != ETATNONDEF) ;
assert(c2.get_etat() != ETATNONDEF) ;
assert(c1.get_mp() == c2.get_mp()) ;
// Cas particuliers
if (c2.get_etat() == ETATZERO) {
cout << "Division by 0 in Scalar / Scalar !" << endl ;
abort() ;
}
if (c1.get_etat() == ETATZERO) {
return c1 ;
}
if (c1.get_etat() == ETATUN)
return double(1)/c2 ;
if (c2.get_etat() == ETATUN)
return c1 ;
// Cas general
assert(c1.get_etat() == ETATQCQ) ; // sinon...
assert(c2.get_etat() == ETATQCQ) ; // sinon...
Scalar r(c1.get_mp()) ; // Le resultat
r.set_etat_qcq() ;
r.va = c1.va / c2.va ;
r.set_dzpuis( c1.get_dzpuis() - c2.get_dzpuis() ) ;
// Termine
return r ;
}
// Scalar / Mtbl
// -------------
Scalar operator/(const Scalar& c1, const Mtbl& mi) {
if (c1.get_etat() == ETATNONDEF) return c1 ;
// Cas particuliers
if ( mi.get_etat() == ETATZERO ) {
cout << "Division by 0 in Scalar / Mtbl !" << endl ;
abort() ;
}
if (c1.get_etat() == ETATZERO) {
return c1 ;
}
Scalar r(c1.get_mp()) ; // Le resultat
if (c1.get_etat() == ETATUN) {
r = double(1) / mi ;
}
else {
assert(c1.get_etat() == ETATQCQ) ; // sinon...
r.set_etat_qcq() ;
r.va = c1.va / mi ;
r.set_dzpuis( c1.get_dzpuis() ) ;
}
// Termine
return r ;
}
// Mtbl / Scalar
// -------------
Scalar operator/(const Mtbl& mi, const Scalar& c2) {
if (c2.get_etat() == ETATNONDEF)
return c2 ;
if (c2.get_etat() == ETATZERO) {
cout << "Division by 0 in Mtbl / Scalar !" << endl ;
abort() ;
}
Scalar r(c2.get_mp()) ; // Le resultat
if (c2.get_etat() == ETATUN) {
r = mi ;
}
else {
assert(c2.get_etat() == ETATQCQ) ; // sinon...
r.set_dzpuis( - c2.get_dzpuis() ) ;
if ( mi.get_etat() == ETATZERO ) {
r.set_etat_zero() ;
}
else {
r.set_etat_qcq() ;
r.va = mi / c2.va ;
}
}
// Termine
return r ;
}
// Scalar / double
// -------------
Scalar operator/(const Scalar& c1, double x) {
if (c1.get_etat() == ETATNONDEF)
return c1 ;
// Cas particuliers
if ( x == double(0) ) {
cout << "Division by 0 in Scalar / double !" << endl ;
abort() ;
}
if (c1.get_etat() == ETATZERO) {
return c1 ;
}
Scalar r(c1.get_mp()) ; // Le resultat
if (c1.get_etat() == ETATUN) {
r = double(1)/x ;
r.set_spectral_base(c1.get_spectral_va().get_base()) ;
}
else {
assert(c1.get_etat() == ETATQCQ) ; // sinon...
r.set_etat_qcq() ;
r.va = c1.va / x ;
r.set_dzpuis( c1.get_dzpuis() ) ;
}
// Termine
return r ;
}
// double / Scalar
// ------------
Scalar operator/(double x, const Scalar& c2) {
if (c2.get_etat() == ETATNONDEF)
return c2 ;
if (c2.get_etat() == ETATZERO) {
cout << "Division by 0 in double / Scalar !" << endl ;
abort() ;
}
Scalar r(c2.get_mp()) ; // Le resultat
if (c2.get_etat() == ETATUN) {
r = x ;
r.set_spectral_base(c2.get_spectral_va().get_base()) ;
}
else {
assert(c2.get_etat() == ETATQCQ) ; // sinon...
r.set_dzpuis( - c2.get_dzpuis() ) ;
if ( x == double(0) ) {
r.set_etat_zero() ;
}
else {
r.set_etat_qcq() ;
r.va = x / c2.va ;
}
}
// Termine
return r ;
}
// Scalar / int
// ---------
Scalar operator/(const Scalar& c1, int m) {
return c1 / double(m) ;
}
// int / Scalar
// ---------
Scalar operator/(int m, const Scalar& c2) {
return double(m) / c2 ;
}
//*******************//
// operateurs +=,... //
//*******************//
//---------
// += Scalar
//---------
void Scalar::operator+=(const Scalar & ci) {
// Protection
assert(mp == &(ci.get_mp()) ) ; // meme mapping
if (etat == ETATNONDEF)
return ;
// Cas particulier
if (ci.get_etat() == ETATZERO) {
return ;
}
if (ci.get_etat() == ETATNONDEF) {
set_etat_nondef() ;
return ;
}
// Cas general
if ( dz_nonzero() && ci.dz_nonzero() ) {
if ( dzpuis != ci.dzpuis ) {
cout << "Operation += Scalar : dzpuis conflict in the external " << endl;
cout << " compactified domain ! " << endl ;
abort() ;
}
}
if (etat == ETATZERO) {
(*this) = ci ;
}
else {
va += ci.va ;
if (etat == ETATUN) {
etat = ETATQCQ ; // since the case ci.etat == ETATZERO
} // has been treated above
assert(etat == ETATQCQ) ;
if( ci.dz_nonzero() ) {
set_dzpuis(ci.dzpuis) ;
}
}
// Menage (a ne faire qu'a la fin seulement)
del_deriv() ;
}
//---------
// -= Scalar
//---------
void Scalar::operator-=(const Scalar & ci) {
// Protection
assert(mp == &(ci.get_mp()) ) ; // meme mapping
if (etat == ETATNONDEF)
return ;
// Cas particulier
if (ci.get_etat() == ETATZERO) {
return ;
}
if (ci.get_etat() == ETATNONDEF) {
set_etat_nondef() ;
return ;
}
// Cas general
if ( dz_nonzero() && ci.dz_nonzero() ) {
if ( dzpuis != ci.dzpuis ) {
cout << "Operation -= Scalar : dzpuis conflict in the external " << endl;
cout << " compactified domain ! " << endl ;
abort() ;
}
}
if (etat == ETATZERO) {
(*this) = -ci ;
}
else {
va -= ci.va ;
if (etat == ETATUN) {
etat = ETATQCQ ; // since the case ci.etat == ETATZERO
} // has been treated above
assert(etat == ETATQCQ) ;
if( ci.dz_nonzero() ) {
set_dzpuis(ci.dzpuis) ;
}
}
// Menage (a ne faire qu'a la fin seulement)
del_deriv() ;
}
//---------
// *= Scalar
//---------
void Scalar::operator*=(const Scalar & ci) {
// Protection
assert(mp == &(ci.get_mp()) ) ; // meme mapping
if (etat == ETATNONDEF)
return ;
// Cas particulier
if (ci.get_etat() == ETATZERO) {
set_etat_zero() ;
return ;
}
if (etat == ETATZERO) {
return ;
}
if (ci.get_etat() == ETATUN) {
return ;
}
if (etat == ETATUN) {
operator=(ci) ;
return ;
}
if (ci.get_etat() == ETATNONDEF) {
set_etat_nondef() ;
return ;
}
// Cas general
assert(etat == ETATQCQ) ; // sinon....
va *= ci.va ;
dzpuis += ci.dzpuis ;
// Menage (a ne faire qu'a la fin seulement)
del_deriv() ;
}
}
Lorene::Mtbl
Multi-domain array.
Definition mtbl.h:118
Lorene::Mtbl::get_etat
int get_etat() const
Gives the logical state.
Definition mtbl.h:277
Lorene::Scalar
Tensor field of valence 0 (or component of a tensorial field).
Definition scalar.h:387
Lorene::Scalar::del_deriv
virtual void del_deriv() const
Logical destructor of the derivatives.
Definition scalar.C:287
Lorene::Scalar::get_dzpuis
int get_dzpuis() const
Returns dzpuis.
Definition scalar.h:557
Lorene::Scalar::operator=
void operator=(const Scalar &a)
Assignment to another Scalar defined on the same mapping.
Definition scalar.C:446
Lorene::Scalar::dz_nonzero
bool dz_nonzero() const
Returns true if the last domain is compactified and *this is not zero in this domain.
Definition scalar.C:814
Lorene::Scalar::operator-=
void operator-=(const Scalar &)
-= Scalar
Definition scalar_arithm.C:886
Lorene::Scalar::check_dzpuis
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...
Definition scalar.C:873
Lorene::Scalar::operator+=
void operator+=(const Scalar &)
+= Scalar
Definition scalar_arithm.C:833
Lorene::Scalar::set_etat_zero
virtual void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Definition scalar.C:324
Lorene::Scalar::Scalar
Scalar(const Map &mpi)
Constructor from mapping.
Definition scalar.C:204
Lorene::Scalar::get_spectral_va
const Valeur & get_spectral_va() const
Returns va (read only version).
Definition scalar.h:601
Lorene::Scalar::etat
int etat
The logical state ETATNONDEF (undefined), ETATZERO (null), ETATUN (one), or ETATQCQ (ordinary).
Definition scalar.h:396
Lorene::Scalar::get_etat
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
Definition scalar.h:554
Lorene::Scalar::set_etat_nondef
virtual void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Definition scalar.C:344
Lorene::Scalar::set_dzpuis
void set_dzpuis(int)
Modifies the dzpuis flag.
Definition scalar.C:808
Lorene::Scalar::operator*=
void operator*=(const Scalar &)
*= Scalar
Definition scalar_arithm.C:937
Lorene::Scalar::va
Valeur va
The numerical value of the Scalar.
Definition scalar.h:405
Lorene::Scalar::dzpuis
int dzpuis
Power of r by which the quantity represented by this must be divided in the compactified external d...
Definition scalar.h:403
Lorene::Valeur::get_base
const Base_val & get_base() const
Return the bases for spectral expansions (member base ).
Definition valeur.h:480
Lorene::operator*
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Definition base_val_mult.C:102
Lorene::operator-
Cmp operator-(const Cmp &)
- Cmp
Definition cmp_arithm.C:108
Lorene::operator/
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
Definition cmp_arithm.C:457
Lorene::operator%
Cmp operator%(const Cmp &, const Cmp &)
Cmp * Cmp with desaliasing.
Definition cmp_arithm.C:364
Lorene::operator+
Cmp operator+(const Cmp &)
Definition cmp_arithm.C:104
Lorene::operator|
Scalar operator|(const Scalar &, const Scalar &)
Scalar * Scalar with desaliasing only in r.
Definition scalar_arithm.C:491
Lorene::Tensor::get_mp
const Map & get_mp() const
Returns the mapping.
Definition tensor.h:861
Lorene::Tensor::mp
const Map *const mp
Mapping on which the numerical values at the grid points are defined.
Definition tensor.h:295
Lorene
Lorene prototypes.
Definition app_hor.h:64
Lorene::x
Coord x
x coordinate centered on the grid
Definition map.h:726
Lorene::r
Coord r
r coordinate centered on the grid
Definition map.h:718