Flips the values of an array. More...

array flip (const array &in, unsigned dim)
 Flip array along a given dimension (base-zero index). More...
 

Detailed Description

Flips the values of an array.

This function will flip the values of an array along a dimension

Function Documentation

array af::flip ( const array &  in,
unsigned  dim 
)

Flip array along a given dimension (base-zero index).

float f[] = {1,2,3,4};
array a(2,2,f);
//a=[1 3]
// [2 4]
array b = flip(a,0);
//b=[2 4]
// [1 3]
array b = flip(a,1);
//b=[3 1]
// [4 2]
Parameters
[in]in(vector or matrix)
[in]dimdimension along which to flip
Returns
array with the elements along the specified dimension reversed
Examples:
examples/getting_started/integer.cpp.