106 assert (t.
get_etat() != ETATNONDEF) ;
114 for (
int i=0 ; i<res.get_n_comp() ; i++) {
115 Itbl indices (res.donne_indices(i)) ;
116 res.
set(indices) = -t(indices) ;
151 for (
int i=0 ; i<res.get_n_comp() ; i++) {
152 Itbl indices (res.donne_indices(i)) ;
153 res.
set(indices) = t1(indices) + t2(indices) ;
168 return (t1 + (-t2)) ;
179 assert (t.
get_etat() != ETATNONDEF) ;
180 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
186 if ( x ==
double(0) )
190 for (
int i=0 ; i<res.get_n_comp() ; i++) {
191 Itbl indices (res.donne_indices(i)) ;
192 res.
set(indices) = x*t(indices) ;
205 return double(m) * t ;
210 return double(m) * t ;
222 assert(t1.
get_etat() != ETATNONDEF) ;
223 assert(t2.
get_etat() != ETATNONDEF) ;
228 poids_res = (fabs(poids_res) < 1.e-10 ? 0. : poids_res) ;
229 const Metrique* met_res = 0x0 ;
230 if (poids_res != 0.) {
238 cout <<
"Division by 0 in Tenseur_sym / Tenseur !" << endl ;
254 *(t1.
get_triad()), met_res, poids_res ) ;
257 for (
int i=0 ; i<res.get_n_comp() ; i++) {
258 Itbl indices (res.donne_indices(i)) ;
259 res.
set(indices) = t1(indices) / t2() ;
268 assert (t.
get_etat() != ETATNONDEF) ;
270 if ( x ==
double(0) ) {
271 cout <<
"Division by 0 in Tenseur_sym / double !" << endl ;
275 if ( (t.
get_etat() == ETATZERO) || (x ==
double(1)) )
282 for (
int i=0 ; i<res.get_n_comp() ; i++) {
283 Itbl indices (res.donne_indices(i)) ;
284 res.
set(indices) = t(indices) / x ;
294 return t / double(m) ;
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.
Class intended to describe tensors with a symmetry on the two last indices *** DEPRECATED : use class...
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 ***.