Dim_tbl Class Reference
[Utilities.]

Storage of array dimensions. More...

#include <dim_tbl.h>

List of all members.

Public Member Functions

 Dim_tbl (int size0)
 1D constructor
 Dim_tbl (int size1, int size0)
 2D constructor
 Dim_tbl (int size2, int size1, int size0)
 3D constructor
 Dim_tbl (int n, int *sizes)
 N_dimensional constructor.
 Dim_tbl (const Dim_tbl &)
 Copy constructor.
 Dim_tbl (FILE *)
 Constructor from a file (see sauve(FILE*) ).
 ~Dim_tbl ()
 Destructor.
void operator= (const Dim_tbl &)
 Assignment.
void sauve (FILE *) const
 Save in a file.
bool operator== (const Dim_tbl &) const
 Comparison operator.

Public Attributes

int ndim
 Number of dimensions of the Tbl: can be 1, 2 or 3.
int * dim
 Array of dimensions (size: ndim).
int taille
 Total size of the array Tbl::t.

Friends

ostream & operator<< (ostream &, const Dim_tbl &)
 Display.

Detailed Description

Storage of array dimensions.

This class is designed for internal purposes related to the class Tbl}, namely the storage of the Tbl} dimensions. ()

Definition at line 95 of file dim_tbl.h.


Constructor & Destructor Documentation

Dim_tbl::Dim_tbl ( int  size0  )  [explicit]

1D constructor

Parameters:
size0 [input] Number of elements of the array Tbl::t. Will be assigned to dim[0]. The size 0 is allowed for the 1D constructor but not for the 2D or 3D ones.

Definition at line 96 of file dim_tbl.C.

References dim, ndim, and taille.

Dim_tbl::Dim_tbl ( int  size1,
int  size0 
)

2D constructor

Parameters:
size1 [input] Defines the range [0, size1-1] of the outermost index in the storage of the array Tbl::t. Will be assigned to dim[1].
size0 [input] Defines the range [0, size0-1] of the innermost index in the storage of the array Tbl::t. Will be assigned to dim[0].

Definition at line 103 of file dim_tbl.C.

References dim, ndim, and taille.

Dim_tbl::Dim_tbl ( int  size2,
int  size1,
int  size0 
)

3D constructor

Parameters:
size2 [input] Defines the range [0, size2-1] of the outermost index in the storage of the array Tbl::t. Will be assigned to dim[2].
size1 [input] Defines the range [0, size1-1] of the intermediate index in the storage of the array Tbl::t. Will be assigned to dim[1].
size0 [input] Defines the range [0, size0-1] of the innermost index in the storage of the array Tbl::t. Will be assigned to dim[0].

Definition at line 111 of file dim_tbl.C.

References dim, ndim, and taille.

Dim_tbl::Dim_tbl ( int  n,
int *  sizes 
)

N_dimensional constructor.

Parameters:
n [input] number of dimensions.
sizes [input] array of the dimensions.

Definition at line 121 of file dim_tbl.C.

References dim, ndim, and taille.

Dim_tbl::Dim_tbl ( const Dim_tbl titi  ) 

Copy constructor.

Definition at line 133 of file dim_tbl.C.

References dim, ndim, and taille.

Dim_tbl::Dim_tbl ( FILE *  fd  )  [explicit]

Constructor from a file (see sauve(FILE*) ).

Definition at line 142 of file dim_tbl.C.

References dim, fread_be(), ndim, and taille.

Dim_tbl::~Dim_tbl (  ) 

Destructor.

Definition at line 157 of file dim_tbl.C.

References dim.


Member Function Documentation

void Dim_tbl::operator= ( const Dim_tbl titi  ) 

Assignment.

Definition at line 166 of file dim_tbl.C.

References dim, ndim, and taille.

bool Dim_tbl::operator== ( const Dim_tbl ti  )  const

Comparison operator.

Definition at line 204 of file dim_tbl.C.

References dim, and ndim.

void Dim_tbl::sauve ( FILE *  fd  )  const

Save in a file.

Definition at line 181 of file dim_tbl.C.

References dim, fwrite_be(), and ndim.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  ,
const Dim_tbl  
) [friend]

Display.


Member Data Documentation

Array of dimensions (size: ndim).

Definition at line 98 of file dim_tbl.h.

Number of dimensions of the Tbl: can be 1, 2 or 3.

Definition at line 97 of file dim_tbl.h.

Total size of the array Tbl::t.

  • taille = dim[0] if ndim = 1
  • taille = dim[0]*dim[1] if ndim = 2
  • taille = dim[0]*dim[1]*dim[2] if ndim = 3

Definition at line 108 of file dim_tbl.h.


The documentation for this class was generated from the following files:

Generated on 7 Oct 2014 for LORENE by  doxygen 1.6.1