COPASI API  4.16.103
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
CVectorCore< CType > Class Template Reference

#include <CVector.h>

Inheritance diagram for CVectorCore< CType >:
Inheritance graph
[legend]
Collaboration diagram for CVectorCore< CType >:
Collaboration graph
[legend]

Public Types

typedef CType elementType
 

Public Member Functions

bool applyPivot (const CVectorCore< size_t > &pivot)
 
CType * array ()
 
const CType * array () const
 
 CVectorCore (const size_t &size=0, CType *vector=NULL)
 
 CVectorCore (const CVectorCore< CType > &src)
 
CType & operator() (const size_t &row)
 
const CType & operator() (const size_t &row) const
 
CVectorCore< CType > & operator= (const CType &value)
 
CType & operator[] (const size_t &row)
 
const CType & operator[] (const size_t &row) const
 
size_t size () const
 
 ~CVectorCore ()
 

Protected Attributes

size_t mSize
 
CType * mVector
 

Friends

std::ostream & operator<< (std::ostream &os, const CVectorCore< CType > &A)
 

Detailed Description

template<typename CType>
class CVectorCore< CType >

Definition at line 29 of file CVector.h.

Member Typedef Documentation

template<typename CType>
typedef CType CVectorCore< CType >::elementType

Definition at line 37 of file CVector.h.

Constructor & Destructor Documentation

template<typename CType>
CVectorCore< CType >::CVectorCore ( const size_t &  size = 0,
CType *  vector = NULL 
)
inline

Specific constructor

Parameters
constsize_t & size (default: 0)
CType* vector (default: NULL)

Definition at line 58 of file CVector.h.

59  :
60  mSize(size),
61  mVector(vector)
62  {}
CType * mVector
Definition: CVector.h:49
size_t mSize
Definition: CVector.h:44
size_t size() const
Definition: CVector.h:100
template<typename CType>
CVectorCore< CType >::CVectorCore ( const CVectorCore< CType > &  src)
inline

Copy constructor

Parameters
constCVectorCore< CType > & src

Definition at line 68 of file CVector.h.

68  :
69  mSize(src.mSize),
70  mVector(src.mVector)
71  {}
CType * mVector
Definition: CVector.h:49
size_t mSize
Definition: CVector.h:44
template<typename CType>
CVectorCore< CType >::~CVectorCore ( )
inline

Destructor.

Definition at line 76 of file CVector.h.

77  {}

Member Function Documentation

template<typename CType>
bool CVectorCore< CType >::applyPivot ( const CVectorCore< size_t > &  pivot)
inline

Reorder the elements according to the provided pivots

Parameters
constCVectorCore<size_t> & pivot
Returns
bool success

Definition at line 172 of file CVector.h.

Referenced by CExperiment::read(), and CEigen::stabilityAnalysis().

173  {
174  if (pivot.size() != mSize) return false;
175 
176  bool * pApplied = new bool[mSize];
177  CVectorCore < bool > Applied(mSize, pApplied);
178 
179  Applied = false;
180  CType tmp;
181 
182  size_t i;
183  size_t to;
184  size_t from;
185 
186  for (i = 0; i < mSize; i++)
187  if (!Applied[i])
188  {
189  to = i;
190  from = pivot[i];
191 
192  if (to != from)
193  {
194  tmp = mVector[i];
195 
196  while (from != i)
197  {
198  mVector[to] = mVector[from];
199  Applied[to] = true;
200 
201  to = from;
202  from = pivot[to];
203  }
204 
205  mVector[to] = tmp;
206  }
207 
208  Applied[to] = true;
209  }
210 
211  delete [] pApplied;
212 
213  return true;
214  }
CType * mVector
Definition: CVector.h:49
size_t mSize
Definition: CVector.h:44
size_t size() const
Definition: CVector.h:100
template<typename CType>
CType* CVectorCore< CType >::array ( )
inline

Retrieve the array of the vector elements. This is suitable for interfacing with clapack routines.

Returns
CType * array

Definition at line 139 of file CVector.h.

