CubbyFlow::Vector< T, N > Class Template Referencefinal

Generic statically-sized N-D vector class. More...

#include <Core/Vector/Vector.h>

Inheritance diagram for CubbyFlow::Vector< T, N >:
CubbyFlow::VectorExpression< T, Vector< T, N > >

Public Types

using ContainerType = std::array< T, N >
 

Public Member Functions

 Vector ()
 Constructs a vector with zeros. More...
 
template<typename... Params>
 Vector (Params... params)
 Constructs vector instance with parameters. More...
 
template<typename U >
 Vector (const std::initializer_list< U > &list)
 Constructs vector instance with initializer list. More...
 
template<typename E >
 Vector (const VectorExpression< T, E > &other)
 Constructs vector with expression template. More...
 
 Vector (const Vector &other)
 Copy constructor. More...
 
void Set (const T &s)
 Sets all elements to s. More...
 
template<typename U >
void Set (const std::initializer_list< U > &list)
 Set vector instance with initializer list. More...
 
template<typename E >
void Set (const VectorExpression< T, E > &other)
 Sets vector with expression template. More...
 
void Set (const Vector &other)
 Set vector instance with other vector. More...
 
void Swap (Vector &other)
 Swaps the content of the vector with other vector. More...
 
void SetZero ()
 Sets all elements to zero. More...
 
void Normalize ()
 Normalizes this vector. More...
 
constexpr size_t size () const
 Returns the size of the vector. More...
 
T * data ()
 Returns the raw pointer to the vector data. More...
 
const T * data () const
 Returns the const raw pointer to the vector data. More...
 
ContainerType::iterator begin ()
 Returns the begin iterator of the vector. More...
 
ContainerType::const_iterator begin () const
 Returns the begin const iterator of the vector. More...
 
ContainerType::iterator end ()
 Returns the end iterator of the vector. More...
 
ContainerType::const_iterator end () const
 Returns the end const iterator of the vector. More...
 
ArrayAccessor1< T > Accessor ()
 Returns the array accessor. More...
 
ConstArrayAccessor1< T > ConstAccessor () const
 Returns the const array accessor. More...
 
At (size_t i) const
 Returns const reference to the i -th element of the vector. More...
 
T & At (size_t i)
 Returns reference to the i -th element of the vector. More...
 
Sum () const
 Returns the sum of all the elements. More...
 
Avg () const
 Returns the average of all the elements. More...
 
Min () const
 Returns the minimum element. More...
 
Max () const
 Returns the maximum element. More...
 
AbsMin () const
 Returns the absolute minimum element. More...
 
AbsMax () const
 Returns the absolute maximum element. More...
 
size_t DominantAxis () const
 Returns the index of the dominant axis. More...
 
size_t SubdominantAxis () const
 Returns the index of the subdominant axis. More...
 
VectorScalarDiv< T, VectorNormalized () const
 Returns normalized vector. More...
 
Length () const
 Returns the length of the vector. More...
 
LengthSquared () const
 Returns the squared length of the vector. More...
 
template<typename E >
DistanceTo (const E &other) const
 Returns the distance to the other vector. More...
 
template<typename E >
DistanceSquaredTo (const E &other) const
 Returns the squared distance to the other vector. More...
 
template<typename U >
VectorTypeCast< U, Vector< T, N >, T > CastTo () const
 Returns a vector with different value type. More...
 
template<typename E >
bool IsEqual (const E &other) const
 Returns true if other is the same as this vector. More...
 
template<typename E >
bool IsSimilar (const E &other, T epsilon=std::numeric_limits< T >::epsilon()) const
 Returns true if other is similar to this vector. More...
 
template<typename E >
VectorAdd< T, Vector, E > Add (const E &v) const
 Computes this + v. More...
 
VectorScalarAdd< T, VectorAdd (const T &s) const
 Computes this + (s, s, ... , s). More...
 
template<typename E >
VectorSub< T, Vector, E > Sub (const E &v) const
 Computes this - v. More...
 
VectorScalarSub< T, VectorSub (const T &s) const
 Computes this - (s, s, ... , s). More...
 
template<typename E >
VectorMul< T, Vector, E > Mul (const E &v) const
 Computes this * v. More...
 
