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 $" ;
85 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
99 assert (
t1.get_valence() ==
t2.get_valence()) ;
101 if (
t1.get_valence() != 0) {
102 assert ( *(
t1.get_triad()) == *(
t2.get_triad()) ) ;
105 for (
int i=0 ;
i<
t1.get_valence() ;
i++)
111 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
125 return *(
t1.cmp[0]) +
t2 ;
134 return t1 + *(
t2.cmp[0]) ;
144 assert (
t1.get_valence() ==
t2.get_valence()) ;
146 if (
t1.get_valence() != 0) {
147 assert ( *(
t1.get_triad()) == *(
t2.get_triad()) ) ;
150 for (
int i=0 ;
i<
t1.get_valence() ;
i++)
156 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
169 return *(
t1.cmp[0]) -
t2 ;
178 return t1 - *(
t2.cmp[0]) ;
192 if (
t1.get_etat() == ETATUN)
return t2 ;
197 for (
int ic=0 ;
ic<
res.get_n_comp() ;
ic++) {
218 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
249 assert(
s2.get_etat() != ETATNONDEF) ;
253 if (
s2.get_etat() == ETATZERO) {
254 cout <<
"Division by 0 in Tensor / Scalar !" <<
endl ;
258 if (
s2.get_etat() == ETATUN)
return t1 ;
263 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
274 if ( x ==
double(0) ) {
275 cout <<
"Division by 0 in Tensor / double !" <<
endl ;
285 for (
int i=0 ;
i<
res.get_n_comp() ;
i++) {
Time evolution with partial storage (*** under development ***).
Basic integer array class.
Tensor field of valence 0 (or component of a tensorial field).
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.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.