Acoustic Research Tool (ART)  v0.10
WaveObjectMMImpedance::ConvertMMImpToImp Class Reference

A functionoid to convert a multimode impedance matrix into a single mode impedance matrix by dropping all modes except the first mode and to write the modes it into a C_ART_ntri data container.

Inheritance diagram for WaveObjectMMImpedance::ConvertMMImpToImp:

Public Member Functions

 ConvertMMImpToImp (ARTdataContainer *impMatrix, ARTdataContainer *frq)
 The constructor to prepare the functionoid's calculation.
virtual void ApplyFunction ()
 Every functionoid must provide a function to calculate the value of its output data container.
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 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
vector< ARTdataContainer * > in_
 set by SetOutput() in constructor of data container

Constructor & Destructor Documentation

WaveObjectMMImpedance::ConvertMMImpToImp::ConvertMMImpToImp ( ARTdataContainer impMatrix,
ARTdataContainer frq 

The constructor to prepare the functionoid's calculation.

impMatrixThe input multimode impedance matrix.
frqThe frequency grid giving the frequency in Hz for every index.

Member Function Documentation

virtual void WaveObjectMMImpedance::ConvertMMImpToImp::ApplyFunction ( )

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.