SpinParser  1.0
Public Member Functions | List of all members
ValueBundle< T > Struct Template Reference

Value array implementation. The object does not hold ownership of its memory. More...

#include <ValueBundle.hpp>

Public Member Functions

 ValueBundle ()
 Construct an empty ValueBundle object.
 
 ValueBundle (T *data, const int size)
 Construct a new ValueBundle object. More...
 
ValueBundleoperator= (const ValueBundle< T > &rhs)
 Assignment operator. More...
 
T & operator[] (const int n)
 Access the nth value stored in the value bundle. More...
 
int size () const
 Retrieve the number of elements in the value bundle. More...
 
T * data () const
 Retrieve the pointer to the first value stored in the bundle. More...
 
ValueBundlemultAdd (const T &rhs1, const ValueBundle< T > &rhs2)
 Fused multiply-add, equivalent to operator+=(rhs1 * rhs2). More...
 
ValueBundlemultAdd (const ValueBundle< T > &rhs1, const T &rhs2)
 Fused multiply-add for scalar right-multiplication, equivalent to operator+=(rhs1 * rhs2). More...
 
ValueBundlemultAdd (const ValueBundle< T > &rhs1, const ValueBundle< T > &rhs2)
 Elementwise fused multiply-add. Equivalent to elementwise operator+=(rhs1 * rhs2). More...
 
ValueBundlemultAdd (const T &rhs1, const ValueBundle< T > &rhs2, const ValueBundle< T > &rhs3)
 Elementwise double-multiply add. Equivalent to elementwise operator+=(rhs1 * rhs2 * rhs3). More...
 
ValueBundlemultSub (const T &rhs1, const ValueBundle< T > &rhs2)
 Fused multiply-sub, equivalent to operator-=(rhs1 * rhs2). More...
 
ValueBundlemultSub (const ValueBundle< T > &rhs1, const T &rhs2)
 Fused multiply-sub for scalar right-multiplication, equivalent to operator-=(rhs1 * rhs2). More...
 
ValueBundlemultSub (const ValueBundle< T > &rhs1, const ValueBundle< T > &rhs2)
 Elementwise fused multiply-sub. Equivalent to elementwise operator-=(rhs1 * rhs2). More...
 
ValueBundlemultSub (const T &rhs1, const ValueBundle< T > &rhs2, const ValueBundle< T > &rhs3)
 Elementwise double-multiply sub. Equivalent to elementwise operator-=(rhs1 * rhs2 * rhs3). More...
 
ValueBundleoperator+= (const ValueBundle &rhs)
 Addition assignment. More...
 
ValueBundleoperator-= (const ValueBundle &rhs)
 Subtraction assignment. More...
 
ValueBundleoperator*= (const T &rhs)
 Multiplication assignment. More...
 
ValueBundleoperator/= (const T &rhs)
 Division assignment. More...
 

Detailed Description

template<class T>
struct ValueBundle< T >

Value array implementation. The object does not hold ownership of its memory.

Template Parameters
TUnderlying fundamental data type.

Constructor & Destructor Documentation

◆ ValueBundle()

template<class T >
ValueBundle< T >::ValueBundle ( T *  data,
const int  size 
)
inline

Construct a new ValueBundle object.

Parameters
dataStorage memory, size should at least be size * sizeof(T). Memory is not deleted on destruction of the ValueBundle.
sizeNumber of elemenets in the ValueBundle.

Member Function Documentation

◆ data()

template<class T >
T* ValueBundle< T >::data ( ) const
inline

Retrieve the pointer to the first value stored in the bundle.

Returns
const T* Pointer to the first vlaue stored in the bundle.

◆ multAdd() [1/4]

template<class T >
ValueBundle& ValueBundle< T >::multAdd ( const T &  rhs1,
const ValueBundle< T > &  rhs2 
)
inline

Fused multiply-add, equivalent to operator+=(rhs1 * rhs2).

Parameters
rhs1Scalar operand.
rhs2Array operand.
Returns
ValueBundle& Reference to self.

◆ multAdd() [2/4]

template<class T >
ValueBundle& ValueBundle< T >::multAdd ( const T &  rhs1,
const ValueBundle< T > &  rhs2,
const ValueBundle< T > &  rhs3 
)
inline

Elementwise double-multiply add. Equivalent to elementwise operator+=(rhs1 * rhs2 * rhs3).

