Public Types | Public Member Functions | Public Attributes

diagmat_proxy_check< Mat< eT > > Class Template Reference
[Diagmat_proxy]

#include <diagmat_proxy.hpp>

List of all members.

Public Types

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

Public Member Functions

 diagmat_proxy_check (const Mat< eT > &X, const Mat< eT > &out)
 ~diagmat_proxy_check ()
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< eT > * P_local
const Mat< eT > & P
const bool P_is_vec
const u32 n_elem

Detailed Description

template<typename eT>
class diagmat_proxy_check< Mat< eT > >

Definition at line 169 of file diagmat_proxy.hpp.


Member Typedef Documentation

template<typename eT >
typedef eT diagmat_proxy_check< Mat< eT > >::elem_type

Definition at line 173 of file diagmat_proxy.hpp.

template<typename eT >
typedef get_pod_type<elem_type>::result diagmat_proxy_check< Mat< eT > >::pod_type

Definition at line 174 of file diagmat_proxy.hpp.


Constructor & Destructor Documentation

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

Definition at line 177 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_local ( (&X == &out) ? new Mat<eT>(X) : 0  )
    , P       ( (&X == &out) ? (*P_local)     : X  )
    , 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" );
    }

template<typename eT >
diagmat_proxy_check< Mat< eT > >::~diagmat_proxy_check (  )  [inline]

Definition at line 188 of file diagmat_proxy.hpp.

    {
    if(P_local)
      {
      delete P_local;
      }
    }


Member Function Documentation

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

Definition at line 197 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 eT >
arma_inline elem_type diagmat_proxy_check< Mat< eT > >::at ( const u32  row,
const u32  col 
) const [inline]

Definition at line 198 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 eT >
const Mat<eT>* diagmat_proxy_check< Mat< eT > >::P_local

Definition at line 201 of file diagmat_proxy.hpp.

template<typename eT >
const Mat<eT>& diagmat_proxy_check< Mat< eT > >::P

Definition at line 202 of file diagmat_proxy.hpp.

template<typename eT >
const bool diagmat_proxy_check< Mat< eT > >::P_is_vec

Definition at line 203 of file diagmat_proxy.hpp.

template<typename eT >
const u32 diagmat_proxy_check< Mat< eT > >::n_elem

Definition at line 204 of file diagmat_proxy.hpp.