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 ConstReverseVecView;
00025
00027 template<class Rep>
00028 class ReverseVecView : public ReverseVecViewTag
00029 {
00030 public:
00031 typedef ReverseVecView<Rep> self_type;
00032 typedef ReverseVecViewTag exp_tag;
00033 typedef NullTag extra_param_type;
00034 typedef ConstReverseVecView<Rep> const_view_type;
00035 COMMON_VIEW_TYPEDEFS();
00036
00037 enum {
00038 ROWS = super_type::ROWS,
00039 COLS = super_type::COLS,
00040 IsLinear = false,
00041 IsLinearRecursive = IsLinear && super_type::IsLinearRecursive,
00042 TNOP = Rep::TNOP,
00043 ENOP = Rep::ENOP,
00044 EXPLevel = Rep::EXPLevel +1
00045 };
00046
00048 typedef Vec<DenseMatCon<value_type,ROWS,COLS>, EmptyErrorChecker> temp_type;
00049
00050
00051
00052 EXMAT_INLINE2 ReverseVecView(const self_type& self)
00053 : rep(self.rep) {}
00054 EXMAT_INLINE2 ReverseVecView(super_type& vec)
00055 : rep(vec) {}
00057 template<class Rep2> EXMAT_INLINE2
00058 ReverseVecView(const Rep2& self, Rep& vec)
00059 : rep(vec) {}
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(size()-1-i); }
00075 EXMAT_INLINE2 const_reference getAt(index_type i) const
00076 { return rep.getAt(size()-1-i); }
00077 EXMAT_INLINE2 reference setAt(index_type i, index_type j)
00078 { return rep.setAt(rows()-1-i, cols()-1-j); }
00079 EXMAT_INLINE2 const_reference getAt(index_type i, index_type j) const
00080 { return rep.getAt(rows()-1-i, cols()-1-j); }
00081 };
00085 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00086 Vec<ExpMat<ReverseVecView<typename Rep::rep_type> >, ErrChk>
00087 reverse(Vec<Rep, ErrChk>& vec) {
00088 return ExpMat<ReverseVecView<TTYPENAME Rep::rep_type> >(vec);
00089 }
00090
00092 template<class Rep>
00093 class ConstReverseVecView : public ReverseVecViewTag
00094 {
00095 public:
00096 typedef ConstReverseVecView<Rep> self_type;
00097 typedef ReverseVecViewTag exp_tag;
00098 typedef NullTag extra_param_type;
00099 COMMON_CONST_VIEW_TYPEDEFS();
00100
00101 enum {
00102 ROWS = super_type::ROWS,
00103 COLS = super_type::COLS,
00104 IsLinear = false,
00105 IsLinearRecursive = IsLinear && super_type::IsLinearRecursive,
00106 TNOP = Rep::TNOP,
00107 ENOP = Rep::ENOP,
00108 EXPLevel = Rep::EXPLevel +1
00109 };
00110
00112 typedef Vec<DenseMatCon<value_type,ROWS,COLS>, EmptyErrorChecker> temp_type;
00113
00114
00115
00116 EXMAT_INLINE2 ConstReverseVecView(const self_type& self)
00117 : rep(self.rep) {}
00118 EXMAT_INLINE2 ConstReverseVecView(const super_type& vec_)
00119 : rep(vec_) {}
00121 template<class Rep2> EXMAT_INLINE2
00122 ConstReverseVecView(const Rep2& self, const Rep& vec)
00123 : rep(vec) {}
00124
00125
00126
00127 EXMAT_INLINE2 size_t size() const { return rep.size(); }
00128 EXMAT_INLINE2 size_t rows() const { return rep.rows(); }
00129 EXMAT_INLINE2 size_t cols() const { return rep.cols(); }
00130
00131
00132 EXMAT_INLINE2 const_reference getAt(index_type i) const
00133 { return rep.getAt(size()-1-i); }
00134 EXMAT_INLINE2 const_reference getAt(index_type i, index_type j) const
00135 { return rep.getAt(rows()-1-i, cols()-1-j); }
00136 };
00140 template<class Rep, class ErrChk> EXMAT_INLINE2 static
00141 const Vec<ExpMat<ConstReverseVecView<typename Rep::rep_type> >, ErrChk>
00142 reverse(const Vec<Rep, ErrChk>& vec) {
00143 return ExpMat<ConstReverseVecView<TTYPENAME Rep::rep_type> >(vec);
00144 }