33char tensor_arithm_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/tensor_arithm.C,v 1.5 2014/10/13 08:53:44 j_novak Exp $" ;
87 res.
set(ind) = -t(ind) ;
113 res.
set(ind) = t1(ind) + t2(ind) ;
125 return *(t1.
cmp[0]) + t2 ;
134 return t1 + *(t2.
cmp[0]) ;
158 res.
set(ind) = t1(ind) - t2(ind) ;
169 return *(t1.
cmp[0]) - t2 ;
178 return t1 - *(t2.
cmp[0]) ;
192 if (t1.
get_etat() == ETATUN)
return t2 ;
199 res.
set(ind) = t1 * t2(ind) ;
220 res.
set(ind) = x*t(ind) ;
233 return double(m) * t ;
238 return double(m) * t ;
249 assert(s2.
get_etat() != ETATNONDEF) ;
254 cout <<
"Division by 0 in Tensor / Scalar !" << endl ;
258 if (s2.
get_etat() == ETATUN)
return t1 ;
265 res.
set(ind) = t1(ind) / s2 ;
274 if ( x ==
double(0) ) {
275 cout <<
"Division by 0 in Tensor / double !" << endl ;
287 res.
set(ind) = t(ind) / x ;
296 return t / double(m) ;
Basic integer array class.
Tensor field of valence 0 (or component of a tensorial field).
int get_etat() const
Returns the logical state ETATNONDEF (undefined), ETATZERO (null) or ETATQCQ (ordinary).
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 Map & get_mp() const
Returns the mapping.
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
int get_valence() const
Returns the valence.
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
int get_n_comp() const
Returns the number of stored components.
Scalar ** cmp
Array of size n_comp of pointers onto the components.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).