cogx.compiler.parser.syntaxtree
Create a 3D (layers
x rows
x columns
) vector field filled by f
.
Create a 2D (rows
x columns
) vector field filled by f
.
Create a 1D columns
size vector field filled by f
.
Create a 0D vector field filled with value
.
The operation that creates this field.
Type of the field.
For every element, x
, in this
, compute x notIdenticallyEquals that
where 1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x notIdenticallyEquals that
where 1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for !=== operator.
A field equal to this
with each element, x
, mapped to
x notIdenticallyEquals that
.
Compare two fields using the "not identically equal" operator; a numeric value of 1.0f represents true (first operand != second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "not identically equal" operator; a numeric value of 1.0f represents true (first operand != second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
!=== that
.
this
notIdenticallyEqualTo that
For every element, x
, in this
, compute x modulo that
.
For every element, x
, in this
, compute x modulo that
. The result
has the same field shape and tensor shape as this
.
Operand for modulo operator.
A field equal to this
with each element, x
, mapped to
x modulo that
.
Compute this
modulo that
to create a third field.
Compute this
modulo that
to create a third field.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
modulo that
.
this
% that
Multiply every element in this
by that
.
Multiply every element in this
by that
. This will coerce
this
to be complex before proceeding.
Multiplicand
A field equal to the product of this
and that
, where
every numeric component of this
has been multiplied by that
.
Multiply every element in this
by that
to produce a result
with the same field shape and tensor shape as this
.
Multiply every element in this
by that
to produce a result
with the same field shape and tensor shape as this
.
Constant to be multiplied with every number in this
.
A field equal to the product of this
and that
, where
every numeric component of this
has been multiplied by that
.
Multiply this
field by that
field to create a third field.
Multiply this
field by that
field to create a third field.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Field to be multiplied by this
.
this
* that
Add the constant that
to every element in this
.
Add the constant that
to every element in this
. This will coerce
this
to be complex before proceeding.
Constant to be added to number in this
.
A field equal to the sum of this
and that
, where that
has
been added to every numeric component of this
.
Add the constant that
to every element in this
to produce a result
with the same field shape and tensor shape as this
.
Add the constant that
to every element in this
to produce a result
with the same field shape and tensor shape as this
.
Constant to be added to every number in this
.
A field equal to the sum of this
and that
, where that
has
been added to every numeric component of this
.
Add this
field and that
field to create a third field.
Add this
field and that
field to create a third field.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Field to be added to this
.
Sum of the two fields.
Subtract the constant that
from every element in this
.
Subtract the constant that
from every element in this
. This will coerce
this
to be complex before proceeding.
Constant to be subtracted from each number in this
.
A field equal to the difference of this
and that
, where that
has been subtracted from every numeric component of this
.
Subtract the constant that
from every element in this
to produce a
result with the same field shape and tensor shape as this
.
Subtract the constant that
from every element in this
to produce a
result with the same field shape and tensor shape as this
.
Constant to be sutracted from every number in this
.
A field equal to the difference of this
and that
, where that
has been subtracted from every numeric component of this
.
Subtract that
field from this
field to create a third field.
Subtract that
field from this
field to create a third field.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Field to be subtracted to this
.
this
- that
Divide every element in this
by that
.
Divide every element in this
by that
. This will coerce
this
to be complex before proceeding.
Divisor.
A field equal to the quotient of this
and that
, where
every numeric component of this
has been divided by that
.
Divide every element in this
by that
to produce a result
with the same field shape and tensor shape as this
.
Divide every element in this
by that
to produce a result
with the same field shape and tensor shape as this
.
The user must assure that the divisor is not zero, since the result would be NaN which does not throw an exception.
Divisor.
A field equal to this
dividedBy that
, where
every numeric component of this
has been divided by that
.
Divide this
field by that
field to create a third field.
Divide this
field by that
field to create a third field.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Field that this
will be divided by.
this
/ that
For every element, x
, in this
, compute x lessThan that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x lessThan that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for < operator.
A field equal to this
with each element, x
, mapped to
x lessThan that
.
Compare two fields using the "less than" operator; a numeric value of 1.0f represents true (first operand < second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "less than" operator; a numeric value of 1.0f represents true (first operand < second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
< that
.
this
lessThan that
For every element, x
, in this
, compute x lessThanEqual that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x lessThanEqual that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for <= operator.
A field equal to this
with each element, x
, mapped to
x lessThanEqual that
.
Compare two fields using the "less than equal" operator; a numeric value of 1.0f represents true (first operand <= second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "less than equal" operator; a numeric value of 1.0f represents true (first operand <= second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
<- that
.
this
lessThanOrEquel that
Feedback operator, denotes a field value fed back to this
.
Feedback operator, denotes a field value fed back to this
.
This does automatic type coercion if the field fed back is larger than or equal to the size (in each dimension) of the recipient of that field. This should be overridden where illegal.
Field whose value will become this
field's value on the next clock tick.
For every element, x
, in this
, compute x identicallyEquals that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x identicallyEquals that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for === operator.
A field equal to this
with each element, x
, mapped to
x identicallyEquals that
.
Compare two fields using the "identically equal" operator; a numeric value of 1.0f represents true (first operand == second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "identically equal" operator; a numeric value of 1.0f represents true (first operand == second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
=== that
.
this
identicallyEqualTo that
For every element, x
, in this
, compute x greaterThan that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x greaterThan that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for > operator.
A field equal to this
with each element, x
, mapped to
x greaterThan that
.
Compare two fields using the "greater than" operator; a numeric value of 1.0f represents true (first operand > second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "greater than" operator; a numeric value of 1.0f represents true (first operand > second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
> that
.
this
greaterThan that
For every element, x
, in this
, compute x greaterThanEqual that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute x greaterThanEqual that
where
1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for >= operator.
A field equal to this
with each element, x
, mapped to
x greaterThanEqual that
.
Compare two fields using the "greater than or equal" operator; a numeric value of 1.0f represents true (first operand >= second operand) and a numeric value of 0.0f represents false.
Compare two fields using the "greater than or equal" operator; a numeric value of 1.0f represents true (first operand >= second operand) and a numeric value of 0.0f represents false.
This operator follows the algebraic binary operator rules for input type compatibility, implicit type conversions, and output result type. See the class description for these rules.
Operand for computing this
>= that
.
this
greaterThanOrEqual that
Compute the outer product of Scalarfields this
and that
.
Compute the outer product of Scalarfields this
and that
. The
output field has a field shape that is the concatenation of the two
input field shapes, and must be at most 3-dimensional. Each output
element is calculated as in:
out(in1Indices, in2Indices) = in1(in1Indices) * in2(in2Indices)
This operation is implemented by a CPU kernel, so will be slow for big inputs.
Operand for computing this
^
that.
A field equal to the outer product of this
and that
,
Take the absolute value of every numeric element in this
.
Take the absolute value of every numeric element in this
.
Field equal to input field with each element, x, mapped to absoluteValue(x).
Take the arccosine of every numeric element in this
.
Take the arccosine of every numeric element in this
.
Field equal to input field with each element, x, mapped to acos(x).
Reduce the dimensionality of a field by 1 by "slicing" along one index of the first dimension.
Reduce the dimensionality of a field by 1 by "slicing" along one index of the first dimension.
For example, consider this input (3 rows x 4 columns) field:
0 1 2 3 4 5 6 7 8 9 0 1
The first dimension is rows, so a "slice index" of 0 would return the first row:
0 1 2 3
A slice index of 1 would return the second row:
4 5 6 7
And a slice index of 2 would return the third row:
8 9 0 1
A 0D scalar field supplying the index of the first dimension along which we will slice out a lower-dimensional field.
A sliced field, of dimension one less than the input field dimension.
Reduce the dimensionality of a field by 1 by "slicing" along one index of the first dimension.
Reduce the dimensionality of a field by 1 by "slicing" along one index of the first dimension.
For example, consider this input (3 rows x 4 columns) field:
0 1 2 3 4 5 6 7 8 9 0 1
The first dimension is rows, so a "slice index" of 0 would return the first row:
0 1 2 3
A slice index of 1 would return the second row:
4 5 6 7
And a slice index of 2 would return the third row:
8 9 0 1
The index of the first dimension along which we will slice out a lower-dimensional field.
A sliced field, of dimension one less than the input field dimension.
Extract a contiguous subfield from a field, maintaining its dimensionality.
Extract a contiguous subfield from a field, maintaining its dimensionality.
Each dimension of a field is indexed starting a zero. The user supplies a range of indices, one for each dimension, that specifies the continguous range of indices that should be extracted into the subfield.
For example, consider this input field:
0 1 2 3 4 5 6 7 8 9 0 1
This has 3 rows (first dimension) and 4 columns (second dimension) so its shape is 3 x 4. Specify row range (1 to 2) and column range (1 to 3) would extract the following subfield:
5 6 7 9 0 1
If the use of this subfield does not shift the origin, then use a trim instead which might be more efficient due to kernel merging.
For each dimension, a range of indices specifying where to extract the subfield.
Subfield of input as specified by the range
parameters.
Take the arcsine of every numeric element in this
.
Take the arcsine of every numeric element in this
.
Field equal to input field with each element, x, mapped to asin(x).
Compute atan2 of two identically shaped scalar fields.
Compute atan2 of two identically shaped scalar fields.
A scalar field that's the atan2 of the two input fields.
Convolve a vector field with a vector-field filter frame.
Convolve a vector field with a vector-field filter frame.
The filter to use for convolution; must be square and with odd size in each dimension.
Policy to use for handling convolution along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the convolution, also helps to determine the size of output field.
The number of logical (possibly multi-plane) images present in the input field.
Input field convolved with filter
using the supplied border
and sampling policies.
Compute the backward divergence of a 2D vector field.
Compute the backward divergence of a 2D vector field.
This is the adjoint operator of forwardGradient.
A scalar field representing the backward divergence of an input vector field.
Compute the backward gradient of a 2D scalar or vector field.
Compute the backward gradient of a 2D scalar or vector field.
For a scalar field input, a vector field representing the forward gradient of the input; for a vector input field, an order 4 tensor field representing the forward gradient of the input.
Perform bilateral filtering using spatialFilter
for spatial filtering
(typically this will be a truncated Gaussian) and a Gaussian with
width rangeSigma
for range filtering.
Perform bilateral filtering using spatialFilter
for spatial filtering
(typically this will be a truncated Gaussian) and a Gaussian with
width rangeSigma
for range filtering.
Reduce a vector field to a shorter (by factor factor
) vector field by
taking the max() of the first factor
input vector elements to form the
first output vector element, and so forth.
Reduce a vector field to a shorter (by factor factor
) vector field by
taking the max() of the first factor
input vector elements to form the
first output vector element, and so forth.
A vector field with each element equal to the max() of factor
components of the corresponding vector in the input field.
Reduce a vector field to a shorter (by factor factor
) vector field by
taking the min() of the first factor
input vector elements to form the
first output vector element, and so forth.
Reduce a vector field to a shorter (by factor factor
) vector field by
taking the min() of the first factor
input vector elements to form the
first output vector element, and so forth.
A vector field with each element equal to the min() of factor
components of the corresponding vector in the input field.
Reduce a vector field to a shorter (by factor factor
) vector field by
summing the first factor
input vector elements to form the first output
vector element, and so forth.
Reduce a vector field to a shorter (by factor factor
) vector field by
summing the first factor
input vector elements to form the first output
vector element, and so forth.
A vector field with each element equal to the sum of factor
components of the corresponding vector in the input field.
Compute the central gradient of a scalar of vector field.
Compute the central gradient of a scalar of vector field.
The central gradient at the point (x, y) is computed using the values at (x - 1, y), (x, y - 1), (x, y + 1), and (x + 1, y + 1)
For a scalar field input, returns a vectorField representing the central gradient of the input. For a vector field input, returns an order-4 tensor field representing the central gradient of the input.
"Columns" in the field.
"Columns" in the field. See class description for meaning of columns.
Implicit conversion of a Complex to a CogComplex which allows for fields to be combined with floating point numbers in a simple way.
Implicit conversion of a Complex to a CogComplex which allows for fields to be combined with floating point numbers in a simple way. This makes it possible to express commutative operations with a common syntax.
For example
Field + Complex
and
Complex + Field
are both legal and compilable with this implicit conversion.
The Complex to be converted to a CogComplex
The CogComplex created from c
.
Implicit conversion of a ComplexVector to a 0D constant ComplexVectorField which allows for fields to be combined with ComplexVectors in a simple way.
Implicit conversion of a ComplexVector to a 0D constant ComplexVectorField which allows for fields to be combined with ComplexVectors in a simple way. This makes it possible to express commutative operations with a common syntax.
For example
Field + ComplexVector
and
ComplexVector + Field
are both legal and compilable with this implicit conversion.
The complex vector to be converted to a 0D complex vector field.
A 0D complex vector field initialized to v
.
Given a matrix field, compute the condition number for each matrix in that field.
Given a matrix field, compute the condition number for each matrix in that field. This is currently limited to fields containing 2 x 2 matrices.
Scalar field holding the condition numbers for the corresponding matrices in the input matrix field.
Take the complex conjugate of each element in a complex field
Take the complex conjugate of each element in a complex field
Convolve a scalar/vector/matrix field with a filter.
Convolve a scalar/vector/matrix field with a filter.
The filter to use for convolution; must be square and with odd size in each dimension.
Policy to use for handling convolution along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the convolution, also helps to determine the size of output field.
Input field convolved with filter
using the supplied border
and sampling policies.
Convolve a vector field with a vector-field with "filter adjoint" plane mixing.
Convolve a vector field with a vector-field with "filter adjoint" plane mixing.
The filter to use for convolution; must be square and with odd size in each dimension.
Policy to use for handling convolution along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the convolution, also helps to determine the size of output field.
The number of logical (possibly multi-plane) images present in the input field.
Input field convolved with filter
using the supplied border
and sampling policies.
Convolve a scalar/vector/matrix field with a row filter and a column filter (separable convolution).
Convolve a scalar/vector/matrix field with a row filter and a column filter (separable convolution).
The filter to use for convolving the rows with odd size in each dimension.
The filter to use for convolving the columns with odd size in each dimension.
Policy to use for handling convolution along borders, implicitly helps to determine size of output field.
Input field convolved with filters using the supplied border policy.
Take the cosine of every numeric element in this
.
Take the cosine of every numeric element in this
.
Field equal to input field with each element, x, mapped to cos(x).
Take the hyperbolic cosine of every numeric element in this
.
Take the hyperbolic cosine of every numeric element in this
.
Field equal to input field with each element, x, mapped to cosh(x).
Cross-correlate a scalar/vector/matrix field with a filter.
Cross-correlate a scalar/vector/matrix field with a filter.
The filter to use for cross-correlation; must be square and with odd size in each dimension.
Policy to use for handling cross-correlation along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the crossCorrelation, also helps to determine the size of output field.
Input field cross-correlated with filter
using the supplied
border and sampling policies.
Cross-correlate a vector field with a vector-field with "filter adjoint" plane mixing.
Cross-correlate a vector field with a vector-field with "filter adjoint" plane mixing.
The filter to use for cross-correlation; must be square and with odd size in each dimension.
Policy to use for handling cross-correlation along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the crossCorrelation, also helps to determine the size of output field.
The number of logical (possibly multi-plane) images present in the input field.
Input field cross-correlated with filter
using the supplied
border and sampling policies.
Cross-correlate a scalar/vector/matrix field with a row filter and a column filter (separable convolution).
Cross-correlate a scalar/vector/matrix field with a row filter and a column filter (separable convolution).
The filter to use for cross-correlating the rows with odd size in each dimension.
The filter to use for cross-correlating the columns with odd size in each dimension.
Policy to use for handling cross-correlation along borders, implicitly helps to determine size of output field.
Input field cross-correlated with filters using the supplied border policy.
Multiply a 2D matrix field, this
, by a 2D scalar field, f2
, to
produce a 2D scalar field.
Multiply a 2D matrix field, this
, by a 2D scalar field, f2
, to
produce a 2D scalar field.
The scalar field f2
must have the same shape as the matrices in this
.
This operator is basically pretending that the f2
scalar field is
really a matrix and simply dotting that matrix with every matrix in the
matrix field this
, producing a scalar in the corresponding position
of the result scalar field.
Scalar field to multiply with this
.
"cross dot" product of this
and f2
.
Takes the DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
Takes the DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
The following sequence will return the original input, within the bounds of computational error:
val field val transformed = field.dct val restored = transformed.dctInverse // restored is approximately equal to field
For a somewhat faster version, see dctTransposed.
The DCT has several requirements:
The number of rows and columns must each be a power of 2.
Rows and columns are restricted to the range [256, 2048]
The DCT of the input.
Takes the inverse DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
Takes the inverse DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
The following sequence will return the original input, within the bounds of computational error:
val field val transformed = field.dct val restored = transformed.dctInverse // restored is approximately equal to field
For a somewhat faster version, see dctInverseTransposed.
The DCT has several requirements:
The number of rows and columns must each be a power of 2.
Rows and columns are restricted to the range [256, 2048]
The DCT of the input.
Takes the inverse DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
Takes the inverse DCT (discrete cosine transform) of a 2D field, producing a field with the same shape as the input.
The following sequence will return the original input, within the bounds of computational error:
val field val transformed = field.dctTransposed val restored = transformed.dctInverseTransposed // restored is approximately equal to field
This is a somewhat faster version of dctInverse where the transpose is not important to (or can be compensated within) an application.
The DCT has several requirements:
The number of rows and columns must each be a power of 2.
Rows and columns are restricted to the range [256, 2048]
The DCT of the input.
Takes the DCT (discrete cosine transform) of a 2D field and transposes it, producing a field with the same shape as the input transposed.
Takes the DCT (discrete cosine transform) of a 2D field and transposes it, producing a field with the same shape as the input transposed.
The following sequence will return the original input, within the bounds of computational error:
val field val transformed = field.dctTransposed val restored = transformed.dctInverseTransposed // restored is approximately equal to field
This is a somewhat faster version of dct where the transpose is not important to (or can be compensated within) an application.
The DCT has several requirements:
The number of rows and columns must each be a power of 2.
Rows and columns are restricted to the range [256, 2048]
The DCT of the input.
Compute the determinant of every matrix in a matrix field.
Compute the determinant of every matrix in a matrix field.
Scalar field holding the determinants for the corresponding matrices in the input matrix field.
Dimensions of the field.
Dimensions of the field.
Perform a "domain filter" on the columns of a color field as a step in edge-aware normalized convolution.
Perform a "domain filter" on the columns of a color field as a step in
edge-aware normalized convolution. This "correlates" an adaptive box
filter with each pixel in the columns of the color field, guided by
domainTransform
.
This operation works only on color fields and is an optimization. The following code sequences, A and B, are functionally identical:
// Prepare for filtering val rowTransform = colorImage.domainTransformRows(...) val colTransform = colorImage.transpose.domainTransformRows(...) // Sequence A (slower) var smooth = colorImage smooth = smooth.domainFilterRows(rowTransform, ...) smooth = smooth.transpose.domainFilterRows(colTransform, ...).transpose // Sequence B, using this operation (faster, no transposes) var smooth = colorImage smooth = smooth.domainFilterRows(rowTransform, ...) smooth = smooth.domainFilterColumns(colTransform, ...)
For details, see the paper "Domain transform for edge-aware image and video processing," Gastal and Oliveira, 2011. Normally this is not useful for end-users, but you're welcome to try it if you would like to write your own edge-aware filters.
The cumulative domain transform for the image.
Radius of box filter.
The domain transform of the columns (equation 11) in the Gastal paper as a scalar field.
Perform a "domain filter" on the rows of a tensor or color field as a step in edge-aware normalized convolution.
Perform a "domain filter" on the rows of a tensor or color field as a step
in edge-aware normalized convolution. This "correlates" an adaptive box
filter with each pixel in the rows of the color field, guided by
domainTransform
.
For details, see the paper "Domain transform for edge-aware image and video processing," Gastal and Oliveira, 2011. Normally this is not useful for end-users, but you're welcome to try it if you would like to write your own edge-aware filters.
The cumulative domain transform for the image.
Radius of box filter.
The domain transform of the rows (equation 11) in the Gastal paper as a scalar field.
Perform a "domain transform" on the rows of a color field or tensor field as a step in edge-aware normalized convolution.
Perform a "domain transform" on the rows of a color field or tensor field as a step in edge-aware normalized convolution.
For details, see the paper "Domain transform for edge-aware image and video processing," Gastal and Oliveira, 2011. Normally this is not useful for end-users, but you're welcome to try it if you would like to write your own edge-aware filters.
Width of filter in space.
Width of filter in range.
The domain transform of the rows (equation 11) in the Gastal paper as a scalar field.
Takes the inner product of two identically shaped tensor fields to create a scalar field.
Takes the inner product of two identically shaped tensor fields to create a scalar field.
The tensors in both fields must have the same shape. Dotting two tensors involves multiplying corresponding elements in the two tensors and summing the products.
Other field to "dot" with this
field.
Scalar field where each scalar element is computed from the dot product of the tensors in the corresponding location of the two input tensor fields.
Downsample a field by taking every nth element.
Downsample a field by taking every nth element.
Example: for input field {1,2,3,4}
input.downsample(2) yields {1,3}
input.downsample(2,1) yields {2,4}
The sampling factor, defaults to 2.
The offset within the downsampled region from which to take data, defaults to an offset of 0.
Apply the exponential function to every numeric element in this
.
Apply the exponential function to every numeric element in this
. This
works for complex and real fields.
Field equal to input field with each element, x, mapped to exp(x).
Expand an N-dimensional field by padding it with values per the border policy, maintaining the origin.
Expand an N-dimensional field by padding it with values per the border policy, maintaining the origin. The supported border policies are BorderZero, BorderClamp and BorderCyclic.
See expand(borderPolicy, shape) for a description of the border policies.
Policy to use for producing border values.
The integer dimensions of the expanded output field.
Expanded field with new elements filled in from the nearest input
edge per borderPolicy
.
Expand an N-dimensional field by padding it with values per the border policy, maintaining the origin.
Expand an N-dimensional field by padding it with values per the border policy, maintaining the origin. The supported border policies are BorderZero, BorderClamp and BorderCyclic.
With the BorderZero policy, the border values are all 0.
Border Zero Example. A 3 x 4 input field:
1 2 3 4 5 -1 -1 6 7 8 9 0
If we expand this to 7 x 8, we fill the new elements with zeroes:
1 2 3 4 0 0 0 0 5 -1 -1 6 0 0 0 0 7 8 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
With the BorderClamp policy, the border is extended outwards into the expanded output field, wrapping around as though the output field were a torus. This is useful when doing convolution with the FFT and one wishes to minimize border effects by "border clamping".
BorderClamp Example. A 3 x 4 input field:
1 2 3 4 5 -1 -1 6 7 8 9 0
If we expand this to 7 x 8, we extend the borders, wrapping around as though the output field were a torus:
1 2 3 4 4 4 1 1 5 -1 -1 6 6 6 5 5 7 8 9 0 0 0 7 7 7 8 9 0 0 0 0 0 7 8 9 0 0 0 0 0 1 2 3 4 0 0 0 0 1 2 3 4 0 0 0 0
With the BorderCyclic policy, the border values emulate a cyclic "wrap-around" in the original field, as though the input field were a torus. This is useful when doing cyclic convolution with the FFT and one wishes expand the field to make it a power of 2 (necessary for the FFT) while still preserving cyclic convolution
BorderCyclic Example. A 3 x 4 input field:
1 2 3 4 5 -1 -1 6 7 8 9 0
If we expand this to 7 x 8, we extend the borders, wrapping around as though the input field were a torus:
1 2 3 4 1 2 3 4 5 -1 -1 6 5 -1 -1 6 7 8 9 0 7 8 9 0 1 2 3 4 1 2 3 4 5 -1 -1 6 5 -1 -1 6 5 -1 -1 6 5 -1 -1 6 7 8 9 0 7 8 9 0
Policy to use for producing border values.
The shape of the expanded output field.
Expanded field with new elements filled in from the nearest input
edge per borderPolicy
.
Compute the FFT of a complex field.
Compute the FFT of a complex field.
Compute the FFT of the columns only in a 2D complex field.
Compute the FFT of the columns only in a 2D complex field.
Compute the inverse FFT of a complex field (includes scaling).
Compute the inverse FFT of a complex field (includes scaling).
Compute the inverseFFT of the columns only in a 2D complex field.
Compute the inverseFFT of the columns only in a 2D complex field.
Compute the inverse FFT of the rows only in a 2D complex field.
Compute the inverse FFT of the rows only in a 2D complex field.
Compute the FFT of the rows only in a 2D complex field.
Compute the FFT of the rows only in a 2D complex field.
Implicit conversion of an array of Fields to an array of ScalarFields.
Implicit conversion of an array of Fields to an array of ScalarFields.
An array of Fields.
An array of MatrixFields.
Implicit conversion of an array of Fields to an array of ScalarFields.
Implicit conversion of an array of Fields to an array of ScalarFields.
An array of Fields.
An array of ScalarFields.
Implicit conversion of an array of Fields to an array of ScalarFields.
Implicit conversion of an array of Fields to an array of ScalarFields.
An array of Fields.
An array of VectorFields.
Reduce a scalar field to a 0D scalar containing a single element which is the maximum element in the input field.
Reduce a scalar field to a 0D scalar containing a single element which is the maximum element in the input field.
0D scalar field holding the max value in input field.
Find the median value in a scalar field.
Find the median value in a scalar field.
0D scalar field holding the median value of the input field.
Reduce a scalar field to a 0D scalar containing a single element which is the minimum element in the input field.
Reduce a scalar field to a 0D scalar containing a single element which is the minimum element in the input field.
0D scalar field holding the min value in input field.
Reduce a scalar field to a 0D scalar containing the sum of all the elements in the input field.
Reduce a scalar field to a 0D scalar containing the sum of all the elements in the input field.
0D scalar field holding the sum of values in input field.
Shape of the field.
Shape of the field.
Implicit conversion of a Field to a ColorField.
Implicit conversion of a Field to a ColorField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ColorField but stored in a Field variable. This method also supports converting a ScalarField or VectorField to a ColorField.
A field which needs coercion to the ColorField type.
The converted field.
Implicit conversion of a Field to a ComplexField.
Implicit conversion of a Field to a ComplexField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ComplexField but stored in a Field variable. This method also supports converting a ScalarField to a ComplexField.
A field which needs coercion to the ComplexField type.
The converted field.
Implicit conversion of a Field to a ComplexField.
Implicit conversion of a Field to a ComplexField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ComplexField but stored in a Field variable. This method also supports converting a ScalarField to a ComplexField.
A field which needs coercion to the ComplexVectorField type.
The converted field.
Implicit conversion of a Field to a MatrixField.
Implicit conversion of a Field to a MatrixField. Since Field is abstract, the only possible conversion is if the field is already a MatrixField but is stored in a Field variable. This merely does the necessary type coercion.
A field which needs coercion to the MatrixField type.
The converted field.
Implicit conversion of a Field to a ScalarField.
Implicit conversion of a Field to a ScalarField. Since Field is abstract, the only possible conversion is if the field is already a ScalarField but is stored in a Field variable. This merely does the necessary type coercion.
A field which needs coercion to the ScalarField type.
The converted field.
Implicit conversion of a Field to a VectorField.
Implicit conversion of a Field to a VectorField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a VectorField but stored in a Field variable. This method also supports converting a ColorField to a VectorField.
A field which needs coercion to the VectorField type.
The converted field.
The field type of the result.
The field type of the result.
Flip a field along every dimension.
Flip a field along every dimension.
Example. This 2D scalar field:
1 2 3 4 5 6 7 8 9
looks like this when flipped:
9 8 7 6 5 4 3 2 1
A flipped version of the input field.
Implicit conversion of a Float to a CogFloat which allows for fields to be combined with floating point numbers in a simple way.
Implicit conversion of a Float to a CogFloat which allows for fields to be combined with floating point numbers in a simple way. This makes it possible to express commutative operations with a common syntax.
For example
Field + Float
and
Float + Field
are both legal and compilable with this implicit conversion.
The Float to be converted to a CogFloat
The CogFloat created from f
.
Map each numeric element of the input field to the largest integer which is less than or equal to that element.
Map each numeric element of the input field to the largest integer which is less than or equal to that element.
Field where every number element has been "floored" to an integer.
Compute the forward gradient of a 2D scalar or vector field.
Compute the forward gradient of a 2D scalar or vector field.
This is the adjoint operator of backwardDivergence.
For a scalar field input, a vector field representing the forward gradient of the input; for a vector input field, an order 4 tensor field representing the forward gradient of the input.
Extract the imaginary part of a complex field as a scalar field.
Extract the imaginary part of a complex field as a scalar field.
A scalar field with the same shape as the input, with each element equal to the imaginary part of the corresponding complex element in the input.
The input fields that drive the operation that produces this field
The input fields that drive the operation that produces this field
Declare an internal error described by message
.
Declare an internal error described by message
.
Invert all matrices in a matrix field using Gauss-Jordan elimination.
Invert all matrices in a matrix field using Gauss-Jordan elimination.
This is numerically stable only for small matrices, and let's not even get in to singular matrices. Be careful.
A matrix field where each matrix is the (approximate) inverse of the corresponding matrix in the input matrix field.
Check if this
has been instantiated with a virtual field register.
Check if this
has been instantiated with a virtual field register.
"Layers" in the field.
"Layers" in the field. See class description for meaning of layers.
Find the local maximum of a neighborhood centered on each pixel in a 2D scalar field.
Find the local maximum of a neighborhood centered on each pixel in a 2D scalar field.
For each point in the input 2D scalar field, this searches a small neighborhood of that point and extracts the largest scalar found.
The neighborhood
is defined by a matrix which is centered on the point. A
non-zero value in the kernel means the corresponding point in the field
is part of the neighborhood, while a zero implies the point should be
ignored.
For example, the kernel
1 1 0 1 1 0 0 0 0
specifies the 2 x 2 neighborhood for the maximum value search.
An odd-sized matrix describing the neighborhood for doing the local max search. TO DO: This will become a field rather than a matrix. XXX
A scalar field with the same shape as the input, where each
element is equal to the local max of the input field as defined
by neighborhood
.
For a scalar field, find the relative position of the local maximum of a neighborhood centered on the current pixel.
For a scalar field, find the relative position of the local maximum of a neighborhood centered on the current pixel. This is returned as vector field, with each vector's tail at the current pixel and the head pointing at the pixel containing the neighborhood's local maximum.
The neighborhood
is defined by a matrix which is centered on the point. A
non-zero value in the kernel means the corresponding point in the field
is part of the neighborhood, while a zero implies the point should be
ignored.
For example, the kernel
1 1 0 1 1 0 0 0 0
specifies the 2 x 2 neighborhood for the maximum value search.
An odd-sized matrix describing the neighborhood for doing the local max search. TO DO: This will become a field rather than a matrix. XXX
A vector field with the same field shape as the input scalar field, with each vector pointing to the maximum value in the neighborhood relative to the center of the neighborhood.
Find the local minimum of a neighborhood centered on each pixel in a 2D scalar field.
Find the local minimum of a neighborhood centered on each pixel in a 2D scalar field.
For each point in the input 2D scalar field, this searches a small neighborhood of that point and extracts the smallest scalar found.
The neighborhood
is defined by a matrix which is centered on the point. A
non-zero value in the kernel means the corresponding point in the field
is part of the neighborhood, while a zero implies the point should be
ignored.
For example, the kernel
1 1 0 1 1 0 0 0 0
specifies the 2 x 2 neighborhood for the minimum value search.
An odd-sized matrix describing the neighborhood for doing the local max search. TO DO: This will become a field rather than a matrix. XXX
A scalar field with the same shape as the input, where each
element is equal to the local min of the input field as defined
by neighborhood
.
For a scalar field, find the relative position of the local minimum of a neighborhood centered on the current pixel.
For a scalar field, find the relative position of the local minimum of a neighborhood centered on the current pixel. This is returned as vector field, with each vector's tail at the current pixel and the head pointing at the pixel containing the neighborhood's local manimum.
The neighborhood
is defined by a matrix which is centered on the point. A
non-zero value in the kernel means the corresponding point in the field
is part of the neighborhood, while a zero implies the point should be
ignored.
For example, the kernel
1 1 0 1 1 0 0 0 0
specifies the 2 x 2 neighborhood for the minimum value search.
An odd-sized matrix describing the neighborhood for doing the local min search. TO DO: This will become a field rather than a matrix. XXX
A vector field with the same field shape as the input scalar field, with each vector pointing to the minimum value in the neighborhood relative to the center of the neighborhood.
Apply the natural logarithm to every numeric element in this
.
Apply the natural logarithm to every numeric element in this
.
Field equal to input field with each element, x, mapped to log(x).
Take the magnitude of each element in a complex field
Take the magnitude of each element in a complex field
Convert a matrix field to a vector field by stripping out one row from each matrix in the field and making it a vector.
Convert a matrix field to a vector field by stripping out one row from each matrix in the field and making it a vector.
The index of the desired row to strip out of each matrix and use as a vector.
A vector field made up of the stripped out vectors from the input matrix field.
Select the maximum value of corresponding elements in two scalar fields.
Select the maximum value of corresponding elements in two scalar fields.
Second scalar field to compare with this
.
Scalar field where each element is the largest corresponding
elements in this
or f2
.
For every element, x
, in this
, compute max(x, that)
where 1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute max(x, that)
where 1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for max operator.
A field equal to this
with each element, x
, mapped to
max(x, that)
.
Find the location/position of the maximum element in a scalar field.
Find the location/position of the maximum element in a scalar field.
A 0D vector field containing a vector holding the indices of the maximum element.
Filter a 2D input scalar field with a 3 x 3 median filter.
Filter a 2D input scalar field with a 3 x 3 median filter.
A 2D scalar field with the same field shape as the input, with each element median filtered.
Select the minimum value of corresponding elements in two scalar fields.
Select the minimum value of corresponding elements in two scalar fields.
Second scalar field to compare with this
.
Scalar field where each element is the smallest corresponding
elements in this
or f2
.
For every element, x
, in this
, compute min(x, that)
where 1.0f represents a "true" result and 0.0f represents a "false" result.
For every element, x
, in this
, compute min(x, that)
where 1.0f represents a "true" result and 0.0f represents a "false" result.
The resulting field has the same field shape and tensor shape as this
.
Operand for min operator.
A field equal to this
with each element, x
, mapped to
min(x, that)
.
Get the "full" name of a field, as a Scala-like path name.
Get the "full" name of a field, as a Scala-like path name.
Forces locally non-maximum pixels to zero for both scalar fields and vector fields.
Forces locally non-maximum pixels to zero for both scalar fields and vector fields.
Locality is defined to be the 8 nearest neighbors to a given pixel. If a pixel is greater than or equal to any of those neighbors, its value is left intact on the output, otherwise it's set to zero. Note that border pixels have only 5 nearest neighbors and corner pixels have only 3 nearest neighbors, so those are the only ones checked.
Vector fields are treated as though they were an array of scalar fields, so non-maximum suppression is executed independently on each.
A copy of the input field with locally non-maximum values set to zero.
Normalize a scalar field using the L1 norm.
Normalize a scalar field using the L1 norm.
A normalized copy of the input field.
Normalize a scalar field using the L2 norm.
Normalize a scalar field using the L2 norm.
A normalized copy of the input field.
The opcode of the operation that produces this field
The opcode of the operation that produces this field
The operation that creates this field.
The operation that creates this field.
Forces locally non-maximum pixels to zero for calar fields,
but only when comparing the pixels on either side of
a given pixel, using orientation
to define where to look for the
two pixels for comparison.
Forces locally non-maximum pixels to zero for calar fields,
but only when comparing the pixels on either side of
a given pixel, using orientation
to define where to look for the
two pixels for comparison.
A scalar field holding the local orientation of the input field at every point. Orientation ranges from -Pi/2 to Pi/2, where the corresponding orientation rotates clockwise from horizontal (-Pi/2) to vertical (0) to horizontal (Pi/2).
A copy of the input field with locally non-maximum values set to zero.
Take the phase of each element in a complex field.
Take the phase of each element in a complex field.
This is also commonly called arg
. This is a number in the range
(-Pi, Pi]
Raise each number in a field to the power that
.
Raise each number in a field to the power that
.
The resulting field has the same field shape and tensor shape as this
.
Input field with every number raised to the power that
.
Raise each number in a field to the power that
.
Raise each number in a field to the power that
.
The resulting field has the same field shape and tensor shape as this
.
Input field with every number raised to the power that
.
Print out, if possible, GPU code that generates this field.
Print out, if possible, GPU code that generates this field.
User mechanism for marking a field as "probed," optionally supplying a name for the field.
User mechanism for marking a field as "probed," optionally supplying a name for the field.
If a field is visible to reflection, it will be automatically named.
In that case supplying a userName
is unnecessary and not recommended.
User's name for the field. If not supplied, the field is probed but uses system-inferred naming for the field.
The field being probed.
Cross-correlate a vector field with a vector-field filter frame.
Cross-correlate a vector field with a vector-field filter frame.
The filter to use for cross-correlation; must be square and with odd size in each dimension.
Policy to use for handling cross-correlation along borders, implicitly helps to determine size of output field.
Upsampling, downsampling optionally embedded in the crossCorrelation, also helps to determine the size of output field.
The number of logical (possibly multi-plane) images present in the input field.
Input field cross-correlated with filter
using the supplied
border and sampling policies.
Compute a random field based on this input field using cellular automaton based RNG.
Compute a random field based on this input field using cellular automaton based RNG. The output ranges from [0 to 1] (inclusive) and is uniformly distributed.
The number of bits of precision to use
A Vector field where each point in the field is random
Extract the real part of a complex field as a scalar field.
Extract the real part of a complex field as a scalar field.
A scalar field with the same shape as the input, with each element equal to the real part of the corresponding complex element in the input.
Perform 1/x operation on every numeric element of a field.
Perform 1/x operation on every numeric element of a field.
Somewhat dangerous to use if any element in the field could be zero, since the resulting element would be NaN which does not throw an exception.
Input field with each numeric element, x, mapped to 1/x.
Read the current recurrence input, if any.
Read the current recurrence input, if any.
Write the recurrent input, making sure it's legal.
Write the recurrent input, making sure it's legal.
Reduce a vector field to a scalar field by mapping each vector to the maximum of its components.
Reduce a vector field to a scalar field by mapping each vector to the maximum of its components.
A scalar field with each element equal to the maximum of the components of the corresponding vector in the input field.
Reduce a vector field to a scalar field by mapping each vector to the minimum of its components.
Reduce a vector field to a scalar field by mapping each vector to the minimum of its components.
A scalar field with each element equal to the minimum of the components of the corresponding vector in the input field.
Reduce a vector field to a scalar field by mapping each vector to the sum of its components.
Reduce a vector field to a scalar field by mapping each vector to the sum of its components.
A scalar field with each element equal to the sum of components of the corresponding vector in the input field.
Replicate a scalar field as matrices in a matrix field (each matrix in the matrix field is identical to the input scalar field).
Replicate a scalar field as matrices in a matrix field (each matrix in the matrix field is identical to the input scalar field).
The shape of the resulting output field.
A matrix field with the same field shape as f2
and tensor
shape the same as the input scalar field.
Change the shape of a scalar field without changing the number of elements in it.
Change the shape of a scalar field without changing the number of elements in it.
This depends on the row-major ordering we use for elements in a field. Elements in any scalar field, regardless of dimension, have that linear ordering. Reshaping preserves that ordering; it really does nothing more than change the sizes of each dimension of the field.
the output field shape to use
the output tensor shape to use
Warn of uses of reshape that had different behaviors prior to libcog 4.3
The input field, reshaped, with the same elements in the same linear order.
Change the shape of a scalar field without changing the number of elements in it.
Change the shape of a scalar field without changing the number of elements in it.
This depends on the row-major ordering we use for elements in a field. Elements in any scalar field, regardless of dimension, have that linear ordering. Reshaping preserves that ordering; it really does nothing more than change the sizes of each dimension of the field.
A sequence of new sizes for each dimensions. The product of this sequence must equal the number of elements in the input field.
The input field, reshaped, with the same elements in the same linear order.
Multiply a matrix field, this
, by a scalar field, f2
, to produce a
scalar field.
Multiply a matrix field, this
, by a scalar field, f2
, to produce a
scalar field.
The matrix field and scalar field operands must have identical field shapes. Each scalar element of the scalar field is multiplied by the corresponding element in the matrix field. These products are then summed to produce the scalar field result (which has the same shape as the matrices in the matrix field).
Scalar field operand which have the same field shape as
this
.
Product of this
and f2
.
"Rows" in the field.
"Rows" in the field. See class description for meaning of rows.
Shift a 2D scalar field in both dimensions, pulling in zeroes where necessary.
Shift a 2D scalar field in both dimensions, pulling in zeroes where necessary.
Number of pixels to shift field.
Number of pixels to shift field.
Shifted input field.
Shift a 1D scalar field left (negative colShift
) or right (positive
colShift
), pulling in zeroes where necessary.
Shift a 1D scalar field left (negative colShift
) or right (positive
colShift
), pulling in zeroes where necessary.
Number of pixels to shift field.
Shifted input field.
Shift a 2D scalar field in both dimensions, pulling in values from the opposite side where necessary.
Shift a 2D scalar field in both dimensions, pulling in values from the opposite side where necessary. Negative shift amounts result in shifts up and to the left, while positive shift amounts result in shifts down and to the right.
Number of pixels to shift field.
Number of pixels to shift field.
Shifted input field.
Shift a 1D scalar field left (negative colShift
) or right (positive
colShift
), pulling in values from the opposite side where necessary.
Shift a 1D scalar field left (negative colShift
) or right (positive
colShift
), pulling in values from the opposite side where necessary.
Number of pixels to shift field.
Shifted input field.
Apply the signum operator to every numeric element in this
.
Apply the signum operator to every numeric element in this
.
Signum(x) is defined to be:
1 if x > 0
0 if x == 0
-1 if x < 0
Field equal to input field with each element, x, mapped to signum(x).
Apply the sine operator to every numeric element in this
.
Apply the sine operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to sin(x).
Apply the hyperbolic sine operator to every numeric element in this
.
Apply the hyperbolic sine operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to sinh(x).
Get the sinks of this hyperedge.
Get the sinks of this hyperedge.
Solve Ax = b for x, where A is matrix field, this
, and b is the
vector field argument.
Solve Ax = b for x, where A is matrix field, this
, and b is the
vector field argument.
This actually solves the equation for each matrix / vector pair in the
fields this
and b
, producing a vector field representing x. The
vectors in b must be length 2 and the matrices in this
must be 2 x 2.
Solves the equations using the pseudo inverse
Vector field argument.
The solution, x, to the set of linear equations.
Get the source of this hyperedge.
Get the source of this hyperedge.
Get the output index of this hyperedge on the source.
Get the output index of this hyperedge on the source.
Apply the square operator to every numeric element in this
.
Apply the square operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to (x * x).
Apply the square root operator to every numeric element in this
.
Apply the square root operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to sqrt(x).
Steal sinks from another edge, from
, and add them to this.
One can
avoid stealing sinks that are a single exceptSink
node.
Steal sinks from another edge, from
, and add them to this.
One can
avoid stealing sinks that are a single exceptSink
node. This is useful in
merging a source node into a sink node, where the source -> sink connection
is probed or has additional sinks outside the merged kernel. In that case,
the output of the merged kernel wants to steal the sinks of the source -> sink
connection edge, but does not want to include the sink.
This makes the from
useless since it is no longer used by any other node.
The edge from which to steal outputs;
The sink to not transfer from from
to this
;
Extracts a window from a 1D or 2D scalar, vector or matrix field, guided by
a 0D vector field called "the guide." The guide specifies the upper-left-most
(or left-most for 1D fields) point of the window, and shape
specifies the size of the window.
Extracts a window from a 1D or 2D scalar, vector or matrix field, guided by
a 0D vector field called "the guide." The guide specifies the upper-left-most
(or left-most for 1D fields) point of the window, and shape
specifies the size of the window.
A guiding vector with value (v1, v2) means a given point (row, col) extracts the element at location (row + v1, col + v2) as its output. If that location falls outside of the field, the BorderPolicy attached to the the opcode determines how the missing value is computed. If either of the guide vector components v1 and v2 is non-integral, bilinear interpolation is used to to determine the approximate value.
The guide vector.
Shape of the window.
Policy for handling border processing.
Extracted window.
Extract all subfields from a 2D scalar field into a 2-D vector field.
Extract all subfields from a 2D scalar field into a 2-D vector field.
Sizes (rows and columns) of each subfield. Must be odd.
A 2-D vector field where the length of the vector equals the
number of diameter
x diameter
subfields in the input.
For example, a 4 x 4 input field has four subfields of size 3 x 3,
so this operator would return a 2-D vector field of size 3 x 3
(the size of the subfields) with vectors of length 4.
Each layer of the vector field is one subfield of of the input.
Supersample a scalar field by 2X in each dimension, replicating pixels to fill in the gaps.
Supersample a scalar field by 2X in each dimension, replicating pixels to fill in the gaps.
Input field expanded by 2X in each dimension with pixel replication.
Apply the tangent operator to every numeric element in this
.
Apply the tangent operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to tan(x).
Apply the hyperbolic tangent operator to every numeric element in this
.
Apply the hyperbolic tangent operator to every numeric element in this
.
Field equal to input field with each element, x, mapped to tanh(x).
Order of the tensors in the field.
Order of the tensors in the field.
Shape of the tensors in the field.
Shape of the tensors in the field.
Explicit conversion of a Field to a ColorField.
Explicit conversion of a Field to a ColorField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ColorField but stored in a Field variable. This method also supports converting a ScalarField or VectorField to a ColorField.
The converted field.
Explicit conversion of a Field to a ComplexField.
Explicit conversion of a Field to a ComplexField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ComplexField but stored in a Field variable. This method also supports converting a ScalarField to a ComplexField.
The converted field.
Explicit conversion of a Field to a ComplexVectorField.
Explicit conversion of a Field to a ComplexVectorField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a ComplexVectorField but stored in a Field variable. This method also supports converting a VectorField to a ComplexVectorField.
The converted field.
Another explicit conversion, this time working on both ScalarFields and VectorFields.
Another explicit conversion, this time working on both ScalarFields and VectorFields. The return type is Field though, the common base class of both ComplexFields and ComplexScalarFields.
Explicit conversion of a Field to a MatrixField.
Explicit conversion of a Field to a MatrixField. Since Field is abstract, the only possible conversion is if the field is already a MatrixField but is stored in a Field variable. This merely does the necessary type coercion.
The converted field.
Explicit conversion of a Field to a ScalarField.
Explicit conversion of a Field to a ScalarField. Since Field is abstract, the only possible conversion is if the field is already a ScalarField but is stored in a Field variable. This merely does the necessary type coercion.
The converted field.
Convert node to a string for debugging.
Convert node to a string for debugging.
Explicit conversion of a Field to a VectorField.
Explicit conversion of a Field to a VectorField. Field is abstract, so this method will perform the appropriate type coercion if the field is already a VectorField but stored in a Field variable. This method also supports converting a ColorField to a VectorField.
The converted field.
(1) Multiply a matrix field by a matrix field to produce a matrix field; or (2) multiply a matrix field by a vector field to produce a vector field.
(1) Multiply a matrix field by a matrix field to produce a matrix field; or (2) multiply a matrix field by a vector field to produce a vector field.
For case (1), corresponding matrices in this
and f2
are multiplied
using standard matrix multiplication to produce the corresponding matrix
in the resulting matrix field.
For case (2), corresponding matrix/vector pair in this
and f2
are
multiplied using standard matrix/vector multiplication to produce the
corresponding vector (a linear transformation of the input vector)
in the resulting vector field.
Matrix field or vector field; must have the same field shape
as this
.
Matrix field or vector representing the matrix multiplications of corresponding elements in the two input fields.
Transpose a 2D tensor field or color field.
Transpose a 2D tensor field or color field.
Transpose all the matrices in a matrix field to produce a new matrix field.
Transpose all the matrices in a matrix field to produce a new matrix field.
Copy of input matrix field with all matrices transposed.
Transpose each vector in a vector field to a single row matrix, thus creating a matrix field from a vector field
Transpose each vector in a vector field to a single row matrix, thus creating a matrix field from a vector field
Copy of input matrix field with all vectors transposed to single row matrices.
"Trim" a field to a smaller size by clipping off indices (maintaining the origin).
"Trim" a field to a smaller size by clipping off indices (maintaining the origin).
Desired shape of the resulting field; must not be larger in any dimension than the corresponding dimension of the input field
The trimmed field.
Multiply each number in a field by -1.
Multiply each number in a field by -1.
The resulting field has the same field shape and tensor shape as this
.
The negative of the input field.
Upsample with zeroes inserted between field points, increasing the size of the input in all dimensions.
Upsample with zeroes inserted between field points, increasing the size of the input in all dimensions.
Example: for input field {1,2,3}
input.upsample(2) yields {1,0,2,0,3,0}
input.upsample(2,1) yields {0,1,0,2,0,3}
The sampling factor, defaults to 2.
The offset within the scaled up field to put the input data, defaults to an offset of 0.
Convert a vector field to a scalar field by extracting one element of each vector.
Convert a vector field to a scalar field by extracting one element of each vector.
The element of each vector to be extracted.
Input field with tensor order reduced by one.
Convert a vector field to a smaller vector field by extracting a dynamically indexed a range of elements
Convert a vector field to a smaller vector field by extracting a dynamically indexed a range of elements
Input field with tensor order reduced by one.
Implicit conversion of a Vector to a 0D constant VectorField which allows for fields to be combined with vectors in a simple way.
Implicit conversion of a Vector to a 0D constant VectorField which allows for fields to be combined with vectors in a simple way. This makes it possible to express commutative operations with a common syntax.
For example
Field + Vector
and
Vector + Field
are both legal and compilable with this implicit conversion.
The vector to be converted to a 0D vector field.
A 0D vector field initialized to v
.
Warps a 2D scalar, vector or matrix field, guided by a vector field called "the guide." The guide must either be zero-dimensional, in which case the input field is translated uniformly, or must be a 2D vector field with exactly the same shape as the input.
Warps a 2D scalar, vector or matrix field, guided by a vector field called "the guide." The guide must either be zero-dimensional, in which case the input field is translated uniformly, or must be a 2D vector field with exactly the same shape as the input.
The guiding vector with value (v1, v2) at a given point (row, col) extracts the element at location (row - v1, col - v2) as its output. If that location falls outside of the field, the BorderPolicy attached to the the opcode determines how the missing value is computed. If either of the guide vector components v1 and v2 is non-integral, bilinear interpolation is used to to determine the approximate value.
The guiding vector field.
Policy for handling borders.
Input field, warped by the guide.
Every hyperedge has a weight which is application defined.
Every hyperedge has a weight which is application defined.
Compute the "winner" of a scalar field by mapping its largest element to 1.0f and the other elements to 0.0f
Compute the "winner" of a scalar field by mapping its largest element to 1.0f and the other elements to 0.0f
This is not well-defined when multiple elements share the maximum value, so beware.
A scalar field with the same shape as the input, with a single element containing 1.0f and the rest containing 0.0f.
A multidimensional array of complex vectors.