VectorScalarMul< T, VectorMul (const T &s) const
 Computes this * (s, s, ... , s). More...
 
template<typename E >
VectorDiv< T, Vector, E > Div (const E &v) const
 Computes this / v. More...
 
VectorScalarDiv< T, VectorDiv (const T &s) const
 Computes this / (s, s, ... , s). More...
 
template<typename E >
Dot (const E &v) const
 Computes dot product. More...
 
VectorScalarRSub< T, VectorRSub (const T &s) const
 Computes (s, s, ... , s) - this. More...
 
template<typename E >
VectorSub< T, Vector, E > RSub (const E &v) const
 Computes v - this. More...
 
VectorScalarRDiv< T, VectorRDiv (const T &s) const
 Computes (s, s, ... , s) / this. More...
 
template<typename E >
VectorDiv< T, Vector, E > RDiv (const E &v) const
 Computes v / this. More...
 
void IAdd (const T &s)
 Computes this += (s, s, ... , s). More...
 
template<typename E >
void IAdd (const E &v)
 Computes this += v. More...
 
void ISub (const T &s)
 Computes this -= (s, s, ... , s). More...
 
template<typename E >
void ISub (const E &v)
 Computes this -= v. More...
 
void IMul (const T &s)
 Computes this *= (s, s, ... , s). More...
 
template<typename E >
void IMul (const E &v)
 Computes this *= v. More...
 
void IDiv (const T &s)
 Computes this /= (s, s, ... , s). More...
 
template<typename E >
void IDiv (const E &v)
 Computes this /= v. More...
 
template<typename Callback >
void ForEach (Callback func) const
 Iterates the vector and invoke given func for each element. More...
 
template<typename Callback >
void ForEachIndex (Callback func) const
 Iterates the vector and invoke given func for each index. More...
 
const T & operator[] (size_t i) const
 Returns the const reference to the i -th element. More...
 
T & operator[] (size_t)
 Returns the reference to the i -th element. More...
 
template<typename U >
Vectoroperator= (const std::initializer_list< U > &list)
 Set vector instance with initializer list. More...
 
template<typename E >
Vectoroperator= (const VectorExpression< T, E > &other)
 Sets vector with expression template. More...
 
Vectoroperator+= (const T &s)
 Computes this += (s, s, ... , s) More...
 
template<typename E >
Vectoroperator+= (const E &v)
 Computes this += v. More...
 
Vectoroperator-= (const T &s)
 Computes this -= (s, s, ... , s) More...
 
template<typename E >
Vectoroperator-= (const E &v)
 Computes this -= v. More...
 
Vectoroperator*= (const T &s)
 Computes this *= (s, s, ... , s) More...
 
template<typename E >
Vectoroperator*= (const E &v)
 Computes this *= v. More...
 
Vectoroperator/= (const T &s)
 Computes this /= (s, s, ... , s) More...
 
template<typename E >
Vectoroperator/= (const E &v)
 Computes this /= v. More...
 
template<typename E >
bool operator== (const E &v) const
 Returns true if other is the same as this vector. More...
 
template<typename E >
bool operator!= (const E &v) const
 Returns true if other is the not same as this vector. More...
 
template<typename E >
VectorAdd< T, Vector< T, N >, E > Add (const E &v) const
 
template<typename E >
VectorSub< T, Vector< T, N >, E > Sub (const E &v) const
 
template<typename E >
VectorMul< T, Vector< T, N >, E > Mul (const E &v) const
 
template<typename E >
VectorDiv< T, Vector< T, N >, E > Div (const E &v) const
 
template<typename E >
VectorSub< T, Vector< T, N >, E > RSub (const E &v) const
 
template<typename E >
VectorDiv< T, Vector< T, N >, E > RDiv (const E &v) const
 
template<typename U >
Vector< T, N > & operator= (const std::initializer_list< U > &list)
 
template<typename E >
Vector< T, N > & operator= (const VectorExpression< T, E > &other)
 
template<typename E >
Vector< T, N > & operator+= (const E &v)
 
template<typename E >
Vector< T, N > & operator-= (const E &v)
 
template<typename E >
Vector< T, N > & operator*= (const E &v)
 
