Acoustic Research Tool (ART)  v0.10
ARTfrqGridFunc Class Reference
Inheritance diagram for ARTfrqGridFunc:
ARTfunctionoid

Public Member Functions

 ARTfrqGridFunc (ARTdataContainer *lowfrq, ARTdataContainer *highfrq, ARTdataContainer *frqStep)
virtual bool IsSameFunctionoid (ARTfunctionoid *f)
 Given a pointer of type ARTfunctionoid (or subtypes), the functionoid needs to decide if the pointer represents the same function.
virtual void ApplyFunction ()
 Every functionoid must provide a function to calculate the value of its output data container.
virtual int GetIterationNumber ()
 This function should determine the number of iterations as exactly as possible according to the current state of all dependencies so that the evaluation cost of this data container can be estimated. (The user should take care to keep data containers like frequency grids or other determining the number of iterations valid before estimating the evaluation cost!) This number should be exactly the same as the number of times the function ARTdataContainer::progressIndicator.Continue is called in the functionoid's applyFunction.
- Public Member Functions inherited from ARTfunctionoid
virtual void SetDependencies ()
 Every functionoid must register with data containers, on which its output value depends. override only if special dependencies have to be established.
void SetOutput (ARTdataContainer *out)
 The dataContainer, to which this functionoid is passed as an argument in the constructor, automatically sets the pointer out_ on itself.

Additional Inherited Members

- Protected Attributes inherited from ARTfunctionoid
ARTdataContainerout_
vector< ARTdataContainer * > in_
 set by SetOutput() in constructor of data container

Member Function Documentation

void ARTfrqGridFunc::ApplyFunction ( )
virtual

Every functionoid must provide a function to calculate the value of its output data container.

The calculation takes place in this very function. Note that you have to call ARTdataContainer::progressIndicator.Continue() frequently to communicate the status of calculation to the user and to check if the user wishes to abort. If you are using a loop in your function, call the function in every iteration. Note that the number of times this function is called here must be exactly the same number returned by GetIterationNumber for evaluation cost estimation to work correctly. Your loop could look somewhat like this:

bool carryon = true;
for (f=fmin + fstep*(fmin==0.0), j = 0; (j<flen) && carryon; f+=fstep, j++)
{
carryon = ARTdataContainer::progressIndicator.Continue(out_->GetComplexity(),out_->GetVarName());
...
}

Implements ARTfunctionoid.