ergo
|
a collection of vectors, usually handled at once. More...
#include <slr.h>
Public Member Functions | |
VarVectorCollection (int nSize=0) | |
~VarVectorCollection () | |
void | setSize (int sz) |
VarVector & | operator[] (int i) |
int | size () const |
bool | getDiskMode () const |
void | setDiskMode (bool x) |
void | release () |
Make sure there is space for one vector. | |
void | releaseAll () |
Release all vectors from the memory, saving if necessary. | |
Static Public Attributes | |
static const char * | tmpdir = "/tmp" |
Private Attributes | |
VarVector * | vecs |
unsigned * | ages |
unsigned | currentAge |
int | nVecs |
int | nAllocated |
bool | diskMode |
a collection of vectors, usually handled at once.
LR::VarVectorCollection::VarVectorCollection | ( | int | nSize = 0 | ) | [inline, explicit] |
References setSize().
bool LR::VarVectorCollection::getDiskMode | ( | ) | const [inline] |
References diskMode.
VarVector & LR::VarVectorCollection::operator[] | ( | int | i | ) |
References vecs, release(), LR::VarVector::load(), tmpdir, ages, and currentAge.
void LR::VarVectorCollection::release | ( | ) |
Make sure there is space for one vector.
Must allow at least two vectors at the same time in memory or evil things will happen.
References diskMode, nVecs, vecs, ages, do_output(), LOG_CAT_INFO, LOG_AREA_LR, LR::VarVector::release(), and tmpdir.
Referenced by operator[]().
void LR::VarVectorCollection::releaseAll | ( | ) |
Release all vectors from the memory, saving if necessary.
References diskMode, do_output(), LOG_CAT_INFO, LOG_AREA_LR, nVecs, vecs, LR::VarVector::release(), and tmpdir.
Referenced by LR::LRSolver::addToSpace().
void LR::VarVectorCollection::setDiskMode | ( | bool | x | ) | [inline] |
References diskMode.
Referenced by LR::LRSolver::solve().
void LR::VarVectorCollection::setSize | ( | int | sz | ) |
int LR::VarVectorCollection::size | ( | ) | const [inline] |
References nVecs.
Referenced by LR::LRSolver::addToSpace().
unsigned* LR::VarVectorCollection::ages [private] |
Referenced by ~VarVectorCollection(), setSize(), operator[](), and release().
unsigned LR::VarVectorCollection::currentAge [private] |
Referenced by operator[]().
bool LR::VarVectorCollection::diskMode [private] |
Referenced by release(), releaseAll(), getDiskMode(), and setDiskMode().
int LR::VarVectorCollection::nAllocated [private] |
Referenced by setSize().
int LR::VarVectorCollection::nVecs [private] |
Referenced by setSize(), release(), releaseAll(), and size().
const char * LR::VarVectorCollection::tmpdir = "/tmp" [static] |
Referenced by operator[](), release(), and releaseAll().
VarVector* LR::VarVectorCollection::vecs [private] |
Referenced by ~VarVectorCollection(), setSize(), operator[](), release(), and releaseAll().