OPENF4
Library for Gröebner basis computations over finite fields.
 All Classes Namespaces Files Functions Variables Friends Pages
Public Member Functions | Private Attributes | List of all members
F4::DynamicArray< dataType > Class Template Reference

Represent a dynamic array whose the width is fixed, the memory is allocated by blocs. More...

#include <dynamic-array.h>

Public Member Functions

 DynamicArray (int width, int maxHeight)
 Constructor. More...
 
 DynamicArray (int width, int maxHeight, int initialCapacity)
 Constructor. More...
 
 ~DynamicArray ()
 Destructor.
 
void printDynamicArray (std::ostream &stream=std::cout) const
 Print the dynamic array.
 
void reset ()
 Reset the dynamic array, do not free the memory.
 
int getWidth ()
 Get the width of the dynamic array.
 
int getMaxHeight ()
 Get the maximum height of the dynamic array.
 
int getCurrentHeight ()
 Get the current height of the dynamic array.
 
dataType & operator[] (int index)
 Overload the operator []. More...
 
dataType const & operator[] (int index) const
 Overload the operator []. More...
 
dataType * getBegin ()
 Get an iterator to the beginning of the array. More...
 
dataType * getNext (dataType *data)
 Get an iterator to next data after data. More...
 

Private Attributes

int _width
 
int _maxHeight
 
int _currentHeight
 
int _colIt
 
int _rowIt
 
dataType ** _array
 

Detailed Description

template<typename dataType>
class F4::DynamicArray< dataType >

Represent a dynamic array whose the width is fixed, the memory is allocated by blocs.

Definition at line 45 of file dynamic-array.h.

Constructor & Destructor Documentation

template<typename dataType>
F4::DynamicArray< dataType >::DynamicArray ( int  width,
int  maxHeight 
)

Constructor.

Parameters
widthWidth of the array (size of a memory block).
maxHeightMaximum height of the dynamic array. The maximal capacity of this array will be width * maxHeight.
template<typename dataType>
F4::DynamicArray< dataType >::DynamicArray ( int  width,
int  maxHeight,
int  initialCapacity 
)

Constructor.

Parameters
widthWidth of the array (size of a memory block).
maxHeightMaximum height of the dynamic array. The maximal capacity of this array will be width * maxHeight.
initialCapacityinitial number of allocated rows.

Member Function Documentation

template<typename dataType>
dataType* F4::DynamicArray< dataType >::getBegin ( )

Get an iterator to the beginning of the array.

Returns
Pointer on a cell of the dynamic array.
template<typename dataType>
dataType* F4::DynamicArray< dataType >::getNext ( dataType *  data)

Get an iterator to next data after data.

Parameters
dataPointer on a cell of the dynamic array.
Returns
Pointer on a cell of the dynamic array.
template<typename dataType>
dataType& F4::DynamicArray< dataType >::operator[] ( int  index)

Overload the operator [].

Returns
Reference on a cell of the dynamic array.
template<typename dataType>
dataType const& F4::DynamicArray< dataType >::operator[] ( int  index) const

Overload the operator [].

Returns
Reference on a cell of the dynamic array.

Member Data Documentation

template<typename dataType>
dataType** F4::DynamicArray< dataType >::_array
private

2 dimensionnal array

Definition at line 142 of file dynamic-array.h.

template<typename dataType>
int F4::DynamicArray< dataType >::_colIt
private

Column iterator

Definition at line 140 of file dynamic-array.h.

template<typename dataType>
int F4::DynamicArray< dataType >::_currentHeight
private

Number of allocated rows in the 2D array

Definition at line 138 of file dynamic-array.h.

template<typename dataType>
int F4::DynamicArray< dataType >::_maxHeight
private

Maximum height of the 2D array

Definition at line 137 of file dynamic-array.h.

template<typename dataType>
int F4::DynamicArray< dataType >::_rowIt
private

Row iterator

Definition at line 141 of file dynamic-array.h.

template<typename dataType>
int F4::DynamicArray< dataType >::_width
private

Width of the 2D array

Definition at line 136 of file dynamic-array.h.


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