template<typename E >
Vector< T, N > & operator/= (const E &v)
 
- Public Member Functions inherited from CubbyFlow::VectorExpression< T, Vector< T, N > >
size_t size () const
 Size of the vector. More...
 
const Vector< T, N > & operator() () const
 Returns actual implementation (the subclass). More...
 

Detailed Description

template<typename T, size_t N>
class CubbyFlow::Vector< T, N >

Generic statically-sized N-D vector class.

This class defines N-D vector data where its size is determined statically at compile time.

Template Parameters
T- Number type.
N- Dimension.

Member Typedef Documentation

◆ ContainerType

template<typename T, size_t N>
using CubbyFlow::Vector< T, N >::ContainerType = std::array<T, N>

Constructor & Destructor Documentation

◆ Vector() [1/5]

template<typename T , size_t N>
CubbyFlow::Vector< T, N >::Vector ( )

Constructs a vector with zeros.

◆ Vector() [2/5]

template<typename T , size_t N>
template<typename... Params>
CubbyFlow::Vector< T, N >::Vector ( Params...  params)
explicit

Constructs vector instance with parameters.

◆ Vector() [3/5]

template<typename T , size_t N>
template<typename U>
CubbyFlow::Vector< T, N >::Vector ( const std::initializer_list< U > &  list)

Constructs vector instance with initializer list.

◆ Vector() [4/5]

template<typename T, size_t N>
template<typename E>
CubbyFlow::Vector< T, N >::Vector ( const VectorExpression< T, E > &  other)

Constructs vector with expression template.

◆ Vector() [5/5]

template<typename T , size_t N>
CubbyFlow::Vector< T, N >::Vector ( const Vector< T, N > &  other)

Copy constructor.

Member Function Documentation

◆ AbsMax()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::AbsMax ( ) const

Returns the absolute maximum element.

◆ AbsMin()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::AbsMin ( ) const

Returns the absolute minimum element.

◆ Accessor()

template<typename T , size_t N>
ArrayAccessor1< T > CubbyFlow::Vector< T, N >::Accessor ( )

Returns the array accessor.

◆ Add() [1/3]

template<typename T, size_t N>
template<typename E >
VectorAdd<T, Vector, E> CubbyFlow::Vector< T, N >::Add ( const E &  v) const

Computes this + v.

◆ Add() [2/3]

template<typename T, size_t N>
VectorScalarAdd< T, Vector< T, N > > CubbyFlow::Vector< T, N >::Add ( const T &  s) const

Computes this + (s, s, ... , s).

◆ Add() [3/3]

template<typename T, size_t N>
template<typename E >
VectorAdd<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::Add ( const E &  v) const

◆ At() [1/2]

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::At ( size_t  i) const

Returns const reference to the i -th element of the vector.

◆ At() [2/2]

template<typename T , size_t N>
T & CubbyFlow::Vector< T, N >::At ( size_t  i)

Returns reference to the i -th element of the vector.

◆ Avg()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::Avg ( ) const

Returns the average of all the elements.

◆ begin() [1/2]

template<typename T , size_t N>
Vector< T, N >::ContainerType::iterator CubbyFlow::Vector< T, N >::begin ( )

Returns the begin iterator of the vector.

◆ begin() [2/2]

template<typename T , size_t N>
Vector< T, N >::ContainerType::const_iterator CubbyFlow::Vector< T, N >::begin ( ) const

Returns the begin const iterator of the vector.

◆ CastTo()

template<typename T , size_t N>
template<typename U >
VectorTypeCast< U, Vector< T, N >, T > CubbyFlow::Vector< T, N >::CastTo ( ) const

Returns a vector with different value type.

◆ ConstAccessor()

template<typename T , size_t N>
ConstArrayAccessor1< T > CubbyFlow::Vector< T, N >::ConstAccessor ( ) const

Returns the const array accessor.

◆ data() [1/2]

template<typename T , size_t N>
T * CubbyFlow::Vector< T, N >::data ( )

Returns the raw pointer to the vector data.

◆ data() [2/2]

template<typename T , size_t N>
const T * CubbyFlow::Vector< T, N >::data ( ) const

