Brief description of class still missing. More...
#include <ActiveModels.h>
Public Member Functions | |
ActiveModels (ModelSet *allModels) | |
ActiveModel & | add (int modelIndex) |
ActiveModel & | add (const ActiveModel &m) |
ModelSet * | allModels () const |
ActiveModel & | at (int activeIndex) |
const ActiveModel & | at (int activeIndex) const |
void | clear () |
int | count () const |
const double * | misfit (int activeIndex) const |
const int * | model (int activeIndex) const |
int | parameterCount () const |
void | print (int activeIndex) |
void | reserve (int n) |
void | setNavigatorHits (const QVector< int > &activeIndexes) |
int | targetCount () const |
~ActiveModels () |
Brief description of class still missing.
Active model index remains valid during the whole life of this object. Exception is any call to clear() but this is not part of normal inversion run. Inversion is always stopped when clear() is called.
DinverCore::ActiveModels::ActiveModels | ( | ModelSet * | allModels | ) |
Description of constructor still missing
References allModels(), and QGpCoreTools::IncreaseStorage::allocateVector().
: IncreaseStorage(1024) { _allModels=allModels; _infos=static_cast<ActiveModel *>(allocateVector(sizeof(ActiveModel))); }
ActiveModel & DinverCore::ActiveModels::add | ( | int | modelIndex | ) | [inline] |
Reimplemented from QGpCoreTools::IncreaseStorage.
References QGpCoreTools::IncreaseStorage::size().
Referenced by add(), DinverCore::GeneratorModels::add(), DinverCore::Neighborhood::importModels(), and DinverCore::GeneratorModels::removeDeadModels().
{ _infos[size()]=modelIndex; IncreaseStorage::add(); return _infos[size()-1]; // reallocate possible with add }
ActiveModel & DinverCore::ActiveModels::add | ( | const ActiveModel & | m | ) | [inline] |
References add(), and QGpCoreTools::IncreaseStorage::size().
{ _infos[size()]=m; IncreaseStorage::add(); return _infos[size()-1]; // reallocate possible with add }
ModelSet* DinverCore::ActiveModels::allModels | ( | ) | const [inline] |
Referenced by ActiveModels(), and DinverCore::GeneratorModels::GeneratorModels().
{return _allModels;}
ActiveModel& DinverCore::ActiveModels::at | ( | int | activeIndex | ) | [inline] |
Referenced by DinverCore::GeneratorModels::commitStatistics(), DinverCore::ModelRepository::printActiveModels(), DinverCore::GeneratorModels::removeDeadModels(), setNavigatorHits(), and DinverCore::BestModels::update().
{return _infos[ activeIndex ];}
const ActiveModel& DinverCore::ActiveModels::at | ( | int | activeIndex | ) | const [inline] |
{return _infos[ activeIndex ];}
void DinverCore::ActiveModels::clear | ( | ) |
Used only when deleting all models from ensemble. Do not call this function while an inversion is running.
Reimplemented from QGpCoreTools::IncreaseStorage.
References QGpCoreTools::IncreaseStorage::allocateVector().
Referenced by DinverCore::GeneratorModels::clear(), and DinverCore::Neighborhood::clear().
{ free(_infos); IncreaseStorage::clear(); _infos=static_cast<ActiveModel *>(allocateVector(sizeof(ActiveModel))); }
int DinverCore::ActiveModels::count | ( | ) | const [inline] |
Referenced by DinverCore::Neighborhood::activeModelCount(), DinverCore::ModelRepository::activeModelCount(), DinverCore::BestModels::activeModelMap(), DinverCore::GeneratorModels::add(), DinverCore::Neighborhood::importModels(), DinverCore::Neighborhood::optimization(), DinverCore::ModelRepository::printActiveModels(), DinverCore::Neighborhood::random(), DinverCore::GeneratorModels::removeDeadModels(), DinverCore::ScaledModels::ScaledModels(), DinverCore::Neighborhood::setThreadCount(), DinverCore::Neighborhood::setVolumes(), DinverCore::ModelRepository::start(), DinverCore::BestModels::update(), and DinverCore::Neighborhood::validModelCount().
{return IncreaseStorage::size();}
const double * DinverCore::ActiveModels::misfit | ( | int | activeIndex | ) | const [inline] |
References DinverCore::ModelSet::misfit().
Referenced by DinverCore::BestModels::add(), DinverCore::BestModels::remove(), and DinverCore::BestModels::setNr().
{ return _allModels->misfit(_infos[ activeIndex ].modelIndex()); }
const int * DinverCore::ActiveModels::model | ( | int | activeIndex | ) | const [inline] |
References DinverCore::ModelSet::model().
Referenced by DinverCore::ModelRepository::createModel(), DinverCore::Neighborhood::optimization(), and DinverCore::ScaledModels::ScaledModels().
{ return _allModels->model(_infos[ activeIndex ].modelIndex()); }
int DinverCore::ActiveModels::parameterCount | ( | ) | const [inline] |
Referenced by DinverCore::ScaledModels::ScaledModels().
{return _allModels->parameterCount();}
void DinverCore::ActiveModels::print | ( | int | activeIndex | ) |
References DinverCore::ModelSet::print().
Referenced by DinverCore::BestModels::print().
{ printf("Active index %5i: ", activeIndex); _allModels->print(_infos[ activeIndex ].modelIndex()); }
void DinverCore::ActiveModels::reserve | ( | int | n | ) | [inline] |
Reimplemented from QGpCoreTools::IncreaseStorage.
Referenced by DinverCore::Neighborhood::optimization().
{IncreaseStorage::reserve(n);}
void DinverCore::ActiveModels::setNavigatorHits | ( | const QVector< int > & | activeIndexes | ) |
References at(), DinverCore::ModelSet::count(), and DinverCore::ActiveModel::setNavigatorHit().
Referenced by DinverCore::GeneratorModels::commitStatistics().
{ int n=_allModels->count(); // Some sort of timing reference (number of model generated so far) for(QVector<int>::const_iterator it=activeIndexes.begin(); it!=activeIndexes.end(); it++) { at(*it).setNavigatorHit(n); } }
int DinverCore::ActiveModels::targetCount | ( | ) | const [inline] |
Referenced by DinverCore::BestModels::add().
{return _allModels->targetCount();}