LORENE
Lorene::Dim_tbl Class Reference

Storage of array dimensions. More...

#include <dim_tbl.h>

Public Member Functions

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

Public Attributes

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

Friends

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

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 99 of file dim_tbl.h.

Constructor & Destructor Documentation

◆ Dim_tbl() [1/6]

Lorene::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 100 of file dim_tbl.C.

References dim, ndim, and taille.

◆ Dim_tbl() [2/6]

Lorene::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 107 of file dim_tbl.C.

References dim, ndim, and taille.

◆ Dim_tbl() [3/6]

Lorene::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 115 of file dim_tbl.C.

References dim, ndim, and taille.

◆ Dim_tbl() [4/6]

Lorene::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 125 of file dim_tbl.C.

References dim, ndim, and taille.

◆ Dim_tbl() [5/6]

Lorene::Dim_tbl::Dim_tbl ( const Dim_tbl titi)

Copy constructor.

Definition at line 137 of file dim_tbl.C.

References dim, ndim, and taille.

◆ Dim_tbl() [6/6]

Lorene::Dim_tbl::Dim_tbl ( FILE *  fd)
explicit

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

Definition at line 146 of file dim_tbl.C.

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

◆ ~Dim_tbl()

Lorene::Dim_tbl::~Dim_tbl ( )

Destructor.

Definition at line 161 of file dim_tbl.C.

References dim.

Member Function Documentation

◆ operator=()

void Lorene::Dim_tbl::operator= ( const Dim_tbl titi)

Assignment.

Definition at line 170 of file dim_tbl.C.

References dim, ndim, and taille.

◆ operator==()

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

Comparison operator.

Definition at line 208 of file dim_tbl.C.

References dim, and ndim.

◆ sauve()

void Lorene::Dim_tbl::sauve ( FILE *  fd) const

Save in a file.

Definition at line 185 of file dim_tbl.C.

References dim, Lorene::fwrite_be(), and ndim.

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  o,
const Dim_tbl titi 
)
friend

Display.

Definition at line 195 of file dim_tbl.C.

Member Data Documentation

◆ dim

int* Lorene::Dim_tbl::dim

Array of dimensions (size: ndim).

Definition at line 102 of file dim_tbl.h.

◆ ndim

int Lorene::Dim_tbl::ndim

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

Definition at line 101 of file dim_tbl.h.

◆ taille

int Lorene::Dim_tbl::taille

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 112 of file dim_tbl.h.


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