Indexing using the () operator. More...

array operator() (int index) const
 Access linear element at index. More...
 
array operator() (const seq &s) const
 Access linear sequence of elements. More...
 
array operator() (array indices) const
 Access elements specified by values in an index array. More...
 
array operator() (const seq &rows, const seq &cols) const
 Access submatrix sequence of elements. More...
 
array operator() (int row, int col) const
 Access the element at location (row, col). More...
 
array operator() (int row, const seq &y) const
 Access linear sequence of elements at location row and y seq of columns. More...
 
array operator() (int row, array columns) const
 Access linear sequence of elements at location row and columns array of indices of columns. More...
 
array operator() (const seq &x, int column) const
 Access linear sequence of elements at location row and column. More...
 
array operator() (const seq &rows, array columns) const
 Access elements along sequence row and index array column. More...
 
array operator() (array rows, int column) const
 Access elements along index array rows and location column. More...
 
array operator() (array rows, const seq &columns) const
 Access elements along index array rows and sequence of columns. More...
 
array operator() (array rows, array columns) const
 Access elements along index array rows and index array columns. More...
 
array operator() (int x, int y, int z) const
 Access elements at location row x, column y and slice z. More...
 
array operator() (const seq &x, int y, int z) const
 Access elements at sequence of rows x, column y and slice z. More...
 
array operator() (int x, const seq &y, int z) const
 Access elements at row x, sequence of columns y and slice z. More...
 
array operator() (int x, int y, const seq &z) const
 Access elements at row x, column y, and sequence of slices z. More...
 
array operator() (int x, const seq &y, const seq &z) const
 Access elements at row x, sequence of columns y, and sequence of slices z. More...
 
array operator() (const seq &x, const seq &y, int z) const
 Access elements at sequence of rows x, sequence of columns y, and slice z. More...
 
array operator() (const seq &x, int y, const seq &z) const
 Access elements at sequence of rows x, column y, and sequence of slices z. More...
 
array operator() (const seq &x, const seq &y, const seq &z) const
 Access elements at sequence of rows x, sequence of columns y, and sequence of slices z. More...
 
array operator() (array rows, array cols, const seq &slices) const
 Access elements at array of row indices rows, array of column indices cols, and sequence of slices slices. More...
 
array operator() (array rows, array cols, int slice) const
 Access elements at array of row indices rows, array of column indices cols, and slice. More...
 
array operator() (array rows, const seq &cols, const seq &slices) const
 Access elements at array of row indices rows, sequence of column indices cols, and sequence of slice indices slices. More...
 
array operator() (array rows, const seq &cols, int slice) const
 Access elements at array of row indices rows, sequence of column indices cols, and slice. More...
 
array operator() (const seq &rows, array cols, const seq &slices) const
 Access elements at sequence of row indices rows, array of column indices cols, and sequence of slice indices slices. More...
 
array operator() (const seq &rows, const seq &cols, array slices) const
 Access elements at sequence of row indices rows, sequence of column indices cols, and array of slice indices slices. More...
 
array operator() (const seq &w, const seq &x, const seq &y, const seq &z) const
 Access volume. More...
 
array operator() (const seq &w, const seq &x, const seq &y, int z) const
 Access volume. More...
 
array operator() (const seq &w, const seq &x, int y, int z) const
 Access volume. More...
 
array operator() (const int w, const seq &x, const seq &y, const seq &z) const
 Access volume. More...
 
array operator() (const seq &w, const int x, const seq &y, const seq &z) const
 Access volume. More...
 
array operator() (const seq &w, const seq &x, const int y, const seq &z) const
 Access volume. More...
 
array operator() (const int w, const int x, const int y, const int z) const
 Access volume. More...
 

Detailed Description

Indexing using the () operator.

Function Documentation

array operator() ( int  index) const
inline

Access linear element at index.

This function returns a single valued array containing the element at location index.

float f[] = {1,2,3,4,5,6,7,8};
array a(2,2,2,f); //a=[1 3][5 6]
// [2 4][7 8]
array b = a(5); //b=[6]
Parameters
[in]indexlinear index
Returns
Returns an array containing a single element (size 1 x 1 x 1).
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq s) const

Access linear sequence of elements.

This function returns as array containing the elements at the index locations specified by the s seq.

float f[] = {1,2,3,4,5,6,7,8};
array a(2,2,2,f); //a=[1 3][5 6]
// [2 4][7 8]
array b = a(seq(3)); //b=[1,2,3]
array c = a(seq(3,6)) //c=[4 5 6 7]
Parameters
[in]ssequence of linear indices
Returns
Returns an array of size defined by seq s
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  indices) const

Access elements specified by values in an index array.

This function returns as array containing the elements at the index locations specified by the input array parameter.

