Op_ones

Classes

class  op_ones_full
 Class for creation of a dense matrix/vector/cube with all elements set to one. More...
class  op_ones_diag

Functions

template<typename T1 >
static void op_ones_full::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_ones_full > &in)
template<typename eT >
static void op_ones_full::apply (Cube< eT > &out, const OpCube< Cube< eT >, op_ones_full > &in)
template<typename eT >
static void op_ones_diag::apply (Mat< eT > &out, const Op< Mat< eT >, op_ones_diag > &in)

Function Documentation

template<typename T1 >
void op_ones_full::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_ones_full > &  in 
) [inline, static, inherited]

Definition at line 22 of file op_ones_meat.hpp.

References Op< T1, op_type >::aux_u32_a, Op< T1, op_type >::aux_u32_b, and Mat< eT >::ones().

00023   {
00024   arma_extra_debug_sigprint();
00025   
00026   out.ones(in.aux_u32_a, in.aux_u32_b);
00027   }

template<typename eT >
void op_ones_full::apply ( Cube< eT > &  out,
const OpCube< Cube< eT >, op_ones_full > &  in 
) [inline, static, inherited]

Definition at line 34 of file op_ones_meat.hpp.

References Cube< eT >::ones().

00035   {
00036   arma_extra_debug_sigprint();
00037   
00038   out.ones(in.aux_u32_a, in.aux_u32_b, in.aux_u32_c);
00039   }

template<typename eT >
void op_ones_diag::apply ( Mat< eT > &  out,
const Op< Mat< eT >, op_ones_diag > &  in 
) [inline, static, inherited]

Definition at line 46 of file op_ones_meat.hpp.

References Mat< eT >::at(), Mat< eT >::n_rows, and Mat< eT >::zeros().

00047   {
00048   arma_extra_debug_sigprint();
00049   
00050   out.zeros(in.aux_u32_a, in.aux_u32_b);
00051   
00052   for(u32 i=0; i<out.n_rows; ++i)
00053     {
00054     out.at(i,i) = eT(1);
00055     }
00056   
00057   }