00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 template<class Rep> class ConstDummyView;
00025
00027 template<class Rep>
00028 class DummyView : public DummyViewTag
00029 {
00030 public:
00031 typedef DummyView<Rep> self_type;
00032 typedef DummyViewTag exp_tag;
00033 typedef NullTag extra_param_type;
00034 typedef ConstDummyView<Rep> const_view_type;
00035 COMMON_VIEW_TYPEDEFS();
00036
00037 enum {
00038 ROWS = super_type::COLS,
00039 COLS = super_type::ROWS,
00040 IsLinear = true,
00041 IsLinearRecursive = IsLinear && super_type::IsLinearRecursive,
00042 TNOP = Rep::TNOP,
00043 ENOP = Rep::ENOP,
00044 EXPLevel = Rep::EXPLevel + 1
00045 };
00046
00048 typedef Mat<DenseMatCon<value_type,ROWS,COLS>, EmptyErrorChecker> temp_type;
00049
00050
00051
00052 EXMAT_INLINE2 DummyView(const self_type& self)
00053 : rep(self.rep) {}
00054 EXMAT_INLINE2 DummyView(super_type& mat)
00055 : rep(mat) {}
00057 template<class Rep2> EXMAT_INLINE2
00058 DummyView(const Rep2& self, super_type& mat)
00059 : rep(mat) {}
00060
00062 EXMAT_INLINE2 self_type operator=(const_param_type s) {
00063 rep = s;
00064 return *this;
00065 }
00066
00067
00068 EXMAT_INLINE2 size_t size() const { return rep.size(); }
00069 EXMAT_INLINE2 size_t rows() const { return rep.rows(); }
00070 EXMAT_INLINE2 size_t cols() const { return rep.cols(); }
00071
00072
00073 EXMAT_INLINE2 reference setAt(index_type i)
00074 { return rep.setAt(i); }
00075 EXMAT_INLINE2 const_reference getAt(index_type i) const
00076 { return rep.getAt(i); }
00077 EXMAT_INLINE2 reference setAt(index_type i, index_type j)
00078 { return rep.setAt(i, j); }
00079 EXMAT_INLINE2 const_reference getAt(index_type i, index_type j) const
00080 { return rep.getAt(i, j); }
00081 };
00085 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00086 Mat<ExpMat<DummyView<typename Rep::rep_type> >, ErrChk>
00087 dummy(Mat<Rep, ErrChk>& mat) {
00088 return ExpMat<DummyView<TTYPENAME Rep::rep_type> >(mat);
00089 }
00093 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00094 Vec<ExpMat<DummyView<typename Rep::rep_type> >, ErrChk>
00095 dummy(Vec<Rep, ErrChk>& vec) {
00096 return ExpMat<DummyView<TTYPENAME Rep::rep_type> >(vec);
00097 }
00098 #if HAVE_TT_PARAMETER
00099
00102 template<class Rep, class ErrChk, template<class Rep, class ErrChk> class RepT, template<class RepT> class MathClass >
00103 EXMAT_INLINE2 static MathClass<RepT<ExpMat<ConstDummyView<Rep> >, ErrChk> >
00104 dummy(MathClass<RepT<Rep, ErrChk> >& vec) {
00105 return MathClass<RepT<ExpMat<ConstDummyView<Rep> >, ErrChk> >(ExpMat<ConstDummyView<Rep> >(vec));
00106 }
00107 #endif // HAVE_TT_PARAMETER
00108
00109
00111 template<class Rep>
00112 class ConstDummyView : public DummyViewTag
00113 {
00114 public:
00115 typedef ConstDummyView<Rep> self_type;
00116 typedef DummyViewTag exp_tag;
00117 typedef NullTag extra_param_type;
00118 COMMON_CONST_VIEW_TYPEDEFS();
00119
00120 enum {
00121 ROWS = super_type::COLS,
00122 COLS = super_type::ROWS,
00123 IsLinear = false,
00124 IsLinearRecursive = IsLinear && super_type::IsLinearRecursive,
00125 TNOP = Rep::TNOP,
00126 ENOP = Rep::ENOP,
00127 EXPLevel = Rep::EXPLevel +1
00128 };
00129
00131 typedef Mat<DenseMatCon<value_type,ROWS,COLS>, EmptyErrorChecker> temp_type;
00132
00133
00134
00135 EXMAT_INLINE2 ConstDummyView(const self_type& self)
00136 : rep(self.rep) {}
00137 EXMAT_INLINE2 ConstDummyView(const super_type& mat)
00138 : rep(mat) {}
00140 template<class Rep2> EXMAT_INLINE2
00141 ConstDummyView(const Rep2& self, const super_type& mat)
00142 : rep(mat) {}
00143
00144
00145
00146 EXMAT_INLINE2 size_t size() const { return rep.size(); }
00147 EXMAT_INLINE2 size_t rows() const { return rep.cols(); }
00148 EXMAT_INLINE2 size_t cols() const { return rep.rows(); }
00149
00150
00151 EXMAT_INLINE2 const_reference getAt(index_type i) const
00152 { return rep.getAt(i); }
00153 EXMAT_INLINE2 const_reference getAt(index_type i, index_type j) const
00154 { return rep.getAt(i, j); }
00155 };
00159 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00160 const Mat<ExpMat<ConstDummyView<typename Rep::rep_type> >, ErrChk>
00161 dummy(const Mat<Rep, ErrChk>& mat) {
00162 return ExpMat<ConstDummyView<TTYPENAME Rep::rep_type> >(mat);
00163 }
00167 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00168 const Vec<ExpMat<ConstDummyView<typename Rep::rep_type> >, ErrChk>
00169 dummy(const Vec<Rep, ErrChk>& vec) {
00170 return ExpMat<ConstDummyView<TTYPENAME Rep::rep_type> >(vec);
00171 }
00172 #if HAVE_TT_PARAMETER
00173
00176 template<class Rep, class ErrChk, template<class Rep, class ErrChk> class RepT, template<class RepT> class MathClass >
00177 EXMAT_INLINE2 static const MathClass<RepT<ExpMat<ConstDummyView<Rep> >, ErrChk> >
00178 dummy(const MathClass<RepT<Rep, ErrChk> >& vec) {
00179 return ExpMat<ConstDummyView<Rep> >(vec);
00180 }
00181 #endif // HAVE_TT_PARAMETER