Referenced by CMathContainer::allocate(), CLinkMatrix::applyColumnPivot(), CMathContainer::applyInitialValues(), CHistoCurveData::boundingRect(), CLinkMatrix::build(), CSSAMethod::buildExtremeCurrents(), CBitPatternTreeMethod::buildFluxModes(), CBitPatternMethod::buildFluxModes(), CModel::buildRedStoi(), CModel::buildUserOrder(), CEigen::calcEigenValues(), CLyapWolfMethod::calculate(), CFitProblem::calculate(), CStochDirectMethod::calculateAmu(), CTrajAdaptiveSA::calculateAmu(), CTauLeapMethod::calculateAmu(), CTrajectoryMethodDsaLsodar::calculateAmu(), CLNAMethod::calculateCovarianceMatrixReduced(), CFitProblem::calculateCrossValidation(), CModel::calculateDerivatives(), CNewtonMethod::calculateDerivativesX(), CModel::calculateDerivativesX(), CModel::calculateJacobian(), CModel::calculateJacobianX(), CBitPatternMethod::CalculateKernel(), CBitPatternTreeMethod::CalculateKernel(), CTrajectoryMethodDsaLsodar::calculatePropensities(), CMathModel::calculateRootDerivatives(), CMathModel::calculateRootJacobian(), CExperimentSet::calculateStatistics(), CFitProblem::calculateStatistics(), CMCAMethod::calculateUnscaledConcentrationCC(), CMCAMethod::calculateUnscaledElasticities(), CExperiment::calculateWeights(), CExperiment::CExperiment(), CFluxScore::CFluxScore(), CMCAMethod::checkSummationTheorems(), CLinkMatrix::clearPivoting(), CMathContainer::CMathContainer(), CMathModel::compile(), CTimeSeries::compile(), CExperimentSet::compile(), CopasiPlot::compile(), CMathContainer::compileEvents(), CMathContainer::compileObjects(), CLinkMatrix::completePivotInformation(), CMathReaction::copy(), CVector< CProcessReportItem * >::copy(), CPermutation::CPermutation(), COptMethodPS::create(), CMathContainer::createApplyInitialValuesSequence(), CMathContainer::createDependencyGraphs(), CLsodaMethod::createRootMask(), CMathContainer::createSynchronizeInitialValuesSequence(), CMathContainer::createUpdateSimulationValuesSequence(), COptMethodSRES::creation(), CStepMatrix::CStepMatrix(), CMathModel::determineInitialRoots(), CTrajectoryMethodDsaLsodar::CPartition::determineStochasticSpecies(), CILDMMethod::deuflhard(), CILDMModifiedMethod::deuflhard_metab(), CHybridMethodODE45::doInverseInterpolation(), CNewtonMethod::doNewtonStep(), CTrajAdaptiveSA::doSingleSSAStep(), CStochDirectMethod::doSingleStep(), CTauLeapMethod::doSingleStep(), CTrajectoryMethodDsaLsodar::doSingleStep(), CTrajAdaptiveSA::doSingleTauLeapStep(), CLyapWolfMethod::evalF(), CTrajectoryMethodDsaLsodar::evalF(), CMathModel::evaluateRoots(), CMathContainer::fetchInitialState(), CMathContainer::fetchState(), CProgressBar::finish(), CMathReaction::fire(), CTrajectoryMethodDsaLsodar::fireReaction(), CStepMatrixColumn::getAllUnsetBitIndexes(), CStepMatrix::getAllUnsetBitIndexes(), CBitPatternMethod::getAllUnsetBitIndexes(), CMathContainer::getInitialValuePointer(), CMathContainer::getMathObject(), CStepMatrix::getUnsetBitIndexes(), CBitPatternTreeMethod::getUnsetBitIndexes(), CBitPatternMethod::getUnsetBitIndexes(), CKeyFactory::HashTable::HashTable(), COptMethodLevenbergMarquardt::hessian(), CPermutation::init(), CMathContainer::init(), CExperiment::initExtendedTimeSeries(), CopasiPlot::initFromSpec(), CMathReaction::initialize(), CLyapTask::initialize(), CSteadyStateTask::initialize(), CTSSAMethod::initializeAtol(), CModel::initializeAtolVector(), CMathContainer::initializeDiscontinuousCreationPointer(), CMathContainer::initializeEvents(), CMathContainer::initializePointers(), CExperiment::initializeScalingMatrix(), CLyapTask::initObjects(), CHybridMethodLSODA::integrateDeterministicPart(), CHybridMethodODE45::integrateDeterministicPart(), CTSSAMethod::integrationStep(), CLsodaMethod::maskRoots(), COptMethodPS::move(), COptMethodSRES::mutate(), CILDMMethod::newton(), CILDMModifiedMethod::newton_for_timestep(), CILDMModifiedMethod::newton_new(), CZeroSet::operator&=(), CFluxScore::operator<(), operator<<(), CZeroSet::operator==(), CZeroSet::operator>=(), CZeroSet::operator|=(), COptMethodPS::optimise(), COptMethodLevenbergMarquardt::optimise(), COptMethodPraxis::optimise(), COptMethodTruncatedNewton::optimise(), COptMethodHGASA::optimise(), CLyapWolfMethod::orthonormalize(), partialSortWithPivot(), CLsodaMethod::peekAhead(), CBitPatternMethod::performRankTest(), CPermutation::pick(), CMathModel::processRoots(), CMathContainer::pushInitialState(), CMathContainer::pushState(), COptMethodPS::reachedStdDeviation(), CExperiment::read(), C2DCurveData::reallocated(), CBandedGraphData::reallocated(), CHistoCurveData::reallocated(), CStateTemplate::reorder(), CopasiPlot::resizeCurveData(), COptProblem::restoreModel(), CProcessQueue::rootsFound(), CopasiPlot::saveData(), CTSSAMethod::schur(), CTSSAMethod::schur_desc(), COptMethodEP::select(), COptMethodGA::select(), CMathContainer::setInitialState(), CMathContainer::setState(), CMathContainer::setStateReduced(), CMathEvent::setTargetValues(), CStateTemplate::setUserOrder(), CModelParameterCompartment::setValue(), CPermutation::shuffle(), CNewtonMethod::solveJacobianXeqB(), sortWithPivot(), CEigen::stabilityAnalysis(), CLyapWolfMethod::start(), CTrajAdaptiveSA::start(), CLsodaMethod::start(), CLsodaMethod::stateChanged(), CILDMModifiedMethod::step(), CCSPMethod::step(), CLyapWolfMethod::step(), CLsodaMethod::step(), CExperiment::storeExtendedTimeSeriesData(), CExperiment::sumOfSquares(), CExperiment::sumOfSquaresStore(), CTSSAMethod::sylvester(), CNewtonMethod::targetFunction(), CopasiPlot::updateCurves(), CSteadyStateTask::updateMatrices(), CModel::updateSimulatedValues(), and CTauLeapMethod::updateSystem().

