SolidUtils
Static Public Member Functions | List of all members
sl::VectorMath Class Reference

The VectorMath class contains static functions for manipulating numerical data in vectors. This includes operations for summation, scaling, dot products, cross products, prefix sums, etc.. More...

#include <VectorMath.hpp>

Static Public Member Functions

template<typename T >
static T sum (T *const data, size_t const size) noexcept
 Sum the elements of an array. More...
 
template<typename T >
static void increment (T *const data, size_t const size, T const start=0, T const inc=1) noexcept
 Set all entries int the array to the given sequence. More...
 
template<typename T >
static void prefixSumExclusive (T *const data, size_t const size) noexcept
 Perform a prefix sum on an array. More...
 
template<typename T >
static void prefixSumExclusive (T const begin, T const end) noexcept
 Perform a prefix sum on an array. More...
 

Detailed Description

The VectorMath class contains static functions for manipulating numerical data in vectors. This includes operations for summation, scaling, dot products, cross products, prefix sums, etc..

Member Function Documentation

◆ increment()

template<typename T >
static void sl::VectorMath::increment ( T *const  data,
size_t const  size,
T const  start = 0,
T const  inc = 1 
)
inlinestaticnoexcept

Set all entries int the array to the given sequence.

Template Parameters
Thetype of elements in the array.
Parameters
dataThe starting location of memory.
sizeThe number of lements.
startThe starting value of the sequence.
incThe increment of the sequence.

◆ prefixSumExclusive() [1/2]

template<typename T >
static void sl::VectorMath::prefixSumExclusive ( T *const  data,
size_t const  size 
)
inlinestaticnoexcept

Perform a prefix sum on an array.

Template Parameters
TThe type of elements in the array.
Parameters
dataThe starting location of memory.
sizeThe number of elements in the array.

◆ prefixSumExclusive() [2/2]

template<typename T >
static void sl::VectorMath::prefixSumExclusive ( T const  begin,
T const  end 
)
inlinestaticnoexcept

Perform a prefix sum on an array.

Template Parameters
TThe type of elements in the array.
Parameters
dataThe starting location of memory.
sizeThe number of elements in the array.

◆ sum()

template<typename T >
static T sl::VectorMath::sum ( T *const  data,
size_t const  size 
)
inlinestaticnoexcept

Sum the elements of an array.

Template Parameters
TThe type element.
Parameters
dataThe starting memory location.
sizeThe number of elements.
Returns
The sum.

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