32char tensor_sym_arithm_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/tensor_sym_arithm.C,v 1.3 2014/10/13 08:53:44 j_novak Exp $" ;
77 res.
set(ind) = -tt(ind) ;
108 res.
set(ind) = t1(ind) + t2(ind) ;
139 res.
set(ind) = t1(ind) - t2(ind) ;
156 if (t1.
get_etat() == ETATUN)
return t2 ;
163 res.
set(ind) = t1 * t2(ind) ;
184 res.
set(ind) = x * tt(ind) ;
198 return double(m) * t ;
203 return double(m) * t ;
214 assert(s2.
get_etat() != ETATNONDEF) ;
219 cout <<
"Division by 0 in Tensor_sym / Scalar !" << endl ;
223 if (s2.
get_etat() == ETATUN)
return t1 ;
230 res.
set(ind) = t1(ind) / s2 ;
240 if ( x ==
double(0) ) {
241 cout <<
"Division by 0 in Tensor_sym / double !" << endl ;
245 if ( x ==
double(1) )
return tt ;
252 res.
set(ind) = tt(ind) / x ;
263 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).
Symmetric tensors (with respect to two of their arguments).
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 sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence )
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence )
int get_valence() const
Returns the valence.
int get_n_comp() const
Returns the number of stored 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).