Fn_ones

Functions

const Op< mat, op_ones_fullones (const u32 n_rows, const u32 n_cols)
 Delayed generation of a dense matrix with all elements set to one.
const Op< colvec, op_ones_fullones (const u32 n_elem)
 Generate a vector with all elements set to one.
const Op< mat, op_ones_diageye (const u32 n_rows, const u32 n_cols)
 Delayed generation of a diagonal matrix with the diagonal elements set to one.
const OpCube< cube, op_ones_fullones (const u32 n_rows, const u32 n_cols, const u32 n_slices)
 Delayed generation of a dense cube with all elements set to one.

Function Documentation

const Op< mat_type, op_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 37 of file fn_ones.hpp.

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   }

const Op< vec_type, op_ones_full > ones ( const u32  n_elem  )  [inline]

Generate a vector with all elements set to one.

Definition at line 63 of file fn_ones.hpp.

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   if(is_Row<vec_type>::value == true)
00070     {
00071     return Op<vec_type, op_ones_full>(1, n_elem, 'j');
00072     }
00073   else
00074     {
00075     return Op<vec_type, op_ones_full>(n_elem, 1, 'j');
00076     }
00077   }

const Op< mat_type, op_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 96 of file fn_ones.hpp.

00097   {
00098   arma_extra_debug_sigprint();
00099   
00100   arma_type_check<is_Mat_only<mat_type>::value == false>::apply();
00101   
00102   return Op<mat_type,op_ones_diag>(n_rows, n_cols, 'j');
00103   }

const OpCube< cube_type, op_ones_full > ones ( const u32  n_rows,
const u32  n_cols,
const u32  n_slices 
) [inline]

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

Definition at line 130 of file fn_ones.hpp.

00131   {
00132   arma_extra_debug_sigprint();
00133   
00134   arma_type_check<is_Cube<cube_type>::value == false>::apply();
00135   
00136   return OpCube<cube_type,op_ones_full>(n_rows, n_cols, n_slices);
00137   }