Fn_rand

Functions

arma_inline const eOp< mat,
eop_rand
rand (const u32 n_rows, const u32 n_cols)
 Generate a dense matrix with all elements set to random values in the [0,1] interval (uniform distribution).
arma_inline const eOpCube
< cube, eop_cube_rand
rand (const u32 n_rows, const u32 n_cols, const u32 n_slices)
arma_inline const eOp< colvec,
eop_rand
rand (const u32 n_elem)
 Generate a vector with all elements set to random values in the [0,1] interval (uniform distribution).

Function Documentation

arma_inline const eOp< mat_type, eop_rand > rand ( const u32  n_rows,
const u32  n_cols 
) [inline]

Generate a dense matrix with all elements set to random values in the [0,1] interval (uniform distribution).

Definition at line 48 of file fn_rand.hpp.

Referenced by op_shuffle::apply(), eop_aux_randn< eT >::operator eT(), and eop_aux_rand< eT >::operator eT().

00049   {
00050   arma_extra_debug_sigprint();
00051   
00052   arma_type_check<is_Mat<mat_type>::value == false>::apply();
00053   
00054   return eOp<mat_type, eop_rand>(n_rows, n_cols);
00055   }

arma_inline const eOpCube< cube_type, eop_cube_rand > rand ( const u32  n_rows,
const u32  n_cols,
const u32  n_slices 
) [inline]

Definition at line 62 of file fn_rand.hpp.

00063   {
00064   arma_extra_debug_sigprint();
00065   
00066   arma_type_check<is_Cube<cube_type>::value == false>::apply();
00067   
00068   return eOpCube<cube_type, eop_cube_rand>(n_rows, n_cols, n_slices);
00069   }

arma_inline const eOp< vec_type, eop_rand > rand ( const u32  n_elem  )  [inline]

Generate a vector with all elements set to random values in the [0,1] interval (uniform distribution).

Definition at line 88 of file fn_rand.hpp.

00089   {
00090   arma_extra_debug_sigprint();
00091   
00092   arma_type_check< (is_Col<vec_type>::value == false) && (is_Row<vec_type>::value == false) >::apply();
00093   
00094   if(is_Row<vec_type>::value == true)
00095     {
00096     return eOp<vec_type, eop_rand>(1, n_elem);
00097     }
00098   else
00099     {
00100     return eOp<vec_type, eop_rand>(n_elem, 1);
00101     }
00102   }