Returns the const raw pointer to the vector data.

◆ DistanceSquaredTo()

template<typename T , size_t N>
template<typename E >
T CubbyFlow::Vector< T, N >::DistanceSquaredTo ( const E &  other) const

Returns the squared distance to the other vector.

◆ DistanceTo()

template<typename T , size_t N>
template<typename E >
T CubbyFlow::Vector< T, N >::DistanceTo ( const E &  other) const

Returns the distance to the other vector.

◆ Div() [1/3]

template<typename T, size_t N>
template<typename E >
VectorDiv<T, Vector, E> CubbyFlow::Vector< T, N >::Div ( const E &  v) const

Computes this / v.

◆ Div() [2/3]

template<typename T, size_t N>
VectorScalarDiv< T, Vector< T, N > > CubbyFlow::Vector< T, N >::Div ( const T &  s) const

Computes this / (s, s, ... , s).

◆ Div() [3/3]

template<typename T, size_t N>
template<typename E >
VectorDiv<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::Div ( const E &  v) const

◆ DominantAxis()

template<typename T , size_t N>
size_t CubbyFlow::Vector< T, N >::DominantAxis ( ) const

Returns the index of the dominant axis.

◆ Dot()

template<typename T , size_t N>
template<typename E >
T CubbyFlow::Vector< T, N >::Dot ( const E &  v) const

Computes dot product.

◆ end() [1/2]

template<typename T , size_t N>
Vector< T, N >::ContainerType::iterator CubbyFlow::Vector< T, N >::end ( )

Returns the end iterator of the vector.

◆ end() [2/2]

template<typename T , size_t N>
Vector< T, N >::ContainerType::const_iterator CubbyFlow::Vector< T, N >::end ( ) const

Returns the end const iterator of the vector.

◆ ForEach()

template<typename T , size_t N>
template<typename Callback >
void CubbyFlow::Vector< T, N >::ForEach ( Callback  func) const

Iterates the vector and invoke given func for each element.

This function iterates the vector elements and invoke the callback function func. The callback function takes array's element as its input. The order of execution will be 0 to N-1 where N is the size of the vector. Below is the sample usage:

Vector<float, 2> vec(10, 4.f);
vec.ForEach([](float elem)
{
printf("%d\n", elem);
});

◆ ForEachIndex()

template<typename T , size_t N>
template<typename Callback >
void CubbyFlow::Vector< T, N >::ForEachIndex ( Callback  func) const

Iterates the vector and invoke given func for each index.

This function iterates the vector elements and invoke the callback function func. The callback function takes one parameter which is the index of the vector. The order of execution will be 0 to N-1 where N is the size of the array. Below is the sample usage:

Vector<float, 2> vec(10, 4.f);
vec.ForEachIndex([&](size_t i)
{
vec[i] = 4.f * i + 1.5f;
});

◆ IAdd() [1/2]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::IAdd ( const T &  s)

Computes this += (s, s, ... , s).

◆ IAdd() [2/2]

template<typename T , size_t N>
template<typename E >
void CubbyFlow::Vector< T, N >::IAdd ( const E &  v)

Computes this += v.

◆ IDiv() [1/2]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::IDiv ( const T &  s)

Computes this /= (s, s, ... , s).

◆ IDiv() [2/2]

template<typename T , size_t N>
template<typename E >
void CubbyFlow::Vector< T, N >::IDiv ( const E &  v)

Computes this /= v.

◆ IMul() [1/2]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::IMul ( const T &  s)

Computes this *= (s, s, ... , s).

◆ IMul() [2/2]

template<typename T , size_t N>
template<typename E >
void CubbyFlow::Vector< T, N >::IMul ( const E &  v)

Computes this *= v.

◆ IsEqual()

template<typename T , size_t N>
template<typename E >
bool CubbyFlow::Vector< T, N >::IsEqual ( const E &  other) const

Returns true if other is the same as this vector.

◆ IsSimilar()

template<typename T, size_t N>
template<typename E >
bool CubbyFlow::Vector< T, N >::IsSimilar ( const E &  other,
epsilon = std::numeric_limits<T>::epsilon() 
) const

Returns true if other is similar to this vector.

◆ ISub() [1/2]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::ISub ( const T &  s)

