VariableIterator Class Reference

#include <func.h>

Inheritance diagram for VariableIterator:

Inheritance graph
[legend]
Collaboration diagram for VariableIterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VariableIterator (const Func &f_, bool linear_=true, bool nonlinear_=true, bool quadratic_=false)
 VariableIterator (const SparsityInfo &sparsity_, bool linear_=true, bool nonlinear_=true, bool quadratic_=false)
virtual int operator() () const
 Returns the index of the current variable.
virtual double coeff_lin () const
 Returns the coefficient in the linear part of this variable, if available.
virtual double coeff_quad () const
 Returns the coefficient in the quadratic part of this variable, if available.
virtual VarType type () const
 The type of the current variable.
virtual void operator++ ()
 Moves to next variable.
virtual operator bool () const
 Returns true, if we are not at the end of the variables.

Private Member Functions

void init ()

Private Attributes

const SparsityInfosparsity
map< int, SparsityInfo::LinearVariable
>::iterator 
it_linear
map< int, SparsityInfo::NonlinearVariable
>::iterator 
it_nonlinear
map< int, SparsityInfo::QuadraticVariable
>::iterator 
it_quadratic
VarType whereami
 Over which variable type am I just iterating?

Detailed Description

Definition at line 186 of file func.h.


Constructor & Destructor Documentation

VariableIterator::VariableIterator ( const Func f_,
bool  linear_ = true,
bool  nonlinear_ = true,
bool  quadratic_ = false 
)

VariableIterator::VariableIterator ( const SparsityInfo sparsity_,
bool  linear_ = true,
bool  nonlinear_ = true,
bool  quadratic_ = false 
)


Member Function Documentation

void VariableIterator::init (  )  [private]

virtual int VariableIterator::operator() (  )  const [virtual]

Returns the index of the current variable.

Implements VariableIterator_Type.

virtual double VariableIterator::coeff_lin (  )  const [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.

Implements VariableIterator_Type.

virtual double VariableIterator::coeff_quad (  )  const [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.

Implements VariableIterator_Type.

virtual VarType VariableIterator::type (  )  const [inline, virtual]

The type of the current variable.

Implements VariableIterator_Type.

Definition at line 206 of file func.h.

References whereami.

virtual void VariableIterator::operator++ (  )  [virtual]

Moves to next variable.

Implements VariableIterator_Type.

virtual VariableIterator::operator bool (  )  const [inline, virtual]

Returns true, if we are not at the end of the variables.

Implements VariableIterator_Type.

Definition at line 210 of file func.h.

References VariableIterator_Type::END, and whereami.


Member Data Documentation

const SparsityInfo& VariableIterator::sparsity [private]

Definition at line 188 of file func.h.

map<int, SparsityInfo::LinearVariable>::iterator VariableIterator::it_linear [private]

Definition at line 189 of file func.h.

map<int, SparsityInfo::NonlinearVariable>::iterator VariableIterator::it_nonlinear [private]

Definition at line 190 of file func.h.

map<int, SparsityInfo::QuadraticVariable>::iterator VariableIterator::it_quadratic [private]

Definition at line 191 of file func.h.

VarType VariableIterator::whereami [private]

Over which variable type am I just iterating?

Definition at line 194 of file func.h.

Referenced by operator bool(), and type().


The documentation for this class was generated from the following file:
Generated on Tue Oct 21 03:12:44 2008 for LaGO by  doxygen 1.4.7