float f[] = {7,3,6,9,2,3,1,5};
array a(2,2,2,f); //a=[7 6][2 1]
// [3 9][3 5]
float g[] = {0,3,5,7};
array b(4, g) //b=[0 3 5 7]
array c = a(b) //c=[1 4 6 8]
Parameters
[in]indicessequence of linear indices
Returns
Returns an array of size equal to the indices array.
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq rows,
const seq cols 
) const

Access submatrix sequence of elements.

This function returns as array containing the elements within the row and column sequences defined by row and column sequences for slice 0.

float f[] = {1,2,3,4,5,6,7,8,9};
array a(3,3,f); //a=[1 2 3]
// [4 5 6]
// [7 8 9]
array b = a(seq(1,2), seq(2)); //b=[2 3]
// [5 6]
Parameters
[in]rowssequence of linear rows
[in]colssequence of linear cols
Returns
Returns an array of the submatrix of size rows x cols
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  row,
int  col 
) const
inline

Access the element at location (row, col).

This function returns as array containing the elements at the index locations specified by the row and col .

float f[] = {7,3,6,9,2,3,1,5};
array a(2,2,2,f); //a=[7 6][2 1]
// [3 9][3 5]
array b = a(2, 1); //b=[6 1]
Parameters
[in]rowlocation of row index
[in]collocation of col index
Returns
Returns an array of size 1 x 1 x 1
Note
If using a volume, then (row, col) is equivalent to (row, col, 0).
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  row,
const seq y 
) const
inline

Access linear sequence of elements at location row and y seq of columns.

This function returns a row vector containing elements of the specified row at the columns specified by seq y

float f[] = {7,3,6,9,2,3,1,5};
array a(2,2,2,f); //a=[7 6][2 1]
// [3 9][3 5]
array b = a(1, seq(2)); //b=[7 6]
Parameters
[in]rowlocation of row index
[in]ysequence of column indices
Returns
Returns a row array of size of seq y
Note
If using a volume, then (row, (seq)y) is equivalent to (row, seq(y), 0).
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  row,
array  columns 
) const
inline

Access linear sequence of elements at location row and columns array of indices of columns.

This function returns a row vector containing elements of the specified row at the columns specified by array columns.

Parameters
[in]rowlocation of row index
[in]columnssequence of column indices
Returns
Returns a 2D array of size seq() x dims(2)
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq x,
int  column 
) const
inline

Access linear sequence of elements at location row and column.

This function returns a column vector containing elements of the specified column at the rows specified by seq x.

float f[] = {7,3,6,9,2,3,1,5};
array a(2,2,2,f); //a=[7 6][2 1]
// [3 9][3 5]
array b = a(seq(2), 1); //b=[6]
[9]
Parameters
[in]xsequence of row indices
[in]columnlocation of column index
Returns
Returns a column array of size of seq x
Note
If using a 3D matrix, then ((seq)row, column) is equivalent to (seq(row), column, 0).
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq rows,
array  columns 
) const

Access elements along sequence row and index array column.

This function returns a matrix containing elements of the rows specified by the seq rows at the columns specified by array colums.

Parameters
[in]rowssequence of row indices
[in]columnsarray of column indices
Returns
Returns a matrix of size of rows x size of columns
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
int  column 
) const
inline

Access elements along index array rows and location column.

Parameters
[in]rowsarray of row indices
[in]columnindex of column
Returns
Returns a row vector of size of rows
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
const seq columns 
) const

Access elements along index array rows and sequence of columns.

Parameters
[in]rowsarray of row indices
[in]columnssequence of column indices
Returns
Returns a matrix of size of rows x columns
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
array  columns 
) const

Access elements along index array rows and index array columns.

Parameters
[in]rowsarray of row indices
[in]columnsarray of column indices
Returns
Returns a matrix of size of rows x columns
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  x,
int  y,
int  z 
) const
inline

Access elements at location row x, column y and slice z.

Parameters
[in]xrow index
[in]ycolumn index
[in]zslice index
Returns
Returns a single element array
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq x,
int  y,
int  z 
) const
inline

Access elements at sequence of rows x, column y and slice z.

Parameters
[in]xsequence of row indices
[in]ycolumn index
[in]zslice index
Returns
Returns a row vector
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  x,
const seq y,
int  z 
) const
inline

Access elements at row x, sequence of columns y and slice z.

Parameters
[in]xrow index
[in]ysequence of column indices
[in]zslice index
Returns
Returns a column vector
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  x,
int  y,
const seq z 
) const
inline

Access elements at row x, column y, and sequence of slices z.

Parameters
[in]xrow index
[in]ycolumn index
[in]zsequence of slice indices
Returns
Returns a depth vector
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( int  x,
const seq y,
const seq z 
) const
inline

Access elements at row x, sequence of columns y, and sequence of slices z.

