Ocean
Ocean::MathUtilities Class Reference

This class implements utility functions for the math library. More...

Static Public Member Functions

template<typename TTransformation , typename TObject >
static void transform (const TTransformation &transformation, const std::vector< TObject > &objects, std::vector< TObject > &results, Worker *worker=nullptr, const unsigned int minimalObjectsPerThread=1000u)
 Transforms several objects (e.g., 3D vector or 4D vectors) by a transformation object (e.g., a 3x3 matrix or 4x4 matrix) using the multiplication operator. More...
 
static void encodeFloatToUint8 (const float value, uint8_t *decomposedValues)
 Encodes a float value to four uint8 values. More...
 
static float decodeFloatFromUint8 (const uint8_t *decomposedValues)
 Decodes four uint8 values into a float value. More...
 

Static Protected Member Functions

template<typename TTransformation , typename TObject >
static void transformSubset (const TTransformation *transformation, const TObject *objects, TObject *results, const unsigned int firstObject, const unsigned int numberObjects)
 Transforms a subset of several objects (e.g., 3D vector or 4D vectors) by a transformation object (e.g., a 3x3 matrix or 4x4 matrix) using the multiplication operator. More...
 
template<>
void transformSubset (const SquareMatrixF3 *transformation, const VectorF3 *objects, VectorF3 *results, const unsigned int firstObject, const unsigned int numberObjects)
 
template<>
void transformSubset (const SquareMatrixD4 *transformation, const VectorD4 *objects, VectorD4 *results, const unsigned int firstObject, const unsigned int numberObjects)
 
template<>
void transformSubset (const SquareMatrixF4 *transformation, const VectorF4 *objects, VectorF4 *results, const unsigned int firstObject, const unsigned int numberObjects)
 

Detailed Description

This class implements utility functions for the math library.

Member Function Documentation

◆ decodeFloatFromUint8()

float Ocean::MathUtilities::decodeFloatFromUint8 ( const uint8_t *  decomposedValues)
inlinestatic

Decodes four uint8 values into a float value.

Parameters
decomposedValuesThe four uint8 values to decompose, must be valid
Returns
The resulting decomposed float value, with range [0, 1]

◆ encodeFloatToUint8()

void Ocean::MathUtilities::encodeFloatToUint8 ( const float  value,
uint8_t *  decomposedValues 
)
inlinestatic

Encodes a float value to four uint8 values.

Parameters
valueThe float value to decompose, with range [0, 1]
decomposedValuesThe resulting four uint8 values, must be valid

◆ transform()

template<typename TTransformation , typename TObject >
void Ocean::MathUtilities::transform ( const TTransformation &  transformation,
const std::vector< TObject > &  objects,
std::vector< TObject > &  results,
Worker worker = nullptr,
const unsigned int  minimalObjectsPerThread = 1000u 
)
inlinestatic

Transforms several objects (e.g., 3D vector or 4D vectors) by a transformation object (e.g., a 3x3 matrix or 4x4 matrix) using the multiplication operator.

Parameters
transformationThe transformation to be used (e.g., a matrix)
objectsThe object to be transformed (e.g. vectors)
resultsThe resulting transformed objects, the size of the vector will be adjusted to match the size of the provided objects
workerOptional worker object to distribute the computation
minimalObjectsPerThreadMinimal number of objects assigned to one internal thread, with range [1, infinity)

◆ transformSubset() [1/4]

template<>
void Ocean::MathUtilities::transformSubset ( const SquareMatrixD4 transformation,
const VectorD4 objects,
VectorD4 results,
const unsigned int  firstObject,
const unsigned int  numberObjects 
)
inlinestaticprotected

◆ transformSubset() [2/4]

template<>
void Ocean::MathUtilities::transformSubset ( const SquareMatrixF3 transformation,
const VectorF3 objects,
VectorF3 results,
const unsigned int  firstObject,
const unsigned int  numberObjects 
)
inlinestaticprotected

◆ transformSubset() [3/4]

template<>
void Ocean::MathUtilities::transformSubset ( const SquareMatrixF4 transformation,
const VectorF4 objects,
VectorF4 results,
const unsigned int  firstObject,
const unsigned int  numberObjects 
)
inlinestaticprotected

◆ transformSubset() [4/4]

template<typename TTransformation , typename TObject >
void Ocean::MathUtilities::transformSubset ( const TTransformation *  transformation,
const TObject *  objects,
TObject *  results,
const unsigned int  firstObject,
const unsigned int  numberObjects 
)
inlinestaticprotected

Transforms a subset of several objects (e.g., 3D vector or 4D vectors) by a transformation object (e.g., a 3x3 matrix or 4x4 matrix) using the multiplication operator.

Parameters
transformationThe transformation to be used (e.g., a matrix)
objectsThe object to be transformed (e.g. vectors)
resultsThe resulting transformed objects, the size of the vector will be adjusted to match the size of the provided objects
firstObjectThe first object to be handled
numberObjectsThe number of objects to be handled

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