VariableIterator_Type Class Reference

Abstract class for an iterator, which iterates over the variables of a function. More...

#include <func.h>

Inheritance diagram for VariableIterator_Type:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
LINEAR 
NONLINEAR 
QUADRATIC 
END 

Definition at line 151 of file func.h.


Constructor & Destructor Documentation

VariableIterator_Type::VariableIterator_Type ( bool  linear_ = true,
bool  nonlinear_ = true,
bool  quadratic_ = false 
) [inline]

Definition at line 153 of file func.h.

virtual VariableIterator_Type::~VariableIterator_Type (  )  [inline, virtual]

Definition at line 157 of file func.h.


Member Function Documentation

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.

Returns:
If the variable is linear, it returns it's coefficient. If the variable x is quadratic, it returns the coefficient before x.

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.

Returns:
If the variable x is quadratic, it returns the coefficient before x^2.

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.


Member Data Documentation

Indicates, whether we want to iterate over linear variable.

Definition at line 141 of file func.h.

Indicates, whether we want to iterate over nonlinear variables.

Definition at line 144 of file func.h.

Indicates, whether we want to iterate over quadratic variables.

If nonlinear is set to true, the iterator will also iterate over quadratic variables.

Definition at line 148 of file func.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1