fn_rand.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 inline
00025 const Op<mat, op_rand>
00026 rand(const u32 n_rows, const u32 n_cols)
00027 {
00028 arma_extra_debug_sigprint();
00029
00030 return Op<mat, op_rand>(n_rows, n_cols, 'j');
00031 }
00032
00033
00034
00035 template<typename mat_type>
00036 inline
00037 const Op<mat_type,op_rand>
00038 rand(const u32 n_rows, const u32 n_cols)
00039 {
00040 arma_extra_debug_sigprint();
00041
00042 arma_type_check<is_Mat<mat_type>::value == false>::apply();
00043
00044 return Op<mat_type,op_rand>(n_rows, n_cols, 'j');
00045 }
00046
00047
00048
00049
00050 inline
00051 const Op<colvec, op_rand>
00052 rand(const u32 n_elem)
00053 {
00054 arma_extra_debug_sigprint();
00055
00056 return Op<colvec, op_rand>(n_elem, 1, 'j');
00057 }
00058
00059
00060
00061 template<typename vec_type>
00062 inline
00063 const Op<vec_type,op_rand>
00064 rand(const u32 n_elem)
00065 {
00066 arma_extra_debug_sigprint();
00067
00068 arma_type_check< (is_Col<vec_type>::value == false) && (is_Row<vec_type>::value == false) >::apply();
00069
00070 return Op<vec_type,op_rand>(n_elem, 0, 'j');
00071 }
00072
00073
00074