93 #include "type_parite.h" 148 explicit Itbl(
int size0) ;
163 Itbl(
int size1,
int size0) ;
181 Itbl(
int size2,
int size1,
int size0) ;
192 explicit Itbl(FILE* ) ;
248 assert (
etat == ETATQCQ) ;
251 assert( i <
dim.
dim[0] ) ;
257 assert(
etat != ETATNONDEF) ;
260 assert( i <
dim.
dim[0] ) ;
261 if (
etat == ETATZERO) {
269 int&
set(
int j,
int i) {
270 assert (
etat == ETATQCQ) ;
272 assert( (i>=0) && (i<
dim.
dim[0]) ) ;
273 assert( (j>=0) && (j<
dim.
dim[1]) ) ;
279 assert(
etat != ETATNONDEF) ;
281 assert( (i>=0) && (i<
dim.
dim[0]) ) ;
282 assert( (j>=0) && (j<
dim.
dim[1]) ) ;
283 if (
etat == ETATZERO) {
287 else return t[
dim.
dim[0] * j + i] ;
291 int&
set(
int k,
int j,
int i) {
292 assert (
etat == ETATQCQ) ;
294 assert( (i>=0) && (i<
dim.
dim[0]) ) ;
295 assert( (j>=0) && (j<
dim.
dim[1]) ) ;
296 assert( (k>=0) && (k<
dim.
dim[2]) ) ;
302 assert(
etat != ETATNONDEF) ;
304 assert( (i>=0) && (i<
dim.
dim[0]) ) ;
305 assert( (j>=0) && (j<
dim.
dim[1]) ) ;
306 assert( (k>=0) && (k<
dim.
dim[2]) ) ;
307 if (
etat == ETATZERO) {
327 assert( (i>=0) && (i<
dim.
ndim) ) ;
334 void sauve(FILE* )
const ;
350 ostream& operator<<(ostream& ,
const Itbl& ) ;
361 Itbl
operator+(
const Itbl&,
const Itbl&) ;
364 Itbl
operator-(
const Itbl&,
const Itbl&) ;
367 Itbl
operator*(
const Itbl&,
const Itbl&) ;
371 Itbl
abs(
const Itbl& ) ;
372 int max(
const Itbl& ) ;
373 int min(
const Itbl& ) ;
376 int norme(
const Itbl& ) ;
383 double diffrel(
const Itbl& a,
const Itbl& b) ;
390 double diffrelmax(
const Itbl& a,
const Itbl& b) ;
void del_t()
Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATN...
Itbl(int size0)
1D constructor.
int get_taille() const
Gives the total size (ie dim.taille )
int get_ndim() const
Gives the number of dimensions (ie dim.ndim )
void annule_hard()
Sets the Itbl to zero in a hard way.
Base_val operator*(const Base_val &, const Base_val &)
This operator is used when calling multiplication or division of Valeur .
void operator*=(const Itbl &)
Multiplication of this by a Itbl.
int taille
Total size of the array Tbl::t.
Basic integer array class.
int operator()(int i) const
Read-only of a particular element (index i ) (1D case)
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
void operator-=(const Itbl &)
Subtraction of a Itbl to this.
Dim_tbl dim
Number of dimensions, size,...
friend ostream & operator<<(ostream &, const Itbl &)
Display.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Cmp operator+(const Cmp &)
void sauve(FILE *) const
Save in a file.
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
int operator()(int j, int i) const
Read-only of a particular element (index (j,i) ) (2D case)
int get_etat() const
Gives the logical state.
int operator()(int k, int j, int i) const
Read-only of a particular element (index (k,j,i) ) (3D case)
int ndim
Number of dimensions of the Tbl: can be 1, 2 or 3.
Storage of array dimensions.
void operator=(const Itbl &)
Assignment to another Itbl.
void operator+=(const Itbl &)
Addition of a Itbl to this.
Cmp abs(const Cmp &)
Absolute value.
int get_dim(int i) const
Gives the i th dimension (ie {tt dim.dim[i] )
Cmp operator-(const Cmp &)
- Cmp
int * t
The array of int 's.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
int * dim
Array of dimensions (size: ndim).
int etat
logical state (ETATNONDEF , ETATQCQ or ETATZERO ).