32 char tenseur_arithm_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tenseur/tenseur_arithm.C,v 1.9 2014/10/13 08:53:42 j_novak Exp $" ;
115 assert (t.
get_etat() != ETATNONDEF) ;
127 res.
set(indices) = -t(indices) ;
162 res.
set(indices) = t1(indices) + t2(indices) ;
171 assert (t1.
get_etat() != ETATNONDEF) ;
174 if (x ==
double(0)) {
182 res.
set() = t1() + x ;
197 return t1 + double(m) ;
204 return t2 + double(m) ;
216 return (t1 + (-t2)) ;
223 assert (t1.
get_etat() != ETATNONDEF) ;
226 if (x ==
double(0)) {
234 res.
set() = t1() - x ;
250 return t1 - double(m) ;
257 return - (t2 - double(m)) ;
271 assert (t.
get_etat() != ETATNONDEF) ;
272 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
278 if ( x ==
double(0) )
284 res.
set(indices) = x*t(indices) ;
297 return double(m) * t ;
302 return double(m) * t ;
313 assert(t1.
get_etat() != ETATNONDEF) ;
314 assert(t2.
get_etat() != ETATNONDEF) ;
319 poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ;
320 const Metrique* met_res = 0x0 ;
321 if (poids_res != 0.) {
328 cout <<
"Division by 0 in Tenseur / Tenseur !" << endl ;
349 res.
set(indices) = t1(indices) / t2() ;
358 assert (t.
get_etat() != ETATNONDEF) ;
360 if ( x ==
double(0) ) {
361 cout <<
"Division by 0 in Tenseur / double !" << endl ;
365 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
374 res.
set(indices) = t(indices) / x ;
387 cout <<
"Division by 0 in double / Tenseur !" << endl ;
396 res.
set() = x / t() ;
403 return t / double(m) ;
409 return double(m) / t ;
Basic integer array class.
Tensor handling *** DEPRECATED : use class Tensor instead ***.
virtual Itbl donne_indices(int place) const
Returns the indices of a component given by its position in the Cmp 1-D array c .
Cmp & set()
Read/write for a scalar (see also operator=(const Cmp&) ).
int get_type_indice(int i) const
Returns the type of the index number i .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double get_poids() const
Returns the weight.
const Map * get_mp() const
Returns pointer on the mapping.
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
void set_poids(double weight)
Sets the weight for a tensor density.
void set_metric(const Metrique &met)
Sets the pointer on the metric for a tensor density.
const Metrique * get_metric() const
Returns a pointer on the metric defining the conformal factor for tensor densities.
int get_valence() const
Returns the valence.
int get_n_comp() const
Returns the number of components.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
int get_etat() const
Returns the logical state.
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 &)