classPiiMathematicalFunction
#include <PiiMathematicalFunction.h>
An operation that applies a mathematical function to its input.
Inherits PiiDefaultOperation
Description
Inputs
Outputs
Properties
|
The function to apply. |
Public types
|
enum
|
{ NoFunction, Abs, Log, Sqrt, Square, Sin, Cos, Tan, Var, Std, Mean
}
Supported mathematical functions. |
Constructors and destructor
Public member functions
|
( )
|
|
|
void
|
|
Protected member functions
|
virtual void
|
( )
Executes one round of processing. |
Property details
-
Function function
[read, write]The function to apply.
The default value is
NoFunction.
Enumeration details
-
enum Function
Supported mathematical functions.
-
NoFunction- just pass the input object
-
Abs- absolute value. Output type equals input type for all but complex numbers. -
Log- natural logarithm. Output type isdouble. Complex numbers cause run-time exception. -
Sqrt- square root. Output type isdouble. Complex numbers cause run-time exception. -
Square- square. Output type equals input type. Beware of overflows! -
Sin- sine of angle. Output type isdoubleexcept forfloatinput, for which it isfloat. Complex numbers cause run-time exception. -
Cos- cosine of angle. Output type isdoubleexcept forfloatinput, for which it isfloat. Complex numbers cause run-time exception. -
Tan- tangent of angle. Output type isdoubleexcept forfloatinput, for which it isfloat. Complex numbers cause run-time exception.
double. Scalars and complex-valued matrices as input cause run-time exception:-
Var- variance -
Std- standard deviation -
Mean- mean
-
Function details
-
PiiMathematicalFunction
() -
Function function
() -
void setFunction
-
virtual void process
()[protected, virtual]Executes one round of processing.
This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.
Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().
Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns
Running.Exceptions
- PiiExecutionException
-
whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.
Reimplemented from PiiDefaultOperation.
Add a note
Not a single note added yet. Be the first, add yours.