Computes this -= (s, s, ... , s).

◆ ISub() [2/2]

template<typename T , size_t N>
template<typename E >
void CubbyFlow::Vector< T, N >::ISub ( const E &  v)

Computes this -= v.

◆ Length()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::Length ( ) const

Returns the length of the vector.

◆ LengthSquared()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::LengthSquared ( ) const

Returns the squared length of the vector.

◆ Max()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::Max ( ) const

Returns the maximum element.

◆ Min()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::Min ( ) const

Returns the minimum element.

◆ Mul() [1/3]

template<typename T, size_t N>
template<typename E >
VectorMul<T, Vector, E> CubbyFlow::Vector< T, N >::Mul ( const E &  v) const

Computes this * v.

◆ Mul() [2/3]

template<typename T, size_t N>
VectorScalarMul< T, Vector< T, N > > CubbyFlow::Vector< T, N >::Mul ( const T &  s) const

Computes this * (s, s, ... , s).

◆ Mul() [3/3]

template<typename T, size_t N>
template<typename E >
VectorMul<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::Mul ( const E &  v) const

◆ Normalize()

template<typename T , size_t N>
void CubbyFlow::Vector< T, N >::Normalize ( )

Normalizes this vector.

◆ Normalized()

template<typename T , size_t N>
VectorScalarDiv< T, Vector< T, N > > CubbyFlow::Vector< T, N >::Normalized ( ) const

Returns normalized vector.

◆ operator!=()

template<typename T , size_t N>
template<typename E >
bool CubbyFlow::Vector< T, N >::operator!= ( const E &  v) const

Returns true if other is the not same as this vector.

◆ operator*=() [1/3]

template<typename T, size_t N>
Vector< T, N > & CubbyFlow::Vector< T, N >::operator*= ( const T &  s)

Computes this *= (s, s, ... , s)

◆ operator*=() [2/3]

template<typename T, size_t N>
template<typename E >
Vector& CubbyFlow::Vector< T, N >::operator*= ( const E &  v)

Computes this *= v.

◆ operator*=() [3/3]

template<typename T, size_t N>
template<typename E >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator*= ( const E &  v)

◆ operator+=() [1/3]

template<typename T, size_t N>
Vector< T, N > & CubbyFlow::Vector< T, N >::operator+= ( const T &  s)

Computes this += (s, s, ... , s)

◆ operator+=() [2/3]

template<typename T, size_t N>
template<typename E >
Vector& CubbyFlow::Vector< T, N >::operator+= ( const E &  v)

Computes this += v.

◆ operator+=() [3/3]

template<typename T, size_t N>
template<typename E >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator+= ( const E &  v)

◆ operator-=() [1/3]

template<typename T, size_t N>
Vector< T, N > & CubbyFlow::Vector< T, N >::operator-= ( const T &  s)

Computes this -= (s, s, ... , s)

◆ operator-=() [2/3]

template<typename T, size_t N>
template<typename E >
Vector& CubbyFlow::Vector< T, N >::operator-= ( const E &  v)

Computes this -= v.

◆ operator-=() [3/3]

template<typename T, size_t N>
template<typename E >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator-= ( const E &  v)

◆ operator/=() [1/3]

template<typename T, size_t N>
Vector< T, N > & CubbyFlow::Vector< T, N >::operator/= ( const T &  s)

Computes this /= (s, s, ... , s)

◆ operator/=() [2/3]

template<typename T, size_t N>
template<typename E >
Vector& CubbyFlow::Vector< T, N >::operator/= ( const E &  v)

Computes this /= v.

◆ operator/=() [3/3]

template<typename T, size_t N>
template<typename E >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator/= ( const E &  v)

◆ operator=() [1/4]

template<typename T, size_t N>
template<typename U >
Vector& CubbyFlow::Vector< T, N >::operator= ( const std::initializer_list< U > &  list)

Set vector instance with initializer list.

◆ operator=() [2/4]

template<typename T, size_t N>
template<typename E >
Vector& CubbyFlow::Vector< T, N >::operator= ( const VectorExpression< T, E > &  other)

Sets vector with expression template.

◆ operator=() [3/4]

