Fn_ones

Functions

arma_inline const eOp< mat,
eop_ones_full
ones (const u32 n_rows, const u32 n_cols)
 Delayed generation of a dense matrix with all elements set to one.
arma_inline const eOpCube
< cube, eop_cube_ones_full
ones (const u32 n_rows, const u32 n_cols, const u32 n_slices)
arma_inline const eOp< colvec,
eop_ones_full
ones (const u32 n_elem)
 Generate a vector with all elements set to one.
arma_inline const eOp< mat,
eop_ones_diag
eye (const u32 n_rows, const u32 n_cols)
 Delayed generation of a diagonal matrix with the diagonal elements set to one.

Function Documentation

arma_inline const eOp< mat_type, eop_ones_full > ones ( const u32  n_rows,
const u32  n_cols 
) [inline]

Delayed generation of a dense matrix with all elements set to one.

Definition at line 48 of file fn_ones.hpp.

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_ones_full>(n_rows, n_cols);
00055   }

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

Definition at line 62 of file fn_ones.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_ones_full>(n_rows, n_cols, n_slices);
00069   }

arma_inline const eOp< vec_type, eop_ones_full > ones ( const u32  n_elem  )  [inline]

Generate a vector with all elements set to one.

Definition at line 88 of file fn_ones.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_ones_full>(1, n_elem);
00097     }
00098   else
00099     {
00100     return eOp<vec_type, eop_ones_full>(n_elem, 1);
00101     }
00102   }

arma_inline const eOp< mat_type, eop_ones_diag > eye ( const u32  n_rows,
const u32  n_cols 
) [inline]

Delayed generation of a diagonal matrix with the diagonal elements set to one.

Definition at line 121 of file fn_ones.hpp.

00122   {
00123   arma_extra_debug_sigprint();
00124   
00125   arma_type_check<is_Mat_only<mat_type>::value == false>::apply();
00126   
00127   return eOp<mat_type, eop_ones_diag>(n_rows, n_cols);
00128   }