Abstract class for an iterator, which iterates over the variables of a function. More...
#include <func.h>
Public Types | |
enum | VarType { LINEAR = 0, NONLINEAR = 1, QUADRATIC = 3, END = 4 } |
Public Member Functions | |
VariableIterator_Type (bool linear_=true, bool nonlinear_=true, bool quadratic_=false) | |
virtual | ~VariableIterator_Type () |
virtual int | operator() () const =0 |
Returns the index of the current variable. | |
virtual double | coeff_lin () const =0 |
Returns the coefficient in the linear part of this variable, if available. | |
virtual double | coeff_quad () const =0 |
Returns the coefficient in the quadratic part of this variable, if available. | |
virtual VarType | type () const =0 |
The type of the current variable. | |
virtual void | operator++ ()=0 |
Moves to next variable. | |
virtual | operator bool () const =0 |
Returns true, if we are not at the end of the variables. | |
Protected Attributes | |
bool | linear |
Indicates, whether we want to iterate over linear variable. | |
bool | nonlinear |
Indicates, whether we want to iterate over nonlinear variables. | |
bool | quadratic |
Indicates, whether we want to iterate over quadratic variables. |
Abstract class for an iterator, which iterates over the variables of a function.
Might iterate only over linear or only quadratic or only nonlinear/nonquadratic... variables.
Definition at line 137 of file func.h.
VariableIterator_Type::VariableIterator_Type | ( | bool | linear_ = true , |
|
bool | nonlinear_ = true , |
|||
bool | quadratic_ = false | |||
) | [inline] |
virtual VariableIterator_Type::~VariableIterator_Type | ( | ) | [inline, virtual] |
virtual int VariableIterator_Type::operator() | ( | ) | const [pure virtual] |
Returns the index of the current variable.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
virtual double VariableIterator_Type::coeff_lin | ( | ) | const [pure virtual] |
Returns the coefficient in the linear part of this variable, if available.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
virtual double VariableIterator_Type::coeff_quad | ( | ) | const [pure virtual] |
Returns the coefficient in the quadratic part of this variable, if available.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
virtual VarType VariableIterator_Type::type | ( | ) | const [pure virtual] |
The type of the current variable.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
virtual void VariableIterator_Type::operator++ | ( | ) | [pure virtual] |
Moves to next variable.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
virtual VariableIterator_Type::operator bool | ( | ) | const [pure virtual] |
Returns true, if we are not at the end of the variables.
Implemented in VariableIterator, and SepQcFunc::VariableIterator.
bool VariableIterator_Type::linear [protected] |
bool VariableIterator_Type::nonlinear [protected] |
bool VariableIterator_Type::quadratic [protected] |