template<typename T, size_t N>
template<typename U >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator= ( const std::initializer_list< U > &  list)

◆ operator=() [4/4]

template<typename T, size_t N>
template<typename E >
Vector<T, N>& CubbyFlow::Vector< T, N >::operator= ( const VectorExpression< T, E > &  other)

◆ operator==()

template<typename T , size_t N>
template<typename E >
bool CubbyFlow::Vector< T, N >::operator== ( const E &  v) const

Returns true if other is the same as this vector.

◆ operator[]() [1/2]

template<typename T , size_t N>
const T & CubbyFlow::Vector< T, N >::operator[] ( size_t  i) const

Returns the const reference to the i -th element.

◆ operator[]() [2/2]

template<typename T , size_t N>
T & CubbyFlow::Vector< T, N >::operator[] ( size_t  i)

Returns the reference to the i -th element.

◆ RDiv() [1/3]

template<typename T, size_t N>
VectorScalarRDiv< T, Vector< T, N > > CubbyFlow::Vector< T, N >::RDiv ( const T &  s) const

Computes (s, s, ... , s) / this.

◆ RDiv() [2/3]

template<typename T, size_t N>
template<typename E >
VectorDiv<T, Vector, E> CubbyFlow::Vector< T, N >::RDiv ( const E &  v) const

Computes v / this.

◆ RDiv() [3/3]

template<typename T, size_t N>
template<typename E >
VectorDiv<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::RDiv ( const E &  v) const

◆ RSub() [1/3]

template<typename T, size_t N>
VectorScalarRSub< T, Vector< T, N > > CubbyFlow::Vector< T, N >::RSub ( const T &  s) const

Computes (s, s, ... , s) - this.

◆ RSub() [2/3]

template<typename T, size_t N>
template<typename E >
VectorSub<T, Vector, E> CubbyFlow::Vector< T, N >::RSub ( const E &  v) const

Computes v - this.

◆ RSub() [3/3]

template<typename T, size_t N>
template<typename E >
VectorSub<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::RSub ( const E &  v) const

◆ Set() [1/4]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::Set ( const T &  s)

Sets all elements to s.

◆ Set() [2/4]

template<typename T , size_t N>
template<typename U >
void CubbyFlow::Vector< T, N >::Set ( const std::initializer_list< U > &  list)

Set vector instance with initializer list.

◆ Set() [3/4]

template<typename T, size_t N>
template<typename E >
void CubbyFlow::Vector< T, N >::Set ( const VectorExpression< T, E > &  other)

Sets vector with expression template.

◆ Set() [4/4]

template<typename T, size_t N>
void CubbyFlow::Vector< T, N >::Set ( const Vector< T, N > &  other)

Set vector instance with other vector.

◆ SetZero()

template<typename T , size_t N>
void CubbyFlow::Vector< T, N >::SetZero ( )

Sets all elements to zero.

◆ size()

template<typename T , size_t N>
constexpr size_t CubbyFlow::Vector< T, N >::size ( ) const

Returns the size of the vector.

◆ Sub() [1/3]

template<typename T, size_t N>
template<typename E >
VectorSub<T, Vector, E> CubbyFlow::Vector< T, N >::Sub ( const E &  v) const

Computes this - v.

◆ Sub() [2/3]

template<typename T, size_t N>
VectorScalarSub< T, Vector< T, N > > CubbyFlow::Vector< T, N >::Sub ( const T &  s) const

Computes this - (s, s, ... , s).

◆ Sub() [3/3]

template<typename T, size_t N>
template<typename E >
VectorSub<T, Vector<T, N>, E> CubbyFlow::Vector< T, N >::Sub ( const E &  v) const

◆ SubdominantAxis()

template<typename T , size_t N>
size_t CubbyFlow::Vector< T, N >::SubdominantAxis ( ) const

Returns the index of the subdominant axis.

◆ Sum()

template<typename T , size_t N>
T CubbyFlow::Vector< T, N >::Sum ( ) const

Returns the sum of all the elements.

◆ Swap()

template<typename T , size_t N>
void CubbyFlow::Vector< T, N >::Swap ( Vector< T, N > &  other)

Swaps the content of the vector with other vector.


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