Access one or more rows of an array. More...

array row (int index) const
 Access row index to form row vector. More...
 
array rows (int first, int last) const
 Access rows first through last to form a matrix (inclusive). More...
 

Detailed Description

Access one or more rows of an array.

The row indexing functions return elements located in the specified row(s).

If the array is 3-dimensional or higher, then the specified rows from all slices are returned.

Function Documentation

array row ( int  index) const
inline

Access row index to form row vector.

\code
float f[] = {1,2,3,4};
array a(2,2,f); //a=[1 3]
// [2 4]
array b = a.row(1); //b = [2 4]
Parameters
[in]indexrow index
Returns
Returns an array of size 1 x dims(1) x dims(2)
Note
Cannot be used in gfor. Use array(index, span, span) instead.
Complex Support
OpenCL Support
CUDA Support
Examples:
examples/getting_started/integer.cpp, and examples/helloworld/helloworld.cpp.
array rows ( int  first,
int  last 
) const
inline

Access rows first through last to form a matrix (inclusive).

float f[] = {1,2,3,4,5,6};
array a(3,2,f); //a=[1 4]
// [2 5]
// [3 6]
array b = a.rows(1,2); //b=[2 5]
// [3 6]
Parameters
[in]firstbeginning row index
[in]lastend row index
Returns
Returns an array of size (last - first + 1) x dims(1) x dims(2)
Note
Cannot be used in gfor. Use array(seq(first, last), span, span) instead.
Complex Support
OpenCL Support
CUDA Support