Parameters
rhs1Scalar operand.
rhs2Left array operand.
rhs3Right array operand.
Returns
ValueBundle& Reference to self.

◆ multAdd() [3/4]

template<class T >
ValueBundle& ValueBundle< T >::multAdd ( const ValueBundle< T > &  rhs1,
const T &  rhs2 
)
inline

Fused multiply-add for scalar right-multiplication, equivalent to operator+=(rhs1 * rhs2).

Parameters
rhs1Array operand.
rhs2Scalar operand.
Returns
ValueBundle& Reference to self.

◆ multAdd() [4/4]

template<class T >
ValueBundle& ValueBundle< T >::multAdd ( const ValueBundle< T > &  rhs1,
const ValueBundle< T > &  rhs2 
)
inline

Elementwise fused multiply-add. Equivalent to elementwise operator+=(rhs1 * rhs2).

Parameters
rhs1Left array operand.
rhs2Right array operand.
Returns
ValueBundle& Reference to self.

◆ multSub() [1/4]

template<class T >
ValueBundle& ValueBundle< T >::multSub ( const T &  rhs1,
const ValueBundle< T > &  rhs2 
)
inline

Fused multiply-sub, equivalent to operator-=(rhs1 * rhs2).

Parameters
rhs1Scalar operand.
rhs2Array operand.
Returns
ValueBundle& Reference to self.

◆ multSub() [2/4]

template<class T >
ValueBundle& ValueBundle< T >::multSub ( const T &  rhs1,
const ValueBundle< T > &  rhs2,
const ValueBundle< T > &  rhs3 
)
inline

Elementwise double-multiply sub. Equivalent to elementwise operator-=(rhs1 * rhs2 * rhs3).

Parameters
rhs1Scalar operand.
rhs2Left array operand.
rhs3Right array operand.
Returns
ValueBundle& Reference to self.

◆ multSub() [3/4]

template<class T >
ValueBundle& ValueBundle< T >::multSub ( const ValueBundle< T > &  rhs1,
const T &  rhs2 
)
inline

Fused multiply-sub for scalar right-multiplication, equivalent to operator-=(rhs1 * rhs2).

Parameters
rhs1Array operand.
rhs2Scalar operand.
Returns
ValueBundle& Reference to self.

◆ multSub() [4/4]

template<class T >
ValueBundle& ValueBundle< T >::multSub ( const ValueBundle< T > &  rhs1,
const ValueBundle< T > &  rhs2 
)
inline

Elementwise fused multiply-sub. Equivalent to elementwise operator-=(rhs1 * rhs2).

Parameters
rhs1Left array operand.
rhs2Right array operand.
Returns
ValueBundle& Reference to self.

◆ operator*=()

template<class T >
ValueBundle& ValueBundle< T >::operator*= ( const T &  rhs)
inline

Multiplication assignment.

Parameters
rhsRight hand side operand.
Returns
ValueBundle& Reference to self.

◆ operator+=()

template<class T >
ValueBundle& ValueBundle< T >::operator+= ( const ValueBundle< T > &  rhs)
inline

Addition assignment.

Parameters
rhsRight hand side operand.
Returns
ValueBundle& Reference to self.

◆ operator-=()

template<class T >
ValueBundle& ValueBundle< T >::operator-= ( const ValueBundle< T > &  rhs)
inline

Subtraction assignment.

Parameters
rhsRight hand side operand.
Returns
ValueBundle& Reference to self.

◆ operator/=()

template<class T >
ValueBundle& ValueBundle< T >::operator/= ( const T &  rhs)
inline

Division assignment.

Parameters
rhsRight hand side operand.
Returns
ValueBundle& Reference to self.

◆ operator=()

template<class T >
ValueBundle& ValueBundle< T >::operator= ( const ValueBundle< T > &  rhs)
inline

Assignment operator.

Parameters
rhsRight hand size operand.
Returns
ValueBundle& Reference to self.

◆ operator[]()

template<class T >
T& ValueBundle< T >::operator[] ( const int  n)
inline

Access the nth value stored in the value bundle.

Parameters
nElement number.
Returns
T& Reference to nth element.

◆ size()

template<class T >
int ValueBundle< T >::size ( ) const
inline

Retrieve the number of elements in the value bundle.

Returns
int Number of elements in the value bundle.

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