# | Line 126 | Line 126 | namespace oopse { | |
---|---|---|
126 | DynamicVector(_InputIterator first, _InputIterator last, | |
127 | const allocator_type& alloc = allocator_type()) | |
128 | : std::vector<Real, Alloc>(first, last, alloc) {} | |
129 | < | |
129 | > | |
130 | > | inline Real operator()(unsigned int i) const{ |
131 | > | return (*this)[i]; |
132 | > | } |
133 | > | |
134 | > | inline Real& operator()(unsigned int i){ |
135 | > | return (*this)[i]; |
136 | > | } |
137 | /** | |
138 | * Tests if this vetor is equal to other vector | |
139 | * @return true if equal, otherwise return false | |
# | Line 300 | Line 307 | namespace oopse { | |
307 | inline bool isNormalized() { | |
308 | return equal(lengthSquare(), 1.0); | |
309 | } | |
310 | + | |
311 | + | template<class VectorType> |
312 | + | void getSubVector(unsigned int beginning, VectorType& v) { |
313 | + | assert(beginning + v.size() -1 <= this->size()); |
314 | + | |
315 | + | for (unsigned int i = 0; i < v.size(); ++i) |
316 | + | v(i) = (*this)[beginning+i]; |
317 | + | } |
318 | + | |
319 | ||
320 | }; | |
321 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |