Public Member Functions | |
TempStack () | |
TempStack (int vecSize) | |
void | pushVectorData (const RCP< Array< double > > &vecData) |
RCP< Array< double > > | popVectorData () |
RCP< EvalVector > | popVector () |
void | setVecSize (int vecSize) |
void | resetCounter () |
int | numVecsAccessed () const |
int | numVecsAllocated () const |
int | vecSize () const |
Private Attributes | |
int | vecSize_ |
std::stack< RCP< Array< double > > > | stack_ |
int | numVecsAllocated_ |
int | numVecsAccessed_ |
During the course of evaluating an expression, it is often necessary to create temporary variables. For example, in evaluating
a += b*(c+d)
1. Create a temporary variable t1 2. Evaluate expression b into t1 3. Create a temporary variable t2 4. Evaluate expression c into t2 3. Create a temporary variable t3 4. Evaluate expression d into t3 5. Carry out t2 += t3 6. Carry out t1 *= t2 7. Carry out a += t1
Definition at line 77 of file SundanceTempStack.hpp.
TempStack::TempStack | ( | ) |
Empty ctor
Definition at line 56 of file SundanceTempStack.cpp.
TempStack::TempStack | ( | int | vecSize | ) |
Construct with an initial vector size
Definition at line 48 of file SundanceTempStack.cpp.
int Sundance::TempStack::numVecsAccessed | ( | ) | const [inline] |
int Sundance::TempStack::numVecsAllocated | ( | ) | const [inline] |
RCP<EvalVector> Sundance::TempStack::popVector | ( | ) | [inline] |
Get a new vector (which will often reuse stack data)
Definition at line 93 of file SundanceTempStack.hpp.
Referenced by Sundance::EvalVector::applyUnaryOperator(), Sundance::NonlinearUnaryOpEvaluator::evalArgDerivs(), and Sundance::EvalManager::popVector().
RCP< Array< double > > TempStack::popVectorData | ( | ) |
Pop vector data from the stack
Definition at line 70 of file SundanceTempStack.cpp.
References numVecsAccessed_, numVecsAllocated_, stack_, and vecSize_.
void TempStack::pushVectorData | ( | const RCP< Array< double > > & | vecData | ) |
Push vector data onto the stack
Definition at line 65 of file SundanceTempStack.cpp.
References stack_.
Referenced by Sundance::EvalVector::~EvalVector().
void TempStack::resetCounter | ( | ) |
Definition at line 90 of file SundanceTempStack.cpp.
References numVecsAccessed_, and numVecsAllocated_.
void Sundance::TempStack::setVecSize | ( | int | vecSize | ) | [inline] |
Definition at line 97 of file SundanceTempStack.hpp.
References vecSize_.
Referenced by Sundance::SymbolicFuncElementEvaluator::internalEval(), Sundance::DiscreteFuncElementEvaluator::internalEval(), Sundance::CurveNormEvaluator::internalEval(), Sundance::CoordExprEvaluator::internalEval(), Sundance::CellVectorEvaluator::internalEval(), Sundance::CellDiameterExprEvaluator::internalEval(), and Sundance::EvalManager::setVecSize().
int Sundance::TempStack::vecSize | ( | ) | const [inline] |
Definition at line 109 of file SundanceTempStack.hpp.
References vecSize_.
Referenced by Sundance::EvalVector::EvalVector().
int Sundance::TempStack::numVecsAccessed_ [private] |
Definition at line 119 of file SundanceTempStack.hpp.
Referenced by numVecsAccessed(), popVectorData(), and resetCounter().
int Sundance::TempStack::numVecsAllocated_ [private] |
Definition at line 117 of file SundanceTempStack.hpp.
Referenced by numVecsAllocated(), popVectorData(), and resetCounter().
std::stack<RCP<Array<double> > > Sundance::TempStack::stack_ [private] |
Definition at line 115 of file SundanceTempStack.hpp.
Referenced by popVectorData(), and pushVectorData().
int Sundance::TempStack::vecSize_ [private] |
Definition at line 113 of file SundanceTempStack.hpp.
Referenced by popVectorData(), setVecSize(), and vecSize().