Reference the entire dimension. More...

seq span
 Reference entire dimension. More...

Detailed Description

Reference the entire dimension.

Variable Documentation

seq span

Reference entire dimension.

The span operator is used to specify the indexing to use the entire dimension. It is equivalent to doing the following:

seq(0, end)

seq(0, dims(x) - 1), where x is 0, 1, 2, or 3.

The span operator is very useful in subscript indexing.

float hA[] = { 0,1,2,3,4,5 };
array A(2,3,hA);
A(span,1) // reference second column: {2 3}
A(span) // entire array flattened as column vector
See Also
examples/getting_started/gfor.cpp, examples/getting_started/integer.cpp, examples/helloworld/helloworld.cpp, examples/image_processing/image_demo.cpp, examples/machine_learning/kmeans.cpp, examples/machine_learning/neuralnetwork.cpp, examples/pde/fdtd.cpp, and examples/visualization/blip.cpp.