118 assert (t.
get_etat() != ETATNONDEF) ;
128 for (
int i=0 ; i<res.get_n_comp() ; i++) {
129 Itbl indices (res.donne_indices(i)) ;
130 res.
set(indices) = -t(indices) ;
163 for (
int i=0 ; i<res.get_n_comp() ; i++) {
164 Itbl indices (res.donne_indices(i)) ;
165 res.
set(indices) = t1(indices) + t2(indices) ;
174 assert (t1.
get_etat() != ETATNONDEF) ;
177 if (x ==
double(0)) {
185 res.set() = t1() + x ;
200 return t1 + double(m) ;
207 return t2 + double(m) ;
219 return (t1 + (-t2)) ;
226 assert (t1.
get_etat() != ETATNONDEF) ;
229 if (x ==
double(0)) {
237 res.set() = t1() - x ;
253 return t1 - double(m) ;
260 return - (t2 - double(m)) ;
274 assert (t.
get_etat() != ETATNONDEF) ;
275 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
281 if ( x ==
double(0) )
285 for (
int i=0 ; i<res.get_n_comp() ; i++) {
286 Itbl indices (res.donne_indices(i)) ;
287 res.
set(indices) = x*t(indices) ;
300 return double(m) * t ;
305 return double(m) * t ;
316 assert(t1.
get_etat() != ETATNONDEF) ;
317 assert(t2.
get_etat() != ETATNONDEF) ;
322 poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ;
323 const Metrique* met_res = 0x0 ;
324 if (poids_res != 0.) {
331 cout <<
"Division by 0 in Tenseur / Tenseur !" << endl ;
350 for (
int i=0 ; i<res.get_n_comp() ; i++) {
351 Itbl indices (res.donne_indices(i)) ;
352 res.
set(indices) = t1(indices) / t2() ;
361 assert (t.
get_etat() != ETATNONDEF) ;
363 if ( x ==
double(0) ) {
364 cout <<
"Division by 0 in Tenseur / double !" << endl ;
368 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
375 for (
int i=0 ; i<res.get_n_comp() ; i++) {
376 Itbl indices (res.donne_indices(i)) ;
377 res.
set(indices) = t(indices) / x ;
390 cout <<
"Division by 0 in double / Tenseur !" << endl ;
399 res.set() = x / t() ;
406 return t / double(m) ;
412 return double(m) / t ;
double get_poids() const
Returns the weight.
int get_type_indice(int i) const
Returns the type of the index number i .
int & set(int i)
Read/write of a particular element (index i ) (1D case)
void set_poids(double weight)
Sets the weight for a tensor density.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
Basic integer array class.
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
int get_valence() const
Returns the valence.
void set_metric(const Metrique &met)
Sets the pointer on the metric for a tensor density.
const Map * get_mp() const
Returns pointer on the mapping.
const Metrique * get_metric() const
Returns a pointer on the metric defining the conformal factor for tensor densities.
Cmp operator+(const Cmp &)
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.
Cmp operator-(const Cmp &)
- Cmp
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_zero()
Sets the logical state to ETATZERO (zero state).
Tensor handling *** DEPRECATED : use class Tensor instead ***.