139 {return mVector;}
CType * mVector
Definition: CVector.h:49
template<typename CType>
const CType* CVectorCore< CType >::array ( ) const
inline

Retrieve the array of the vector elements. This is suitable for interfacing with clapack routines.

Returns
const CType * array

Definition at line 146 of file CVector.h.

146 {return mVector;}
CType * mVector
Definition: CVector.h:49
template<typename CType>
CType& CVectorCore< CType >::operator() ( const size_t &  row)
inline

Retrieve a vector element using Fortan style indexing.

Parameters
constsize_t & row
Returns
const CType & element

Definition at line 123 of file CVector.h.

124  {return *(mVector + (row - 1));}
CType * mVector
Definition: CVector.h:49
template<typename CType>
const CType& CVectorCore< CType >::operator() ( const size_t &  row) const
inline

Retrieve a vector element using Fortan style indexing.

Parameters
constsize_t & row
Returns
const CType & element

Definition at line 131 of file CVector.h.

132  {return *(mVector + (row - 1));}
CType * mVector
Definition: CVector.h:49
template<typename CType>
CVectorCore< CType>& CVectorCore< CType >::operator= ( const CType &  value)
inline

Assignment operator

Parameters
constCType & value

Definition at line 83 of file CVector.h.

84  {
85  size_t i;
86  CType * tmp = mVector;
87 
88  for (i = 0; i < mSize; i++, tmp++)
89  {
90  *tmp = value;
91  }
92 
93  return *this;
94  }
CType * mVector
Definition: CVector.h:49
size_t mSize
Definition: CVector.h:44
template<typename CType>
CType& CVectorCore< CType >::operator[] ( const size_t &  row)
inline

