Vector. More...

#include <Vector.h>

Public Member Functions

 Vector ()
 Default constructor.
 
 Vector (T x0)
 
 Vector (T x0, T x1)
 
 Vector (T x0, T x1, T x2)
 
 Vector (T x0, T x1, T x2, T x3)
 
template<typename U >
 Vector (const Vector< N, U > &s)
 Construct from another Vector<U> instance.
 
template<typename U >
Vectoroperator= (const Vector< N, U > &s)
 Set this instance equal to another Vector<U> instance.
 
Vectoroperator= (const T &scalar)
 Set this instance equal to a scalar.
 
Vectoroperator+= (const Vector &s)
 Vector addition.
 
Vectoroperator-= (const Vector &s)
 Vector subtraction.
 
template<typename U >
Vectoroperator*= (const U &a)
 Scalar multiplication. More...
 
template<typename U >
Vectoroperator/= (const U &a)
 Scalar division.
 
bool operator== (const Vector &b) const
 Equality.
 
bool operator!= (const Vector &b) const
 Inequality.
 
T & operator[] (unsigned n)
 Access to elements.
 
const T operator[] (unsigned n) const
 Alternative access to elements.
 
unsigned size () const
 Dimension of data.
 

Static Public Member Functions

static const Vector basis (unsigned i)
 Return the basis vector.
 

Public Attributes

x [N]
 

Friends

template<typename U >
const friend Vector operator+ (Vector a, const Vector< N, U > &b)
 Vector addition.
 
template<typename U >
const friend Vector operator- (Vector a, const Vector< N, U > &b)
 Vector subtraction.
 
const friend Vector operator* (Vector a, T c)
 Scalar multiplication.
 
const friend Vector operator* (T c, Vector a)
 Scalar multiplication.
 
const friend T operator* (const Vector &a, const Vector &b)
 Dot product.
 
const friend Vector operator/ (Vector a, T c)
 Scalar division.
 
const friend Vector operator- (Vector s)
 Negation.
 

Detailed Description

template<unsigned N, typename T>
class Vector< N, T >

Vector.

Member Function Documentation

◆ operator*=()

template<unsigned N, typename T>
template<typename U >
Vector& Vector< N, T >::operator*= ( const U &  a)
inline

Scalar multiplication.

Vector multiplication Vector& operator *= (const Vector& s) { *this = *this * s; return *this; }


The documentation for this class was generated from the following file:

Generated using doxygen 1.8.14