00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef MTL_DENSE_EL_CURSOR_INCLUDE
00013 #define MTL_DENSE_EL_CURSOR_INCLUDE
00014
00015 #include <boost/numeric/mtl/mtl_fwd.hpp>
00016 #include <boost/numeric/mtl/detail/base_cursor.hpp>
00017
00018 namespace mtl {
00019
00021 template <typename Value>
00022 struct dense_el_cursor : public detail::base_cursor<const Value*>
00023 {
00024 typedef Value value_type;
00025 typedef const value_type* const_pointer_type;
00026 typedef detail::base_cursor<const Value*> super;
00027
00028 typedef dense_el_cursor self;
00029
00030 dense_el_cursor () {}
00031 dense_el_cursor (const_pointer_type me) : super(me) {}
00032 dense_el_cursor (super s) : super(s) {}
00033
00034 template <typename Parameters>
00035 dense_el_cursor(::mtl::dense2D<Value, Parameters> const& ma, size_t r, size_t c)
00036 : super(ma.elements() + ma.indexer(ma, r, c))
00037 {}
00038
00039 self operator+(int x) const
00040 {
00041 return self(super::operator+(x));
00042 }
00043
00044 int operator-(self const& x)
00045 {
00046 return super::operator-(x);
00047 }
00048 };
00049
00050 }
00051
00052 #endif // MTL_DENSE_EL_CURSOR_INCLUDE