#ifndef __BASE_VECTOR_ #define __BASE_VECTOR_ #include #include #include #include #include //! \file base_vector.h using namespace boost::numeric::ublas; namespace rpl { //! base class for math vector /*! * this class is just an alias on vectors from ublas, with a static allocator */ template struct base_vector : boost::numeric::ublas::vector > { // we need only of order 8 vector -> 8 elements typedef bounded_array storage_type; typedef boost::numeric::ublas::vector type; base_vector(rpl_size_t size = 0) : type(size) {} base_vector(rpl_size_t c, rpl_size_t s) : type(s) { if (s != c) { std::cerr << "problem in base_vector cstr size != capa" << std::endl; assert(-1); } } base_vector(const base_vector & a) : type(a) {} template base_vector(const vector_expression & ve) : type(ve) {} base_vector(const T *a, size_t l) : type(l) { std::copy(a, a+l, type::begin()); } base_vector & operator= (const base_vector& a) { if (this != &a) // Beware of self-assignment type::operator=(a); return *this;} ~base_vector() {} }; };// end namespace #endif