Parameters
[in]xrow index
[in]ysequence of column indices
[in]zsequence of slice indices
Returns
Returns a matrix of size 1 x y x z
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq x,
const seq y,
int  z 
) const
inline

Access elements at sequence of rows x, sequence of columns y, and slice z.

Parameters
[in]xsequence of row indices
[in]ysequence of column indices
[in]zslice index
Returns
Returns a matrix of size x x y x 1
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq x,
int  y,
const seq z 
) const
inline

Access elements at sequence of rows x, column y, and sequence of slices z.

Parameters
[in]xsequence of row indices
[in]ycolumn index
[in]zsequence of slice indices
Returns
Returns a matrix of size x x 1 x z
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq x,
const seq y,
const seq z 
) const

Access elements at sequence of rows x, sequence of columns y, and sequence of slices z.

Parameters
[in]xsequence of row indices
[in]ysequence of column indices
[in]zsequence of slice indices
Returns
Returns a volume of size x x y x z
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
array  cols,
const seq slices 
) const

Access elements at array of row indices rows, array of column indices cols, and sequence of slices slices.

Parameters
[in]rowsarray of row indices
[in]colsarray of column indices
[in]slicessequence of slice indices
Returns
Returns a volume of size rows x cols x slices
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
array  cols,
int  slice 
) const
inline

Access elements at array of row indices rows, array of column indices cols, and slice.

Parameters
[in]rowsarray of row indices
[in]colsarray of column indices
[in]sliceslice index
Returns
Returns a volume of size rows x cols x 1
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
const seq cols,
const seq slices 
) const

Access elements at array of row indices rows, sequence of column indices cols, and sequence of slice indices slices.

Parameters
[in]rowsarray of row indices
[in]colssequence of column indices
[in]slicessequence slice indices
Returns
Returns a volume of size rows x cols x slices
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( array  rows,
const seq cols,
int  slice 
) const
inline

Access elements at array of row indices rows, sequence of column indices cols, and slice.

Parameters
[in]rowsarray of row indices
[in]colsarray of column indices
[in]sliceslice index
Returns
Returns a volume of size rows x cols x 1
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq rows,
array  cols,
const seq slices 
) const

Access elements at sequence of row indices rows, array of column indices cols, and sequence of slice indices slices.

Parameters
[in]rowssequence of row indices
[in]colsarray of column indices
[in]slicessequence slice indices
Returns
Returns a volume of size rows x cols x slices
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq rows,
const seq cols,
array  slices 
) const

Access elements at sequence of row indices rows, sequence of column indices cols, and array of slice indices slices.

Parameters
[in]rowsslices of row indices
[in]colsslices of column indices
[in]slicesarray slice indices
Returns
Returns a volume of size rows x cols x slices
Complex Support
GFOR Support
OpenCL Support
CUDA Support
array operator() ( const seq w,
const seq x,
const seq y,
const seq z 
) const

Access volume.

Parameters
[in]wseq of rows
[in]xseq of columns
[in]yseq of slices
[in]zseq of grids
Returns
Returns a volume
Complex Support
OpenCL Support
CUDA Support
array operator() ( const seq w,
const seq x,
const seq y,
int  z 
) const
inline

Access volume.

Parameters
[in]wseq of rows
[in]xseq of columns
[in]yseq of slices
[in]zindex of grid
Returns
Returns a volume
Complex Support
OpenCL Support
CUDA Support
array operator() ( const seq w,
const seq x,
int  y,
int  z 
) const
inline

Access volume.

Parameters
[in]wseq of rows
[in]xseq of columns
[in]yindex of slice
[in]zindex of grid
Returns
Returns a volume
Complex Support
OpenCL Support
CUDA Support
array operator() ( const int  w,
const seq x,
const seq y,
const seq z 
) const
inline

Access volume.

Parameters
[in]windex of row
[in]xseq of columns
[in]yseq of slices
[in]zseq of grids
Returns
Returns a grid of rows
Complex Support
OpenCL Support
CUDA Support
array operator() ( const seq w,
const int  x,
const seq y,
const seq z 
) const
inline

Access volume.

Parameters
[in]wseq of rows
[in]xindex of column
[in]yseq of slices
[in]zseq of grids
Returns
Returns a grid of columns
Complex Support
OpenCL Support
CUDA Support
array operator() ( const seq w,
const seq x,
const int  y,
const seq z 
) const
inline

Access volume.

Parameters
[in]wseq of rows
[in]xseq of columns
[in]yindex of slice
[in]zseq of grids
Returns
Returns a grid of matrices
Complex Support
OpenCL Support
CUDA Support
array operator() ( const int  w,
const int  x,
const int  y,
const int  z 
) const
inline

Access volume.

Parameters
[in]windex of row
[in]xindex of column
[in]yindex of slice
[in]zindex of grid
Returns
Returns a single element
Complex Support
OpenCL Support
CUDA Support