31char tbl_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tbl/tbl.C,v 1.11 2014/10/13 08:53:41 j_novak Exp $" ;
134#include "utilitaires.h"
154 dim(g.get_np(), g.get_nt(), g.get_nr()),
162 int n =
sizes.get_dim(0) ;
163 int*
dims =
new int[
n] ;
164 for (
int i=0 ;
i<
n ;
i++)
178 if (
tc.etat == ETATQCQ) {
183 for (
int i=0 ;
i<
n ;
i++) {
200 if (
etat == ETATQCQ) {
211 dim( (aa.get_array()).dim ) {
228 if (
etat == ETATQCQ) {
263 assert(
tx.get_etat() != ETATNONDEF) ;
275 for (
int i=0 ;
i<
n ;
i++) {
283 cout <<
"Erreur bizarre !" <<
endl ;
292 if (
a ==
double(0) ) {
298 for (
int i=0 ;
i<
n ;
i++) {
313 for (
int i=0 ;
i<
n ;
i++) {
330 if (
etat == ETATQCQ) {
395 o.setf(ios::showpoint);
396 o <<
"*** Tbl " << ndim <<
"D" <<
" size: " ;
397 for (
int i = 0;
i<ndim-1;
i++) {
405 o <<
"Identically ZERO" <<
endl ;
410 o <<
"UNDEFINED STATE" <<
endl ;
428 o <<
" j = " <<
j <<
" : " <<
endl ;
430 o <<
" " << t(
j,
i) ;
440 o <<
"k = " <<
k <<
" : " <<
endl ;
442 o <<
"j = " <<
j <<
" : " ;
444 o <<
" " << t(
k,
j,
i) ;
455 cout <<
"operator<< Tbl : unexpected dimension !" <<
endl ;
456 cout <<
" ndim = " << ndim <<
endl ;
471 ost <<
"*** Tbl " << ndim <<
"D" <<
" size: " ;
472 for (
int i = 0;
i<ndim-1;
i++) {
480 if (
etat == ETATNONDEF) {
481 ost <<
" state: UNDEFINED" <<
endl ;
485 if (
etat == ETATZERO) {
486 ost <<
" state: ZERO" <<
endl ;
494 ost.precision(precis);
495 ost.setf(ios::showpoint);
501 ost <<
" " <<
setw(precis) << (*this)(
i) ;
510 ost <<
" #j=" <<
j <<
" : " ;
512 ost <<
" " <<
setw(precis) << (*this)(
j,
i) ;
529 ost <<
" #k=" <<
k <<
",j=" <<
j <<
" : " ;
531 ost <<
" " <<
setw(precis) << (*this)(
k,
j,
i) ;
542 cout <<
"Tbl:affiche_seuil : unexpected dimension !" <<
endl ;
552 ost.unsetf(ios::showpoint);
Storage of array dimensions.
int taille
Total size of the array Tbl::t.
void sauve(FILE *) const
Save in a file.
int * dim
Array of dimensions (size: ndim).
int ndim
Number of dimensions of the Tbl: can be 1, 2 or 3.
Time evolution with partial storage (*** under development ***).
3D grid class in one domain.
Basic integer array class.
Tbl get_array() const
Returns the array of matrix elements.
Dim_tbl dim
Number of dimensions, size,...
void operator=(const Tbl &)
Assignment to another Tbl.
int get_ndim() const
Gives the number of dimensions (ie dim.ndim)
Tbl(int size0)
1D constructor
int get_etat() const
Gives the logical state.
int etat
logical state (ETATNONDEF, ETATQCQ or ETATZERO).
void affiche_seuil(ostream &ostr, int precision=4, double threshold=1.e-7) const
Prints only the values greater than a given threshold.
void sauve(FILE *) const
Save in a file.
void annule_hard()
Sets the Tbl to zero in a hard way.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
void del_t()
Logical destructor: dellocates the memory occupied by the array t and sets the logical state to ETATN...
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void set_etat_nondef()
Sets the logical state to ETATNONDEF (undefined).
int get_taille() const
Gives the total size (ie dim.taille)
double * t
The array of double.
int get_dim(int i) const
Gives the i-th dimension (ie dim.dim[i])
int fread_be(int *aa, int size, int nb, FILE *fich)
Reads integer(s) from a binary file according to the big endian convention.
int fwrite_be(const int *aa, int size, int nb, FILE *fich)
Writes integer(s) into a binary file according to the big endian convention.