Retrieve an element of the vector

Parameters
constsize_t & row
Returns
CType & element

Definition at line 107 of file CVector.h.

108  {return *(mVector + row);}
CType * mVector
Definition: CVector.h:49
template<typename CType>
const CType& CVectorCore< CType >::operator[] ( const size_t &  row) const
inline

Retrieve an element of the vector

Parameters
constsize_t & row
Returns
const CType & element

Definition at line 115 of file CVector.h.

116  {return *(mVector + row);}
CType * mVector
Definition: CVector.h:49
template<typename CType>
size_t CVectorCore< CType >::size ( ) const
inline

The number of elements stored in the vector.

Returns
size_t size

Definition at line 100 of file CVector.h.

Referenced by CProcessReport::addItem(), CMathContainer::allocate(), CLinkMatrix::applyColumnPivot(), applyPartialPivot(), CVectorCore< CProcessReportItem * >::applyPivot(), applyPivot(), CMatrix< CFitConstraint * >::applyPivot(), CLinkMatrix::applyRowPivot(), CSSAMethod::buildExtremeCurrents(), CBitPatternTreeMethod::buildFluxModes(), CBitPatternMethod::buildFluxModes(), CModel::buildUserOrder(), CLyapWolfMethod::calculate(), CFitProblem::calculate(), CStochDirectMethod::calculateAmu(), CTrajAdaptiveSA::calculateAmu(), CTauLeapMethod::calculateAmu(), CTrajectoryMethodDsaLsodar::calculateAmu(), CFitProblem::calculateCrossValidation(), CMathModel::calculateRootDerivatives(), CMathModel::calculateRootJacobian(), CExperimentSet::calculateStatistics(), CFitProblem::calculateStatistics(), COptProblem::calculateStatistics(), CExperiment::calculateWeights(), CBandedGraphData::CBandedGraphData(), CQTSSATimeScaleWidget::changedInterval(), CLinkMatrix::clearPivoting(), CMathContainer::CMathContainer(), CTimeSeries::compile(), CExperimentSet::compile(), CopasiPlot::compile(), CMathContainer::compileObjects(), CLinkMatrix::completePivotInformation(), CMathReaction::copy(), CVector< CProcessReportItem * >::copy(), CPermutation::CPermutation(), CMathContainer::createApplyInitialValuesSequence(), CMathContainer::createDependencyGraphs(), CLsodaMethod::createRootMask(), CVector< CProcessReportItem * >::CVector(), CMathModel::determineInitialRoots(), CSSAMethod::diag(), CNewtonMethod::doNewtonStep(), CTrajAdaptiveSA::doSingleSSAStep(), CStochDirectMethod::doSingleStep(), CTrajAdaptiveSA::doSingleTauLeapStep(), CQFittingResult::enterProtected(), CTrajectoryMethodDsaLsodar::evalF(), CLsodaMethod::evalR(), CMathModel::evaluateRoots(), CMathContainer::fetchInitialState(), CMathContainer::fetchState(), CProgressBar::finish(), CProcessReport::finish(), CMathReaction::fire(), CTrajectoryMethodDsaLsodar::fireReaction(), CStepMatrix::getAllUnsetBitIndexes(), CBitPatternMethod::getAllUnsetBitIndexes(), CMathContainer::getInitialValuePointer(), CMathContainer::getMathObject(), CZeroSet::getNumberOfBits(), CZeroSet::getNumberOfUnsetBits(), CMathModel::getNumRoots(), CStepMatrix::getUnsetBitIndexes(), CBitPatternTreeMethod::getUnsetBitIndexes(), CBitPatternMethod::getUnsetBitIndexes(), COptMethodLevenbergMarquardt::hessian(), CPermutation::init(), CMathContainer::init(), CMathReaction::initialize(), COptMethodLevenbergMarquardt::initialize(), CFitProblem::initialize(), CSteadyStateTask::initialize(), CTSSAMethod::initializeAtol(), CModel::initializeAtolVector(), CMathContainer::initializeDiscontinuousCreationPointer(), CMathContainer::initializeEvents(), CMathContainer::initializeObjects(), CExperiment::initializeScalingMatrix(), CHybridMethodLSODA::integrateDeterministicPart(), CTSSAMethod::integrationStep(), CProcessReport::isValidHandle(), CLinkMatrix::leftMultiply(), StateSubwidget::loadJacobian(), CQUpdatesWidget::loadObjectsTable(), LUfactor(), CLsodaMethod::maskRoots(), CPermutation::next(), CZeroSet::operator&=(), CFluxScore::operator<(), operator<<(), CZeroSet::operator==(), CZeroSet::operator>=(), CZeroSet::operator|=(), PaintWidget::paintEvent(), CQTSSATimeScaleWidget::paintTimeScale(), CLsodaMethod::peekAhead(), CBitPatternMethod::performRankTest(), CPermutation::pick(), CFitProblem::printResult(), COptProblem::printResult(), CExperiment::printResult(), CSteadyStateTask::process(), CMathModel::processRoots(), CProcessReport::progress(), CMathContainer::pushInitialState(), CMathContainer::pushState(), CExperiment::read(), C2DCurveData::reallocated(), CBandedGraphData::reallocated(), CHistoCurveData::reallocated(), CStateTemplate::reorder(), CProcessReport::reset(), CVector< CProcessReportItem * >::resize(), CopasiPlot::resizeCurveData(), CExperiment::restoreModelIndependentData(), CLinkMatrix::rightMultiply(), CProcessQueue::rootsFound(), CopasiPlot::saveData(), CILDMMethod::setAnnotationM(), CMathContainer::setInitialState(), CFitProblem::setResidualsRequired(), CMathContainer::setState(), CMathContainer::setStateReduced(), CStateTemplate::setUserOrder(), CMathContainer::setValues(), CILDMMethod::setVectors(), CCSPMethod::setVectors(), CPermutation::shuffle(), CHistoCurveData::size(), CProgressBar::slotAddItem(), CProgressBar::slotProgressAll(), CQFittingItemWidget::slotReset(), CNewtonMethod::solveJacobianXeqB(), CEigen::stabilityAnalysis(), CLyapWolfMethod::step(), CLsodaMethod::step(), CNewtonMethod::targetFunction(), CSSAMethod::testForMixingStability(), CopasiPlot::updateCurves(), CSteadyStateTask::updateMatrices(), CExperiment::updateModelWithIndependentData(), CProcessReport::~CProcessReport(), and CProgressBar::~CProgressBar().

100 {return mSize;}
size_t mSize
Definition: CVector.h:44

Friends And Related Function Documentation

template<typename CType>
std::ostream& operator<< ( std::ostream &  os,
const CVectorCore< CType > &  A 
)
friend

Output stream operator

Parameters
ostream& os
constCVector< CType > & A
Returns
ostream & os

Definition at line 380 of file CVector.h.

381 {
382  os << "(\t";
383 
384  if (A.mSize)
385  {
386  size_t i;
387  CType * tmp = A.mVector;
388  os << *(tmp++);
389 
390  for (i = 1; i < A.mSize; i++)
391  os << "\t" << *(tmp++);
392  }
393 
394  os << "\t)";
395  return os;
396 }
CType * mVector
Definition: CVector.h:49
size_t mSize
Definition: CVector.h:44

Member Data Documentation

template<typename CType>
size_t CVectorCore< CType >::mSize
protected
template<typename CType>
CType* CVectorCore< CType >::mVector
protected

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