Hormiga 1.0

FunctionInstanceIterator Class Reference

#include <function.h>

Collaboration diagram for FunctionInstanceIterator:

List of all members.

Public Member Functions

const T_MAGNITUDE * first ()
const T_MAGNITUDE * next ()
const T_MAGNITUDE * getCurrent ()
int dimesionsCount () const
int iterationsCount () const
 FunctionInstanceIterator (Function *f, T_FUNCTION_ARGUMENTS *realArgs)
 ~FunctionInstanceIterator ()

Protected Member Functions

void setup (Function *f, T_FUNCTION_ARGUMENTS *internalArguments, T_MAGNITUDE *data, int dimensions, int currentDimension)
 FunctionInstanceIterator (Function *f, T_FUNCTION_ARGUMENTS *internalArguments, T_MAGNITUDE *data, int dimensions, int currentDimension)
bool hasNext ()

Protected Attributes

FunctionInstanceIteratornextDimension
int dimensions
int localDimension
T_MAGNITUDE * data
Sequenceseq
VarValuecurrVal
T_FUNCTION_ARGUMENTS * args
Functionf

Detailed Description

This class provide a multidimensional iterator that gives all values that a function can take, each one at a time. It allows ploters to get coordinates and its values.

Definition at line 107 of file function.h.


Constructor & Destructor Documentation

FunctionInstanceIterator::FunctionInstanceIterator ( Function f,
T_FUNCTION_ARGUMENTS *  realArgs 
)

Definition at line 264 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

FunctionInstanceIterator::~FunctionInstanceIterator ( )

Definition at line 330 of file function.cpp.

FunctionInstanceIterator::FunctionInstanceIterator ( Function f,
T_FUNCTION_ARGUMENTS *  internalArguments,
T_MAGNITUDE *  data,
int  dimensions,
int  currentDimension 
) [protected]

see setup()

Definition at line 284 of file function.cpp.

Here is the call graph for this function:


Member Function Documentation

int FunctionInstanceIterator::dimesionsCount ( ) const [inline]

Returns the count of functions parameters that are 'Sequence'. Over this parameters the function will iterate.

Definition at line 132 of file function.h.

const T_MAGNITUDE * FunctionInstanceIterator::first ( )

Puts Iterator at begin of function iteration, calculate this value and returns it. If the function doesn't has Sequences, evaluate its parameters.

FunctionInstanceIterator

Definition at line 208 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const T_MAGNITUDE * FunctionInstanceIterator::getCurrent ( )

Returns the current data. Data is an T_MAGNITUDE array of size dimesionsCount() + 1 . The last value is the value of evaluate the function in a point. The first ones are the multidimensional point (coordinate). A 1D function iterator (1 Sequence function parameter) returns an array long 2 ( value of x and value of f(x) ). It's an internal array, don't delete it !!

Definition at line 246 of file function.cpp.

bool FunctionInstanceIterator::hasNext ( ) [protected]

Definition at line 220 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int FunctionInstanceIterator::iterationsCount ( ) const

Return the number of iterations (calls to next() method) needed to get all values.

Definition at line 252 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const T_MAGNITUDE * FunctionInstanceIterator::next ( )

Step up the iterator one position, calculate the value of the function at this point and returns it. If hasNext() is not posible, returns NULL.

Definition at line 230 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FunctionInstanceIterator::setup ( Function f,
T_FUNCTION_ARGUMENTS *  internalArguments,
T_MAGNITUDE *  data,
int  dimensions,
int  currentDimension 
) [protected]

Internal constructor called by master iterator (the one that the users see) used to make the iterators struct.

Parameters:
fiis the function to eveluate.
internalArgumentsis the vector of function arguments where the parameters will be instantiated.
datais the pointer to the internal data array that will be returned
dimensionsis the count of Sequences writen by user.
currentDimensionis the count of 'used dimensions'. That means: how much FunctionInstanceIterator are parents of this, and indicate what data vector's position will be managed by it instance.

Definition at line 294 of file function.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

T_FUNCTION_ARGUMENTS* FunctionInstanceIterator::args [protected]

Definition at line 180 of file function.h.

Definition at line 178 of file function.h.

T_MAGNITUDE* FunctionInstanceIterator::data [protected]

Definition at line 173 of file function.h.

Definition at line 170 of file function.h.

Definition at line 182 of file function.h.

Definition at line 172 of file function.h.

Definition at line 176 of file function.h.


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