Fn_shuffle

Functions

template<typename T1 >
const Op< T1, op_shuffleshuffle (const Base< typename T1::elem_type, T1 > &X, const u32 dim=0)
 Shuffle the rows or the columns of a matrix or vector in random fashion. If dim = 0, shuffle the columns (default operation). If dim = 1, shuffle the rows.

Function Documentation

template<typename T1 >
const Op<T1, op_shuffle> shuffle ( const Base< typename T1::elem_type, T1 > &  X,
const u32  dim = 0 
) [inline]

Shuffle the rows or the columns of a matrix or vector in random fashion. If dim = 0, shuffle the columns (default operation). If dim = 1, shuffle the rows.

Definition at line 30 of file fn_shuffle.hpp.

References Base< elem_type, derived >::get_ref().

00031   {
00032   arma_extra_debug_sigprint();
00033   
00034   arma_debug_check( (dim > 1), "shuffle(): dim must be 0 or 1");
00035   
00036   return Op<T1, op_shuffle>(X.get_ref(), dim, 0);
00037   }