00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00030 #ifdef _MSC_VER
00031 # pragma once
00032 #endif // _MSC_VER
00033
00034 #ifndef _EXMAT_TAG2BINEXP_H
00035 #define _EXMAT_TAG2BINEXP_H
00036
00037 namespace exmat {
00038
00039
00041 #if (HAVE_TT_PARAMETER)
00042
00043 template<class Exp, class NewRep, class newExtraParam> struct RefillUnaExp;
00044 template<template<class> class Exp, class Rep, class NewRep, class newExtraParam>
00045 struct RefillUnaExp< Exp<Rep>, NewRep, newExtraParam> {
00046 typedef typename Exp<NewRep>::const_view_type RET;
00047 };
00048 template<template<class,class> class Exp, class Rep, class ExtraParam, class NewRep, class newExtraParam>
00049 struct RefillUnaExp< Exp<Rep,ExtraParam>, NewRep, newExtraParam> {
00050 typedef typename Exp<NewRep, newExtraParam>::const_view_type RET;
00051 };
00052
00053 template<class Exp, class newL, class newR> struct RefillBinExp;
00054 template<template<class,class,class> class Exp, class L, class R, class SpecTag, class newL, class newR>
00055 struct RefillBinExp< Exp<L,R,SpecTag>, newL, newR> {
00056 typedef Exp<newL, newR, SpecTag> RET;
00057 };
00058
00059 #else
00060
00061
00062 template<class Rep> class ConstTransView;
00063 template<class Rep> class ConstReverseVecView;
00064 template<class Rep> class ConstRowView;
00065 template<class Rep> class ConstColView;
00066 template<class Rep, class ExtraTParam> class StaticConstSubVecView;
00067 template<class Rep> class DynConstSubVecView;
00068 template<class Rep, class ExtraTParam> class StaticConstSubMatView;
00069 template<class Rep> class DynConstSubMatView;
00070 template<class Rep1, class Rep2> class ConstHMergeView;
00071 template<class Rep, class ExtraTParam> class StaticConstMinorView;
00072 template<class Rep> class DynConstMinorView;
00073 template<class Rep> class ConstCofactorsView;
00074
00076 template<class ExpTag, class Rep, class ExtraTParam>
00077 struct Tag2UnaExp {
00078 protected:
00079 template<class ExpTag> struct selector {
00080 };
00081
00082 template<> struct selector<TransposeViewTag> {
00083 typedef ConstTransView<Rep> RET;
00084 };
00085
00086 template<> struct selector<ReverseVecViewTag> {
00087 typedef ConstReverseVecView<Rep> RET;
00088 };
00089
00090 template<> struct selector<RowViewTag> {
00091 typedef ConstRowView<Rep> RET;
00092 };
00093
00094 template<> struct selector<ColViewTag> {
00095 typedef ConstColView<Rep> RET;
00096 };
00097
00098 template<> struct selector<StaticSubVecViewTag> {
00099 typedef StaticConstSubVecView<Rep, ExtraTParam> RET;
00100 };
00101 template<> struct selector<DynSubVecViewTag> {
00102 typedef DynConstSubVecView<Rep> RET;
00103 };
00104
00105 template<> struct selector<StaticSubMatViewTag> {
00106 typedef StaticConstSubMatView<Rep, ExtraTParam> RET;
00107 };
00108 template<> struct selector<DynSubMatViewTag> {
00109 typedef DynConstSubMatView<Rep> RET;
00110 };
00111
00112 template<> struct selector<StaticMinorViewTag> {
00113 typedef StaticConstMinorView<Rep, ExtraTParam> RET;
00114 };
00115 template<> struct selector<DynMinorViewTag> {
00116 typedef DynConstMinorView<Rep> RET;
00117 };
00118
00119 template<> struct selector<CofactorsViewTag> {
00120 typedef ConstCofactorsView<Rep> RET;
00121 };
00122 public:
00123 typedef selector<ExpTag>::RET RET;
00124 };
00125
00126 template<class ExpTag, class L, class R>
00127 struct Tag2BinExp {
00128 protected:
00129 template<class ExpTag> struct selector {
00130 };
00131 template<> struct selector<AddExpTag> {
00132 typedef AddExp<L, R> RET;
00133 };
00134 template<> struct selector<SubExpTag> {
00135 typedef SubExp<L, R> RET;
00136 };
00137 template<> struct selector<MulExpTag> {
00138 typedef MulExp<L, R> RET;
00139 };
00140 template<> struct selector<ScalarMulExpTag> {
00141 typedef ScalarMulExp<L, R> RET;
00142 };
00143 template<> struct selector<ScalarDivExpTag> {
00144 typedef ScalarDivExp<L, R> RET;
00145 };
00146 template<> struct selector<HMergeViewTag> {
00147 typedef ConstHMergeView<L, R> RET;
00148 };
00149 public:
00150 typedef selector<ExpTag>::RET RET;
00151 };
00152
00153 #endif // HAVE_TT_PARAMETER
00154
00155 }
00156
00157 #endif // _EXMAT_TAG2BINEXP_H