All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
DinverCore::ActiveModels Class Reference

Brief description of class still missing. More...

#include <ActiveModels.h>

Inheritance diagram for DinverCore::ActiveModels:
QGpCoreTools::IncreaseStorage

List of all members.

Public Member Functions

 ActiveModels (ModelSet *allModels)
ActiveModeladd (int modelIndex)
ActiveModeladd (const ActiveModel &m)
ModelSetallModels () const
ActiveModelat (int activeIndex)
const ActiveModelat (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 ()

Detailed Description

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.


Constructor & Destructor Documentation

Description of constructor still missing

References allModels(), and QGpCoreTools::IncreaseStorage::allocateVector().

      : IncreaseStorage(1024)
  {
    _allModels=allModels;
    _infos=static_cast<ActiveModel *>(allocateVector(sizeof(ActiveModel)));
  }

Description of destructor still missing

References TRACE.

  {
    TRACE;
    free(_infos);
  }

Member Function Documentation

ActiveModel & DinverCore::ActiveModels::add ( int  modelIndex) [inline]

References add(), and QGpCoreTools::IncreaseStorage::size().

{
  _infos[size()]=m;
  IncreaseStorage::add();
  return _infos[size()-1]; // reallocate possible with add
}

Referenced by ActiveModels(), and DinverCore::GeneratorModels::GeneratorModels().

{return _allModels;}
ActiveModel& DinverCore::ActiveModels::at ( int  activeIndex) [inline]
const ActiveModel& DinverCore::ActiveModels::at ( int  activeIndex) const [inline]
{return _infos[ activeIndex ];}

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]
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]

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]
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();}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines