![]() |
TerraLib 4.1
|
A generic matrix template class. More...
#include <TePDIMatrix.hpp>
Classes | |
| class | DiskLinesInfoNode |
| Disk lines info node. More... | |
| class | OpenDiskFilesInfoNode |
| Openend disk files info node. More... | |
Public Types | |
| enum | MemoryPolicy { AutoMemPol, RAMMemPol, DiskMemPol } |
| Memory polycy. More... | |
| typedef TeSharedPtr < TePDIMatrix< ElementType > > | pointer |
Public Member Functions | |
| TePDIMatrix () | |
| TePDIMatrix (const TePDIMatrix< ElementType > &external) | |
| virtual | ~TePDIMatrix () |
| void | Reset () |
| Reset (clear) the active instance data. | |
| void | Reset (MemoryPolicy memoryPolicy) |
| Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters. | |
| bool | Reset (unsigned int lines, unsigned int columns) |
| Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters. | |
| bool | Reset (unsigned int lines, unsigned int columns, MemoryPolicy memoryPolicy) |
| Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters. | |
| bool | Reset (unsigned int lines, unsigned int columns, MemoryPolicy memoryPolicy, unsigned long int maxTmpFileSize, unsigned char maxMemPercentUsage) |
| Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters. | |
| void | clear () |
| Clear all allocated resources and go back to the initial default parameters. | |
| unsigned int | GetLines () const |
| The number of current matrix lines. | |
| unsigned int | GetColumns () const |
| The number of current matrix columns. | |
| bool | IsEmpty () const |
| Empty Matrix verification. | |
| const TePDIMatrix< ElementType > & | operator= (const TePDIMatrix< ElementType > &external) |
| Operator = overload. | |
| ElementType & | operator() (const unsigned int &line, const unsigned int &column) |
| Operator () overload. | |
| const ElementType & | operator() (const unsigned int &line, const unsigned int &column) const |
| Operator () overload. | |
| ElementType * | operator[] (const unsigned int &line) |
| Operator [] overload. | |
| ElementType const * | operator[] (const unsigned int &line) const |
| Operator [] overload. | |
| MemoryPolicy | getMemPolicy () const |
| Returns the current memory policy. | |
| unsigned long int | getMaxTmpFileSize () const |
| Returns the current maximum temporary disk file size. | |
Protected Member Functions | |
| void | init () |
| Reset the internal variables to the initial state. | |
| bool | allocateDiskLines (unsigned int startingLineIdx) |
| Allocate disk lines. | |
| ElementType * | getScanLine (const unsigned int &line) const |
| Returns a pointer to the required line. | |
| bool | createNewDiskFile (unsigned long int size, const std::string &filename, FILE **fileptr) const |
| Create a new disk file. | |
Protected Attributes | |
| unsigned long int | maxTmpFileSize_ |
| Max bytes per temp file (for swapped tiles only, default: 2GB). | |
| unsigned char | maxMemPercentUsage_ |
| the max amount of free memory to use when necessary (default:50). | |
| unsigned int | totalLines_ |
| The total lines number (default:0). | |
| unsigned int | totalColumns_ |
| The total columns number (default:0). | |
| MemoryPolicy | memoryPolicy_ |
| The used memory policy (default:RAMMemPol). | |
| unsigned int | lineSize_ |
| The line size (bytes, default:0). | |
| ElementType ** | allLinesPtrsVec_ |
| A vector with pointers to all lines (size 0 or totalLines_). | |
| OpenDiskFilesInfoNode * | openDiskFilesVec_ |
| A vector with open disk files info (size 0 or openDiskFilesVecSize_). | |
| unsigned int | openDiskFilesVecSize_ |
| A vector with open disk files info. | |
| DiskLinesInfoNode * | diskLinesVec_ |
| Disk lines vector (size 0 or totalLines_). | |
| unsigned int * | ramLinesIndexesVec_ |
| The indexes inside allTilesPtrsVec_ of all RAM lines (size 0 or ramLinesIndexesVecSize_). | |
| unsigned int | ramLinesIndexesVecSize_ |
| The size of ramLinesIndexesVec_;. | |
| unsigned int | nextSwapLineRamLinesIndexesVecIdx_ |
| The index inside ramLinesIndexesVec_ of the next RAM line index that will be swapped to disk when a disk line is required. | |
| ElementType * | swapLinePtr_ |
| A pointer to the auxiliar line used when swapping data to/from disk. | |
A generic matrix template class.
| TeSharedPtr< TePDIMatrix< ElementType > > TePDIMatrix< ElementType >::pointer |
Type definition for a instance pointer
| enum TePDIMatrix::MemoryPolicy |
Memory polycy.
Reimplemented in TePDIMtxDoubleAdpt< T >.
| TePDIMatrix< ElementType >::TePDIMatrix | ( | ) |
| TePDIMatrix< ElementType >::TePDIMatrix | ( | const TePDIMatrix< ElementType > & | external | ) |
| TePDIMatrix< ElementType >::~TePDIMatrix | ( | ) | [virtual] |
| bool TePDIMatrix< ElementType >::allocateDiskLines | ( | unsigned int | startingLineIdx | ) | [protected] |
Allocate disk lines.
| startingLineIdx | Starting line index. |
| void TePDIMatrix< ElementType >::clear | ( | ) |
Clear all allocated resources and go back to the initial default parameters.
| bool TePDIMatrix< ElementType >::createNewDiskFile | ( | unsigned long int | size, |
| const std::string & | filename, | ||
| FILE ** | fileptr | ||
| ) | const [protected] |
Create a new disk file.
| filename | The file name. |
| size | The file size. |
| fileptr | The file pointer. |
| unsigned int TePDIMatrix< ElementType >::GetColumns | ( | ) | const |
The number of current matrix columns.
| unsigned int TePDIMatrix< ElementType >::GetLines | ( | ) | const |
The number of current matrix lines.
| unsigned long int TePDIMatrix< ElementType >::getMaxTmpFileSize | ( | ) | const |
Returns the current maximum temporary disk file size.
| TePDIMatrix< ElementType >::MemoryPolicy TePDIMatrix< ElementType >::getMemPolicy | ( | ) | const |
Returns the current memory policy.
| ElementType * TePDIMatrix< ElementType >::getScanLine | ( | const unsigned int & | line | ) | const [protected] |
Returns a pointer to the required line.
| line | Line number. |
| column | Column number. |
| void TePDIMatrix< ElementType >::init | ( | ) | [protected] |
Reset the internal variables to the initial state.
| bool TePDIMatrix< ElementType >::IsEmpty | ( | ) | const |
Empty Matrix verification.
| ElementType& TePDIMatrix< ElementType >::operator() | ( | const unsigned int & | line, |
| const unsigned int & | column | ||
| ) | [inline] |
Operator () overload.
| line | Line number. |
| column | Column number. |
| const ElementType& TePDIMatrix< ElementType >::operator() | ( | const unsigned int & | line, |
| const unsigned int & | column | ||
| ) | const [inline] |
Operator () overload.
| line | Line number. |
| column | Column number. |
| const TePDIMatrix< ElementType > & TePDIMatrix< ElementType >::operator= | ( | const TePDIMatrix< ElementType > & | external | ) |
Operator = overload.
| external | External instance reference. |
| ElementType* TePDIMatrix< ElementType >::operator[] | ( | const unsigned int & | line | ) | [inline] |
Operator [] overload.
| line | Line number. |
| column | Column number. |
| ElementType const* TePDIMatrix< ElementType >::operator[] | ( | const unsigned int & | line | ) | const [inline] |
Operator [] overload.
| line | Line number. |
| column | Column number. |
| bool TePDIMatrix< ElementType >::Reset | ( | unsigned int | lines, |
| unsigned int | columns | ||
| ) |
Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters.
| lines | Number of lines. |
| columns | Number of columns. |
| void TePDIMatrix< ElementType >::Reset | ( | MemoryPolicy | memoryPolicy | ) |
Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters.
| memoryPolicy | Memory policy. |
| void TePDIMatrix< ElementType >::Reset | ( | ) |
Reset (clear) the active instance data.
| memoryPolicy | Memory policy. |
| bool TePDIMatrix< ElementType >::Reset | ( | unsigned int | lines, |
| unsigned int | columns, | ||
| MemoryPolicy | memoryPolicy, | ||
| unsigned long int | maxTmpFileSize, | ||
| unsigned char | maxMemPercentUsage | ||
| ) |
Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters.
| lines | Number of lines. |
| columns | Number of columns. |
| memoryPolicy | Memory policy. |
| maxTmpFileSize | Max temp file size. |
| maxMemPercentUsage | The max amount of free memory to use when necessary (suggested default:40). |
| bool TePDIMatrix< ElementType >::Reset | ( | unsigned int | lines, |
| unsigned int | columns, | ||
| MemoryPolicy | memoryPolicy | ||
| ) |
Reset (clear) the active instance data and update its internal parameters folowing the the new supplied parameters.
| lines | Number of lines. |
| columns | Number of columns. |
| memoryPolicy | Memory policy. |
ElementType** TePDIMatrix< ElementType >::allLinesPtrsVec_ [protected] |
A vector with pointers to all lines (size 0 or totalLines_).
DiskLinesInfoNode* TePDIMatrix< ElementType >::diskLinesVec_ [protected] |
Disk lines vector (size 0 or totalLines_).
unsigned int TePDIMatrix< ElementType >::lineSize_ [protected] |
The line size (bytes, default:0).
unsigned char TePDIMatrix< ElementType >::maxMemPercentUsage_ [protected] |
the max amount of free memory to use when necessary (default:50).
unsigned long int TePDIMatrix< ElementType >::maxTmpFileSize_ [protected] |
Max bytes per temp file (for swapped tiles only, default: 2GB).
MemoryPolicy TePDIMatrix< ElementType >::memoryPolicy_ [protected] |
The used memory policy (default:RAMMemPol).
unsigned int TePDIMatrix< ElementType >::nextSwapLineRamLinesIndexesVecIdx_ [mutable, protected] |
The index inside ramLinesIndexesVec_ of the next RAM line index that will be swapped to disk when a disk line is required.
OpenDiskFilesInfoNode* TePDIMatrix< ElementType >::openDiskFilesVec_ [protected] |
A vector with open disk files info (size 0 or openDiskFilesVecSize_).
unsigned int TePDIMatrix< ElementType >::openDiskFilesVecSize_ [protected] |
A vector with open disk files info.
unsigned int* TePDIMatrix< ElementType >::ramLinesIndexesVec_ [protected] |
The indexes inside allTilesPtrsVec_ of all RAM lines (size 0 or ramLinesIndexesVecSize_).
unsigned int TePDIMatrix< ElementType >::ramLinesIndexesVecSize_ [protected] |
The size of ramLinesIndexesVec_;.
ElementType* TePDIMatrix< ElementType >::swapLinePtr_ [mutable, protected] |
A pointer to the auxiliar line used when swapping data to/from disk.
unsigned int TePDIMatrix< ElementType >::totalColumns_ [protected] |
The total columns number (default:0).
unsigned int TePDIMatrix< ElementType >::totalLines_ [protected] |
The total lines number (default:0).