Op_diagvec

Classes

class  op_diagvec

Functions

template<typename T1 >
static void op_diagvec::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_diagvec > &X)

Function Documentation

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

Definition at line 25 of file op_diagvec_meat.hpp.

References Op< T1, op_type >::aux_u32_a, Op< T1, op_type >::aux_u32_b, Mat< eT >::diag(), unwrap_check< T1 >::M, and Op< T1, op_type >::m.

00026   {
00027   arma_extra_debug_sigprint();
00028   
00029   typedef typename T1::elem_type eT;
00030   
00031   const s32 id = (X.aux_u32_b > 0) ? -s32(X.aux_u32_a) : s32(X.aux_u32_a);
00032   
00033   const unwrap_check<T1> tmp(X.m, out);
00034   const Mat<eT>& A     = tmp.M;
00035 
00036   out = A.diag(id);
00037   }