5 #ifndef USML_TYPES_SEQ_VECTOR_H
6 #define USML_TYPES_SEQ_VECTOR_H
8 #include <boost/numeric/ublas/vector.hpp>
9 #include <boost/numeric/ublas/io.hpp>
14 using boost::numeric::ublas::vector;
36 class USML_DECLSPEC
seq_vector:
public vector_container<seq_vector>
47 typedef vector<value_type>::const_reference
reference;
121 return _increment[index] ;
150 return _data.begin() ;
166 return _data.rbegin() ;
174 return _data.rend() ;
182 return _data.find(index) ;
199 virtual size_type find_index(value_type value) = 0;
209 _data(size), _increment(size), _size(size), _max_index(size-1)
219 _data(copy._data), _increment(copy._increment),
220 _size(copy._size), _max_index(copy._max_index)
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_max< typename E1::value_type, T2 > >::result_type >::type max(const matrix_expression< E1 > &e1, const T2 &e2)
Maximum between a matrix and a scalar.
Definition: matrix_math.h:143
value_type increment(size_type index) const
Retrieves the increment between two elements in this sequence.
Definition: seq_vector.h:119
seq_vector(const seq_vector ©)
Copies data from another seq_vector object.
Definition: seq_vector.h:218
vector_reference< self_type > closure_type
Definition: seq_vector.h:51
vector< value_type >::const_reference reference
Definition: seq_vector.h:47
vector< value_type > _increment
Cache of increment values.
Definition: seq_vector.h:106
const_iterator find(size_type index) const
Create iterator for a random position in the sequence.
Definition: seq_vector.h:181
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_min< typename E1::value_type, T2 > >::result_type >::type min(const matrix_expression< E1 > &e1, const T2 &e2)
Minimum between a matrix and a scalar.
Definition: matrix_math.h:158
seq_vector self_type
Definition: seq_vector.h:41
const_iterator end() const
Create iterator for the end of sequence.
Definition: seq_vector.h:157
vector< value_type >::storage_category storage_category
Definition: seq_vector.h:52
vector< value_type >::const_reference const_reference
Definition: seq_vector.h:46
const_reverse_iterator rend() const
Create iterator for the end of reverse sequence.
Definition: seq_vector.h:173
const size_type _size
Number of elements in the sequence.
Definition: seq_vector.h:129
vector< value_type >::const_iterator const_iterator
Definition: seq_vector.h:54
const_reverse_iterator rbegin() const
Create iterator for the beginning of reverse sequence.
Definition: seq_vector.h:165
size_type size() const
Returns the number of elements in this sequence.
Definition: seq_vector.h:138
reverse_iterator_base< const_iterator > const_reverse_iterator
Definition: seq_vector.h:55
virtual value_type operator()(size_type index) const
Retrieves the value at a specified index in the sequence in the safest way possible.
Definition: seq_vector.h:87
vector< value_type >::size_type size_type
Definition: seq_vector.h:44
value_type operator[](size_type index) const
Retrieves the value at a specified index in the sequence in the fastest way possible.
Definition: seq_vector.h:75
seq_vector(size_type size)
Initialize data caches.
Definition: seq_vector.h:208
const size_type _max_index
Largest valid index number (one less than _size).
Definition: seq_vector.h:132
const vector_reference< const self_type > const_closure_type
Definition: seq_vector.h:50
vector< value_type > _data
Cache of sequence values.
Definition: seq_vector.h:64
vector< value_type >::difference_type difference_type
Definition: seq_vector.h:45
const array_type & data() const
Convert seqence into a normal C++ array,.
Definition: seq_vector.h:95
A read-only, monotonic sequence of values.
Definition: seq_vector.h:36
vector< value_type >::array_type array_type
Definition: seq_vector.h:48
virtual ~seq_vector()
Virtual destructor.
Definition: seq_vector.h:226
double value_type
Definition: seq_vector.h:43
const_iterator begin() const
Create iterator for the beginning of sequence.
Definition: seq_vector.h:149