Basic adders, subtracters, multipliers, and amplifiers, for all the standard scalar data types (floating point, complex, fixed-point, and integer).
In principle, it should be possible to overload the basic arithmetic operators so that, for example, a single Add primitive could handle any data type. The decision, however, was in favor of more explicit typing, in which there is an Add primitive for each particle type supported in the kernel. As before, when there is no data type suffix in the name of the primitive, the data type supported is double-precision floating point.
Each primitive type has equivalent primitives for floating-point, complex, fixed-point, and integer arithmetic, respectively. The basic primitive type functions are:
Basic primitive type |
Description |
Float |
Complex |
Fix |
Int |
---|---|---|---|---|---|
Add |
Output the sum of the inputs. |
X |
X |
X |
X |
Sub |
Output the Minuend input minus all Subtrahend inputs. |
X |
X |
X |
X |
Mpy |
Output the product of the inputs. |
X |
X |
X |
X |
MpyConst |
This is an amplifier; the output is the input multiplied by the Multiplier (default 1.0). |
X |
X |
X |
X |
Average |
Average some number of input samples or blocks of input samples. Blocks of successive input samples are treated as vectors. |
X |
X |
|
|
DivConst |
This is an amplifier. The Output is the Input divided by the Divisor (default 1). |
X |
X |
|
X |
Abs |
Compute the absolute value of its input. |
X |
X |
|
X |
Exp |
Compute the real exponential function of its real input. |
X |
|
|
|
Log |
Output the natural logarithm of its input. |
X |
|
|
|
Modulo |
The primitive computes the remainder of dividing values received at the input ports Dividend and Divisor. |
X |
|
|
X |
Reciprocal |
Output the reciprocal of its input, with an optional magnitude limit given by the parameter MagnitudeLimit. If MagnitudeLimit is greater than zero, and the input value is zero, then the output will equal MagnitudeLimit. |
X |
X |
|
|
Sqrt |
Computes the square root of its input. |
X |
|
|
|