127 template<
int Size=Dynamic,
typename Precision=DefaultPrecision,
typename Base=Internal::VBase>
128 struct Vector :
public Base::template VLayout<Size, Precision> {
131 typedef typename Base::template VLayout<Size, Precision>::PointerType
PointerType;
149 explicit inline Vector(
int size_in) : Base::template VLayout<Size, Precision>(size_in) {}
157 explicit inline Vector(PointerType data) : Base::template VLayout<Size, Precision> (data) {}
166 inline Vector(PointerType data,
int size_in) : Base::template VLayout<Size, Precision> (data, size_in) {}
170 : Base::template VLayout<Size, Precision>(data_in, size_in, stride_in) {}
172 using Base::template VLayout<Size, Precision>::size;
181 : Base::template VLayout<Size, Precision> (op)
196 template<
int Size2,
typename Precision2,
typename Base2>
198 Base::template VLayout<Size, Precision>(from.size()) {
204 #ifdef DOXYGEN_INCLUDE_ONLY_FOR_DOCS
219 Precision& operator[] (
int i);
224 const Precision& operator[] (
int i)
const;
237 this->try_destructive_resize(from.size());
240 for(
int i=0; i<s; i++){
249 template<
int Size2,
typename Precision2,
typename Base2>
251 this->try_destructive_resize(from.size());
254 for(
int i=0; i<s; i++){
266 this->try_destructive_resize(op);
277 for(
int i=0; i<size(); i++)
284 for(
int i=0; i<size(); i++)
290 template<
int Size2,
class Precision2,
class Base2>
293 for(
int i=0; i<size(); i++)
308 op.plusequals(*
this);
315 op.minusequals(*
this);
320 template<
int Size2,
class Precision2,
class Base2>
323 for(
int i=0; i<size(); i++)
334 template<
int Size2,
class Precision2,
class Base2>
337 for(
int i=0; i<size(); i++)
338 if((*
this)[i]!=rhs[i])
344 template<
int Size2,
class Precision2,
class Base2>
347 for(
int i=0; i<size(); i++)
348 if((*
this)[i]!=rhs[i])
364 #ifdef DOXYGEN_INCLUDE_ONLY_FOR_DOCS
385 Precision* get_data_ptr();
441 template<Start, Length>
457 template<Start, Length>
472 template<Start, Length>
488 template<Start, Length>
Vector & operator*=(const Precision &rhs)
multiply this vector by a constant
Vector(PointerType data_in, int size_in, int stride_in, Internal::Slicing)
internal constructor
Vector(const Vector< Size2, Precision2, Base2 > &from)
constructor from arbitrary vector
Base::template VLayout< Size, Precision >::PointerType PointerType
Everything lives inside this namespace.
static void test(int s1, int s2)
Vector & operator=(const Vector &from)
Vector & operator+=(const Vector< Size2, Precision2, Base2 > &rhs)
add another vector onto this one
bool operator==(const Vector< Size2, Precision2, Base2 > &rhs) const
Test for equality with another vector.
bool operator!=(const Vector< Size2, Precision2, Base2 > &rhs) const
Test for inequality with another vector.
Vector(const Operator< Op > &op)
Vector & operator-=(const Operator< Op > &op)
Vector & ref()
return me as a non const reference - useful for temporaries
Vector(PointerType data, int size_in)
Vector & operator+=(const Operator< Op > &op)
Vector & operator=(const Operator< Op > &op)
Vector & operator/=(const Precision &rhs)
divide this vector by a constant
Vector & operator-=(const Vector< Size2, Precision2, Base2 > &rhs)
subtract another vector from this one