mat_ptrs_outcheck< glue_type, T1 > Struct Template Reference
[Glue_metaprog]

template metaprogram mat_ptrs_outcheck builds on 'mat_ptrs' by also checking whether any of the input matrices are aliases of the output matrix More...

#include <glue_metaprog.hpp>

List of all members.

Public Types

typedef T1::elem_type elem_type

Static Public Member Functions

static void get_ptrs (const Mat< elem_type > **ptrs, bool *del, const T1 &X, const Mat< elem_type > *out_ptr)

Static Public Attributes

static const u32 num = 0


Detailed Description

template<typename glue_type, typename T1>
struct mat_ptrs_outcheck< glue_type, T1 >

template metaprogram mat_ptrs_outcheck builds on 'mat_ptrs' by also checking whether any of the input matrices are aliases of the output matrix

Definition at line 133 of file glue_metaprog.hpp.


Member Typedef Documentation

template<typename glue_type , typename T1 >
typedef T1::elem_type mat_ptrs_outcheck< glue_type, T1 >::elem_type

Definition at line 135 of file glue_metaprog.hpp.


Member Function Documentation

template<typename glue_type , typename T1 >
static void mat_ptrs_outcheck< glue_type, T1 >::get_ptrs ( const Mat< elem_type > **  ptrs,
bool *  del,
const T1 &  X,
const Mat< elem_type > *  out_ptr 
) [inline, static]

Definition at line 143 of file glue_metaprog.hpp.

Referenced by mat_ptrs_outcheck< glue_type, Glue< T1, T2, glue_type > >::get_ptrs().

00149     {
00150 
00151     const bool same_ptr = 
00152       (
00153       is_Mat<T1>::value ?
00154         (
00155         (out_ptr == reinterpret_cast<const Mat<elem_type>*>(&X)) ?
00156           true
00157         :
00158           false
00159         )
00160       :
00161         false
00162       );
00163 
00164     
00165     ptrs[0] = 
00166       (
00167       same_ptr ?
00168         new Mat<elem_type>(X)
00169       :
00170         (
00171         is_Mat<T1>::value ?
00172           reinterpret_cast<const Mat<elem_type>*>(&X)
00173         :
00174           new Mat<elem_type>(X)
00175         )
00176       );
00177 
00178     
00179     del[0] = 
00180       (
00181       same_ptr ?
00182         true
00183       :
00184         (
00185         is_Mat<T1>::value ?
00186           false
00187         :
00188           true
00189         )
00190       );
00191 
00192     
00193     }


Member Data Documentation

template<typename glue_type , typename T1 >
const u32 mat_ptrs_outcheck< glue_type, T1 >::num = 0 [static]