fn_ones.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 inline
00024 const Op<mat,op_ones_full>
00025 ones(const u32 n_rows, const u32 n_cols)
00026 {
00027 arma_extra_debug_sigprint();
00028
00029 return Op<mat,op_ones_full>(n_rows, n_cols, 'j');
00030 }
00031
00032
00033
00034 template<typename mat_type>
00035 inline
00036 const Op<mat_type,op_ones_full>
00037 ones(const u32 n_rows, const u32 n_cols)
00038 {
00039 arma_extra_debug_sigprint();
00040
00041 arma_type_check<is_Mat<mat_type>::value == false>::apply();
00042
00043 return Op<mat_type,op_ones_full>(n_rows, n_cols, 'j');
00044 }
00045
00046
00047
00048
00049 inline
00050 const Op<colvec, op_ones_full>
00051 ones(const u32 n_elem)
00052 {
00053 arma_extra_debug_sigprint();
00054
00055 return Op<colvec, op_ones_full>(n_elem, 1, 'j');
00056 }
00057
00058
00059
00060 template<typename vec_type>
00061 inline
00062 const Op<vec_type, op_ones_full>
00063 ones(const u32 n_elem)
00064 {
00065 arma_extra_debug_sigprint();
00066
00067 arma_type_check< (is_Col<vec_type>::value == false) && (is_Row<vec_type>::value == false) >::apply();
00068
00069 return Op<vec_type, op_ones_full>(n_elem, 0, 'j');
00070 }
00071
00072
00073
00074
00075 inline
00076 const Op<mat,op_ones_diag>
00077 eye(const u32 n_rows, const u32 n_cols)
00078 {
00079 arma_extra_debug_sigprint();
00080
00081 return Op<mat,op_ones_diag>(n_rows, n_cols, 'j');
00082 }
00083
00084
00085
00086 template<typename mat_type>
00087 inline
00088 const Op<mat_type,op_ones_diag>
00089 eye(const u32 n_rows, const u32 n_cols)
00090 {
00091 arma_extra_debug_sigprint();
00092
00093 arma_type_check<is_Mat_only<mat_type>::value == false>::apply();
00094
00095 return Op<mat_type,op_ones_diag>(n_rows, n_cols, 'j');
00096 }
00097
00098
00099