jit.expr Evaluate expressions

The jit.expr object evaluates expressions to fill an output matrix. The expression can contain any operator available from within jit.op, any functor available from within jit.bfg, and many jitter MOPs. A variable number of inputs can be specified with an attribute argument setting the inputs attribute. Expressions should be specified between double quotes, and different expressions can be evaulated per plane if multiple symbols are used for the expr attribute. There are special variables and constants which can be used within expressions listed below. All expressions are evaluated using floating point arithmeic, so they will be more precise, but often slower for computing char data. For optimal speed with char data, it is recommended to use jit.charmap where possible (perhaps filled with an exaluated expression).

Matrix Operator: in[variable] out[1]
Name IOProc Planelink Typelink Dimlink Plane Dim Type
out n/a yes yes yes all all char long float32 float64

Attributes:
Name Type Description
expr symbol list[32] The expression to evaluate. If one expression is specified, it is evaluated for all planes. If multiple expressions are specified, they are evaluated on a plane by plane basis.

For a list of valid operators see jit.op and jit.bfg.

Special variables that may be used are:
cell[0-31] integer coordinate across dim
norm[0-31] normalized coordinate across dim
snorm[0-31] signed normalized coordinate across dim
dim[0-31] matrix size across dim
in[0-31] input matrix, corresponding plane
in[0-31].p[0-31] input matrix, specific plane
matrixname any named matrix, corresponding plane
matrixname.p[0-31] any named matrix, specific plane

Special contants that may be used are:
PI
TWOPI
HALFPI
INVPI 1/PI
DEGTORAD TWOPI/360
RADTODEG 360/TWOPI
E Euler’s constant
LN2 natural log of 2
LN10 natural log of 10
LOG2E log base 2 of Euler’s constant
LOG10E log base 10 of Euler’s constant
SQRT2 square root of 2
SQRT1_2 square root of 1/2
inputs int Input count (default = 2)

Messages:
float
Sets all matrix cells corresponding with input to float.

int
Sets all matrix cells corresponding with input to float.

Example:

See Also:
expr, jit.charmap, jit.op, jit.bfg, vexpr