Classes | |
class | lite::plane< dim_ > |
This transform, when applied to an array of dimension N, returns a reference array of dimension N-1 by fixing the index at dimension dim_. More... | |
class | lite::diagonal |
This transform returns a 1-D reference array that corresponds to the main diagonal of the array. More... | |
class | lite::transpose |
This transform returns a reference array that references the original array but its dimensions in revere order. More... | |
class | lite::block< n0_..., nN_ > |
This transform can be used to create a reference array that corresponds to a block of the original array. The resulting array will have equal or less dimensions. More... | |
struct | lite::transform_traits< array_type_, trans_type_ > |
This class provides information about applying a transform object to an array object. It can be used for example to get the exact type of the array that is returned as the result of applying a transform. More... | |
Namespaces | |
namespace | lite::transforms |
Imports all the array transforms. This namespace includes all the predefined transforms. | |
Typedefs | |
typedef plane< 0 > | lite::row |
This transform, when applied to an array of dimension N, returns a reference array of dimension N-1 by fixing the index at dimension 0. | |
typedef plane< 1 > | lite::column |
This transform, when applied to an array of dimension N (N must be at least 2), returns a reference array of dimension N-1 by fixing the index at dimension 0. |
An array transform usually creates a reference array that references all or part of another array. All the predefined transforms return a mutable reference array that can be used to modify the original array however in general this is not a requirement and a user-defined array may return an immutable array. The lite::array::operator[](const transform_type_&) can be used to apply a transform object to an array object. For example:
array<float[3][3]> a; a[row(0)] = 1;
In the above example, the a[row(0)]
returns an array with signature float[3]
. Sometimes, you may need to store a reference array to use it later. To do that you need to know the type of the reference array object that is returned as the result. The lite::transform_traits can be used to get the type of the array that results from applying a transform type to an array type (See lite::transform_traits for more information). For example:
typedef array<float[3][3]> Array; Array a; transform_traits<Array, row>::array r = a[row(0)]; r = 1;
The following are the predefined transforms:
You can import the namespace lite::transforms to import only the predefined transforms from the lite namespace.
For more information on how to define new transforms see Defining New Transforms.
typedef plane<1> lite::column |
This transform, when applied to an array of dimension N (N must be at least 2), returns a reference array of dimension N-1 by fixing the index at dimension 0.
When applied to a 2-dimensional array, it returns a reference to a column.
array<float[3][4]> a; // a 3x4 array a[column(2)] = -1; // left hand side is a float[3] reference array // the above line is equivalent to: for (int i=0; i<a.size().i0; i++) a(i, 2) = -1;
typedef plane<0> lite::row |
This transform, when applied to an array of dimension N, returns a reference array of dimension N-1 by fixing the index at dimension 0.
When applied to a 2-dimensional array, it returns a reference to a row.
array<float[3][4]> a; // a 3x4 array a[row(2)] = -1; // left hand side is a float[4] reference array // the above line is equivalent to: for (int j=0; j<a.size().i1; j++) a(2, j) = -1;