|
Hormiga 1.0
|
#include <function.h>

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 | |
| FunctionInstanceIterator * | nextDimension |
| int | dimensions |
| int | localDimension |
| T_MAGNITUDE * | data |
| Sequence * | seq |
| VarValue * | currVal |
| T_FUNCTION_ARGUMENTS * | args |
| Function * | f |
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.
| FunctionInstanceIterator::FunctionInstanceIterator | ( | Function * | f, |
| T_FUNCTION_ARGUMENTS * | realArgs | ||
| ) |
Definition at line 264 of file function.cpp.


| 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] |
| 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.
Definition at line 208 of file function.cpp.


| 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.


| 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.


| 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.


| 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.
| fi | is the function to eveluate. |
| internalArguments | is the vector of function arguments where the parameters will be instantiated. |
| data | is the pointer to the internal data array that will be returned |
| dimensions | is the count of Sequences writen by user. |
| currentDimension | is 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.


T_FUNCTION_ARGUMENTS* FunctionInstanceIterator::args [protected] |
Definition at line 180 of file function.h.
VarValue* FunctionInstanceIterator::currVal [protected] |
Definition at line 178 of file function.h.
T_MAGNITUDE* FunctionInstanceIterator::data [protected] |
Definition at line 173 of file function.h.
int FunctionInstanceIterator::dimensions [protected] |
Definition at line 170 of file function.h.
Function* FunctionInstanceIterator::f [protected] |
Definition at line 182 of file function.h.
int FunctionInstanceIterator::localDimension [protected] |
Definition at line 172 of file function.h.
Definition at line 169 of file function.h.
Sequence* FunctionInstanceIterator::seq [protected] |
Definition at line 176 of file function.h.