83 assert(t1.
get_etat() != ETATNONDEF) ;
93 assert(t1.
get_etat() != ETATNONDEF) ;
104 (r.
t)[i] = - (t1.
t)[i] ;
119 assert(t1.
get_etat() != ETATNONDEF) ;
120 assert(t2.
get_etat() != ETATNONDEF) ;
122 for (
int i=0 ; i<t1.
get_ndim() ; i++) {
139 for (
int i=0 ; i<r.get_taille() ; i++) {
140 (r.t)[i] += (t2.
t)[i] ;
152 assert(t1.
get_etat() != ETATNONDEF) ;
155 if ( x ==
double(0) ) {
179 return t1 + double(n) ;
186 return t1 + double(n) ;
200 assert(t1.
get_etat() != ETATNONDEF) ;
201 assert(t2.
get_etat() != ETATNONDEF) ;
203 for (
int i=0 ; i<t1.
get_ndim() ; i++) {
220 for (
int i=0 ; i<r.get_taille() ; i++) {
221 (r.t)[i] -= (t2.
t)[i] ;
234 assert(t1.
get_etat() != ETATNONDEF) ;
237 if ( x ==
double(0) ) {
254 return t1 - double(n) ;
262 assert(t1.
get_etat() != ETATNONDEF) ;
265 if ( x ==
double(0) ) {
282 return double(n) - t1 ;
294 assert(t1.
get_etat() != ETATNONDEF) ;
295 assert(t2.
get_etat() != ETATNONDEF) ;
297 for (
int i=0 ; i<t1.
get_ndim() ; i++) {
314 for (
int i=0 ; i<r.get_taille() ; i++) {
315 (r.t)[i] *= (t2.
t)[i] ;
327 assert(t1.
get_etat() != ETATNONDEF) ;
330 if ((t1.
get_etat() == ETATZERO) || ( x ==
double(1) )) {
339 if (x ==
double(0)) {
343 for (
int i=0 ; i<r.get_taille() ; i++) {
363 return t1 * double(n) ;
370 return t1 * double(n) ;
382 assert(t1.
get_etat() != ETATNONDEF) ;
383 assert(t2.
get_etat() != ETATNONDEF) ;
385 for (
int i=0 ; i<t1.
get_ndim() ; i++) {
391 cout <<
"Division by 0 in Tbl/Tbl !" << endl ;
403 for (
int i=0 ; i<r.get_taille() ; i++) {
404 (r.t)[i] /= (t2.
t)[i] ;
416 assert(t1.
get_etat() != ETATNONDEF) ;
417 if ( x ==
double(0) ) {
418 cout <<
"Division by 0 in Tbl/double !" << endl ;
423 if ((t1.
get_etat() == ETATZERO) || ( x ==
double(1) )) {
431 for (
int i=0 ; i<r.get_taille() ; i++) {
441 return t1 / double(n) ;
449 assert(t1.
get_etat() != ETATNONDEF) ;
453 cout <<
"Division by 0 in double/Tbl !" << endl ;
462 if ( x ==
double(0) ) {
467 for (
int i=0 ; i<r.get_taille() ; i++) {
468 (r.t)[i] = x / (t1.
t)[i] ;
480 return double(n) / t1 ;
491 assert(
etat != ETATNONDEF) ;
492 assert(ti.
get_etat() != ETATNONDEF) ;
504 for (
int i=0 ; i<n ; i++) {
510 for (
int i=0 ; i<n ; i++) {
516 cout <<
"etat inconnu " << __FILE__ << endl ;
527 assert(
etat != ETATNONDEF) ;
530 if ( x ==
double(0) ) {
539 for (
int i=0 ; i<n ; i++) {
545 for (
int i=0 ; i<n ; i++) {
551 cout <<
"etat inconnu " << __FILE__ << endl ;
563 assert(
etat != ETATNONDEF) ;
564 assert(ti.
get_etat() != ETATNONDEF) ;
576 for (
int i=0 ; i<n ; i++) {
582 for (
int i=0 ; i<n ; i++) {
588 cout <<
"etat inconnu " << __FILE__ << endl ;
599 assert(
etat != ETATNONDEF) ;
602 if ( x ==
double(0) ) {
611 for (
int i=0 ; i<n ; i++) {
617 for (
int i=0 ; i<n ; i++) {
623 cout <<
"etat inconnu " << __FILE__ << endl ;
635 assert(
etat != ETATNONDEF) ;
636 assert(ti.
get_etat() != ETATNONDEF) ;
639 if (
etat == ETATZERO) {
648 assert(
etat == ETATQCQ) ;
650 for (
int i=0 ; i<n ; i++) {
660 assert(
etat != ETATNONDEF) ;
663 if ( x ==
double(0) ) {
667 if (
etat == ETATZERO) {
673 assert(
etat == ETATQCQ) ;
674 for (
int i=0 ; i<n ; i++) {
685 assert(
etat != ETATNONDEF) ;
686 assert(ti.
get_etat() != ETATNONDEF) ;
690 cout <<
"Division by 0 in Tbl::operator/=(const Tbl &) !" << endl ;
693 if (
etat == ETATZERO) {
698 assert(
etat == ETATQCQ) ;
701 for (
int i=0 ; i<n ; i++) {
711 assert(
etat != ETATNONDEF) ;
714 if ( x ==
double(0) ) {
715 cout <<
"Division by 0 in Tbl::operator/=(double ) !" << endl ;
718 if (
etat == ETATZERO) {
723 assert(
etat == ETATQCQ) ;
725 for (
int i=0 ; i<n ; i++) {
void operator/=(const Tbl &)
Division of this by a Tbl.
void operator-=(const Tbl &)
Subtraction of a Tbl to this.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
int get_etat() const
Gives the logical state.
Cmp operator/(const Cmp &, const Cmp &)
Cmp / Cmp.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void operator+=(const Tbl &)
Addition of a Tbl to this.
int get_ndim() const
Gives the number of dimensions (ie dim.ndim)
Dim_tbl dim
Number of dimensions, size,...
Cmp operator+(const Cmp &)
double * t
The array of double.
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
int etat
logical state (ETATNONDEF, ETATQCQ or ETATZERO).
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void operator*=(const Tbl &)
Multiplication of this by a Tbl.
int get_taille() const
Gives the total size (ie dim.taille)
Cmp operator-(const Cmp &)
- Cmp