Public Types | Public Member Functions | Public Attributes

diagmat_proxy_check< T1 > Class Template Reference
[Diagmat_proxy]

#include <diagmat_proxy.hpp>

List of all members.

Public Types

typedef T1::elem_type elem_type
typedef get_pod_type
< elem_type >::result 
pod_type

Public Member Functions

 diagmat_proxy_check (const Base< typename T1::elem_type, T1 > &X, const Mat< typename T1::elem_type > &out)
arma_inline elem_type operator[] (const u32 i) const
arma_inline elem_type at (const u32 row, const u32 col) const

Public Attributes

const Mat< elem_typeP
const bool P_is_vec
const u32 n_elem

Detailed Description

template<typename T1>
class diagmat_proxy_check< T1 >

Definition at line 140 of file diagmat_proxy.hpp.


Member Typedef Documentation

template<typename T1>
typedef T1::elem_type diagmat_proxy_check< T1 >::elem_type

Definition at line 144 of file diagmat_proxy.hpp.

template<typename T1>
typedef get_pod_type<elem_type>::result diagmat_proxy_check< T1 >::pod_type

Definition at line 145 of file diagmat_proxy.hpp.


Constructor & Destructor Documentation

template<typename T1>
diagmat_proxy_check< T1 >::diagmat_proxy_check ( const Base< typename T1::elem_type, T1 > &  X,
const Mat< typename T1::elem_type > &  out 
) [inline]

Definition at line 147 of file diagmat_proxy.hpp.

References Mat< eT >::n_cols, Mat< eT >::n_rows, diagmat_proxy_check< T1 >::P, and diagmat_proxy_check< T1 >::P_is_vec.

    : P(X.get_ref())
    , P_is_vec( (P.n_rows == 1) || (P.n_cols == 1) )
    , n_elem( P_is_vec ? P.n_elem : P.n_rows )
    {
    arma_extra_debug_sigprint();
    arma_debug_check( (P_is_vec == false) && (P.n_rows != P.n_cols), "diagmat(): only vectors and square matrices are accepted" );
    }


Member Function Documentation

template<typename T1>
arma_inline elem_type diagmat_proxy_check< T1 >::operator[] ( const u32  i  )  const [inline]

Definition at line 157 of file diagmat_proxy.hpp.

References Mat< eT >::at(), diagmat_proxy_check< T1 >::P, and diagmat_proxy_check< T1 >::P_is_vec.

{ return P_is_vec ? P[i] : P.at(i,i);                                         }

template<typename T1>
arma_inline elem_type diagmat_proxy_check< T1 >::at ( const u32  row,
const u32  col 
) const [inline]

Definition at line 158 of file diagmat_proxy.hpp.

References Mat< eT >::at(), diagmat_proxy_check< T1 >::P, and diagmat_proxy_check< T1 >::P_is_vec.

{ return (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type(0); }


Member Data Documentation

template<typename T1>
const Mat<elem_type> diagmat_proxy_check< T1 >::P
template<typename T1>
const bool diagmat_proxy_check< T1 >::P_is_vec
template<typename T1>
const u32 diagmat_proxy_check< T1 >::n_elem

Definition at line 163 of file diagmat_proxy.hpp.

Referenced by glue_times_diag::apply().