![]() |
WarpTwin
Documentation for WarpTwin models and classes.
|
Classes | |
| class | CircularBuffer |
| Simple Circular Buffer for data storage. More... | |
| class | DataIO |
| Class for inter-object communication. More... | |
| class | DataIOBase |
| class | GraphTreeObject |
| Base class for object organization. More... | |
| class | Queue |
| Simple first in, first out queue for data storage. More... | |
| class | Time |
| Wrapper to manage and convert time as timespce. More... | |
| class | CartesianVector |
| Standard vector class derived from Matrix. More... | |
| class | Matrix |
| Matrix math implementation. More... | |
| class | DCM |
| Class defining a direction cosine matrix inherited from Matrix. More... | |
| class | Euler321 |
| Class defining a 3-2-1 Euler angle sequence. More... | |
| class | MRP |
| Modified Rodrigues Parameter class definiton. More... | |
| class | Quaternion |
| Quaternion class for attitude representation. More... | |
| class | JsonCdl |
| Load JSON file using jsmn utility. More... | |
| class | Interpolator |
| A class for performing simple x-y linear interpolation. More... | |
| class | PersistenceTracker |
| Track the persistence of a threshold. More... | |
Enumerations | |
| enum | dataio_types_e : uint8 { INTEGER , FLOATING_POINT , VECTOR , ARRAY , MATRIX , GRAPH_TREE , POINTER , STD_STRING , UNDEFINED , C_STRING , TIME } |
| enum | graph_tree_types_e : int8 { BASE_GRAPH_TREE = 0 , DATAIO = 1 , TASK = 2 , EXECUTIVE = 3 , FRAME = 4 , BODY = 5 , NODE = 6 } |
| enum | cdl_types_e : uint8 { INT32_TP , FPOINT_TP , CARTESIANVECTOR3_TP , QUATERNION_TP } |
| Type definition for CDL types which may be loaded. More... | |
Functions | |
| void | connectSignals (clockwerk::DataIOBase &upstream, clockwerk::DataIOBase &downstream) |
| Function to tie two signals together. | |
| void | disconnect (clockwerk::DataIOBase &obj) |
| Function to disconnect a DataIO object from its parent. | |
| template<uint32 R1, uint32 C1R2, uint32 C2> | |
| void | multiply (const Matrix< R1, C1R2 > &A, const Matrix< C1R2, C2 > &B, Matrix< R1, C2 > &result) |
| Function to multiply two matrices. | |
| template<uint32 R, uint32 C> | |
| void | multiply (const floating_point &a, const Matrix< R, C > &A, Matrix< R, C > &result) |
| Function to multiply a scalar by a matrix. | |
| template<uint32 R, uint32 C> | |
| void | eMultiply (const Matrix< R, C > &A, const Matrix< R, C > &B, Matrix< R, C > &result) |
| Function to multiply two matrices element-wise. | |
| template<uint32 R, uint32 C> | |
| void | add (const floating_point &a, const Matrix< R, C > &A, Matrix< R, C > &result) |
| Function to add a scalar to a matrix. | |
| template<uint32 R, uint32 C> | |
| void | eAdd (const Matrix< R, C > &A, const Matrix< R, C > &B, Matrix< R, C > &result) |
| Function to add two matrices element-wise. | |
| template<uint32 R, uint32 C> | |
| void | eSubtract (Matrix< R, C > A, Matrix< R, C > B, Matrix< R, C > &result) |
| Function to subtract B from A, element-wise. | |
| template<uint32 R1, uint32 C1R2, uint32 C2> | |
| Matrix< R1, C2 > | operator* (const Matrix< R1, C1R2 > &A, const Matrix< C1R2, C2 > &B) |
| Overload of matrix multiplication - Two matrices. | |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator* (const floating_point &a, const Matrix< R, C > &A) |
| Overload of matrix multiplication - Matrix and scalar. | |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator* (const Matrix< R, C > &A, const floating_point &a) |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator+ (const Matrix< R, C > &A, const Matrix< R, C > &B) |
| Overload of matrix addition - Two matrices. | |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator+ (const floating_point &a, const Matrix< R, C > &A) |
| Overload of matrix addition - Matrix and scalar. | |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator+ (const Matrix< R, C > &A, const floating_point &a) |
| template<uint32 R, uint32 C> | |
| Matrix< R, C > | operator- (const Matrix< R, C > &A, const Matrix< R, C > &B) |
| Returns value – less efficient in some cases. | |
| template<uint32 M, uint32 K> | |
| int16 | cholSolve (const Matrix< M, M > &A, const Matrix< M, K > &B, Matrix< M, K > &X) |
| Perform cholesky solve Ax=b on square, posdef matrix A and put the solution in X. | |
| int16 | safeDivide (float a, float b, float &result) |
| Overloaded functions to perform safe division. | |
| int16 | safeDivide (double a, double b, double &result) |
| int16 | safeDivide (int32 a, int32 b, int32 &result) |
| int16 | safeDivide (uint64 a, uint64 b, uint64 &result) |
| int16 | safeSqrt (float input, float &result) |
| Overloaded functions to perform safe square root. | |
| int16 | safeSqrt (double input, double &result) |
| int16 | safeNroot (float input, int32 rt, float &result) |
| Overloaded functions to perform safe n root. | |
| int16 | safeNroot (double input, int32 rt, double &result) |
| int16 | safeAcos (float input, float &result) |
| Overloaded functions to perform save cosine inverse. | |
| int16 | safeAcos (double input, double &result) |
| int16 | safeAsin (float input, float &result) |
| Overloaded functions to perform save sine inverse. | |
| int16 | safeAsin (double input, double &result) |
| int16 | safeTan (float input, float &result) |
| Overloaded functions to perform safe tangent. | |
| int16 | safeTan (double input, double &result) |
| bool | floatEquals (floating_point a, floating_point b, floating_point tolerance=1e-6) |
| Compares if two floats are equal within a certain range. | |
| int16 | sgn (floating_point val) |
| Return the sign of the value. | |
| void | cross (CartesianVector< 3 > a, CartesianVector< 3 > b, CartesianVector< 3 > &result) |
| CartesianVector< 3 > | cross (const CartesianVector< 3 > &a, const CartesianVector< 3 > &b) |
| void | tilde (const CartesianVector< 3 > &v, Matrix< 3, 3 > &t) |
| Matrix< 3, 3 > | tilde (const CartesianVector< 3 > &v) |
| template<uint32 L> | |
| void | dot (const CartesianVector< L > &a, const CartesianVector< L > &b, floating_point &result) |
| template<uint32 L> | |
| floating_point | dot (const CartesianVector< L > &a, const CartesianVector< L > &b) |
| template<uint32 R1, uint32 C1R2> | |
| CartesianVector< R1 > | operator* (const Matrix< R1, C1R2 > &A, const CartesianVector< C1R2 > &B) |
| Overload of matrix multiplication - Matrix and vector. | |
| template<uint32 L> | |
| CartesianVector< L > | operator* (const floating_point &a, const CartesianVector< L > &A) |
| Overload of vector multiplication - vector and scalar. | |
| template<uint32 L> | |
| CartesianVector< L > | operator* (const CartesianVector< L > &A, const floating_point &a) |
| template<uint32 L> | |
| CartesianVector< L > | operator+ (const CartesianVector< L > &A, const CartesianVector< L > &B) |
| Overload of matrix addition - Two matrices. | |
| template<uint32 L> | |
| CartesianVector< L > | operator+ (const floating_point &a, const CartesianVector< L > &A) |
| Overload of matrix addition - Matrix and scalar. | |
| template<uint32 L> | |
| CartesianVector< L > | operator+ (const CartesianVector< L > &A, const floating_point &a) |
| template<uint32 L> | |
| CartesianVector< L > | operator- (const CartesianVector< L > &A, const CartesianVector< L > &B) |
| Returns value – less efficient in some cases. | |
| DCM | operator* (const DCM &A, const DCM &B) |
| Overload of DCM multiplication - Two DCMs. | |
| Euler321 | operator* (const Euler321 &a, const Euler321 &b) |
| Overload of Euler321 multiplication - Two Euler321s. | |
| MRP | operator* (const MRP &a, const MRP &b) |
| Overload of MRP multiplication - Two MRPs. | |
| CartesianVector< 3 > | operator* (const DCM &A, const CartesianVector< 3 > &b) |
| Attitude rotation of vector via DCM. | |
| CartesianVector< 3 > | operator* (const Euler321 &a, const CartesianVector< 3 > &b) |
| Attitude rotation of vector via Euler321. | |
| CartesianVector< 3 > | operator* (const MRP &a, const CartesianVector< 3 > &b) |
| Attitude rotation of vector via MRP. | |
| void | toUpper (char *input) |
| Converts a C-style string to uppercase in place. | |
| void | toLower (char *input) |
| Converts a C-style string to lowercase in place. | |
| bool | caseInsensitiveEqual (const char *a, const char *b) |
| Compares two C-style strings case-insensitively. | |
| int16 | strip (const char *input, char *output, size_t output_size) |
| Removes leading and trailing whitespace from an input string. | |
| int16 | stringReplace (const char *source, const char *orig, const char *repl, char *output, size_t output_size) |
| Replaces the first occurrence of a substring with another string. | |
| int16 | splitString (const char *text, const char *delimiter, char **tokens, size_t max_tokens, char *token_buf, size_t token_buf_size) |
| Splits a string using a specified delimiter. | |
| bool | isValidNumber (const char *s) |
| Checks whether a C-style string represents a valid number. | |
| int16 | numberToString (int64 num, char *out, size_t out_size) |
| int16 | numberToString (int32 num, char *out, size_t out_size) |
| int16 | numberToString (int16 num, char *out, size_t out_size) |
| int16 | numberToString (int8 num, char *out, size_t out_size) |
| int16 | numberToString (bool num, char *out, size_t out_size) |
| Converts an integer to a C-style string. | |
| int16 | numberToString (uint64 num, char *out, size_t out_size) |
| int16 | numberToString (uint32 num, char *out, size_t out_size) |
| int16 | numberToString (uint16 num, char *out, size_t out_size) |
| int16 | numberToString (uint8 num, char *out, size_t out_size) |
| int16 | numberToString (char num, char *out, size_t out_size) |
| Converts a char to a C-style string. | |
| int16 | numberToString (float num, char *out, size_t out_size, uint8 precision=6) |
| Converts a float to a C-style string with a specified precision. | |
| int16 | numberToString (float16 num, char *out, size_t out_size, uint8 precision=3) |
| Converts a float16 to a C-style string with a specified precision. | |
| int16 | numberToString (double num, char *out, size_t out_size, uint8 precision=6) |
| Converts a double to a C-style string with a specified precision. | |
| int16 | numberFromString (const char *s, uint8 &num) |
| Overloaded - convert string to number. | |
| int16 | numberFromString (const char *s, uint16 &num) |
| int16 | numberFromString (const char *s, uint32 &num) |
| int16 | numberFromString (const char *s, uint64 &num) |
| int16 | numberFromString (const char *s, int8 &num) |
| int16 | numberFromString (const char *s, int16 &num) |
| int16 | numberFromString (const char *s, int32 &num) |
| int16 | numberFromString (const char *s, int64 &num) |
| int16 | numberFromString (const char *s, float &num) |
| int16 | numberFromString (const char *s, double &num) |
| size_t | strnlen (const char *s, size_t maxlen) |
| Function to calculate the string length with a length bound. | |
| template<typename T> | |
| int16 | setArrayFromString (const char *s, T *array, size_t array_size) |
| Converts a bracket-enclosed comma-separated string to a float array. | |
| template<size_t N> | |
| int16 | numberToString (const std::array< char, N > &val, char *retval, size_t size) |
| Converts an array to a C-style string. | |
| template<typename Tn, size_t N> | |
| int16 | numberToString (const std::array< Tn, N > &val, char *retval, size_t size) |
| Converts an array to a C-style string. | |
Variables | |
| const floating_point | NSEC_PER_SEC_D = 1000000000.0 |
| const uint16 | MSEC_PER_SEC_I = 1000 |
| const uint32 | NSEC_PER_MSEC_I = 1000000 |
| const uint32 | NSEC_PER_SEC_I = 1000000000 |
| const uint32 | MAX_CHARS_PER_MATRIX_STRING = 1000 |
| const uint8 | QUATERNION_NUM_ELEMENTS = 4 |
| Constant for the number of elements in a quaternion. | |
| const uint8 | MAX_CHARS_PER_STRING_VALUE = 32 |
| const uint16 | MAX_CHARS_PER_ARRAY_STRING = 200 |
| enum clockwerk::cdl_types_e : uint8 |
Type definition for CDL types which may be loaded.
| Enumerator | |
|---|---|
| INT32_TP | Integer type – can be single value or array. |
| FPOINT_TP | floating_point type – can be single value or array |
| CARTESIANVECTOR3_TP | Cartesian vector type – is floating_point based. |
| QUATERNION_TP | Quaternion type – is floating_point based. |
| enum clockwerk::dataio_types_e : uint8 |
This enumeration stores information on the data type held within the DataIO object. The storage defines data types primarily for logging, which is used in simulation.
| Enumerator | |
|---|---|
| INTEGER | |
| FLOATING_POINT | |
| VECTOR | |
| ARRAY | |
| MATRIX | |
| GRAPH_TREE | |
| POINTER | |
| STD_STRING | |
| UNDEFINED | |
| C_STRING | |
| TIME | |
| enum clockwerk::graph_tree_types_e : int8 |
This enumeration defines the possible derivations of the graph tree object which may be used to store helpful information on it. It's messy but it works well. Derivations may be added here as they are developed. If not, they will default to not defined.
| Enumerator | |
|---|---|
| BASE_GRAPH_TREE | |
| DATAIO | |
| TASK | |
| EXECUTIVE | |
| FRAME | |
| BODY | |
| NODE | |
| void clockwerk::add | ( | const floating_point & | a, |
| const Matrix< R, C > & | A, | ||
| Matrix< R, C > & | result ) |
Function to add a scalar to a matrix.
| a | Scalar to add to A |
| A | Matrix in the scalar addition operation |
| result | PBR return of a+A result |
| bool clockwerk::caseInsensitiveEqual | ( | const char * | a, |
| const char * | b ) |
Compares two C-style strings case-insensitively.
| [in] | a | First null-terminated string. |
| [in] | b | Second null-terminated string. |
| int16 clockwerk::cholSolve | ( | const Matrix< M, M > & | A, |
| const Matrix< M, K > & | B, | ||
| Matrix< M, K > & | X ) |
Perform cholesky solve Ax=b on square, posdef matrix A and put the solution in X.
| M | The number of rows/cols of matrix A |
| K | The number of columns of X and B |
| A | The matrix to solve and take cholesky decomposition on |
| B | The solution vector |
| X | Implicit return of X in AX=B |
| void clockwerk::connectSignals | ( | clockwerk::DataIOBase & | upstream, |
| clockwerk::DataIOBase & | downstream ) |
Function to tie two signals together.
| upstream | The upstream (i.e. output) signal to connect |
| downstream | The downstream (i.e. input) signal to connect |
| void clockwerk::cross | ( | CartesianVector< 3 > | a, |
| CartesianVector< 3 > | b, | ||
| CartesianVector< 3 > & | result ) |
| CartesianVector< 3 > clockwerk::cross | ( | const CartesianVector< 3 > & | a, |
| const CartesianVector< 3 > & | b ) |
| void clockwerk::disconnect | ( | clockwerk::DataIOBase & | obj | ) |
Function to disconnect a DataIO object from its parent.
| obj | The object to disconnect from upstream |
| floating_point clockwerk::dot | ( | const CartesianVector< L > & | a, |
| const CartesianVector< L > & | b ) |
| void clockwerk::dot | ( | const CartesianVector< L > & | a, |
| const CartesianVector< L > & | b, | ||
| floating_point & | result ) |
| void clockwerk::eAdd | ( | const Matrix< R, C > & | A, |
| const Matrix< R, C > & | B, | ||
| Matrix< R, C > & | result ) |
Function to add two matrices element-wise.
| A | First matrix in the element-wise addition operation |
| B | Second matrix in the element-wise addition operation |
| result | PBR return of A+B result |
| void clockwerk::eMultiply | ( | const Matrix< R, C > & | A, |
| const Matrix< R, C > & | B, | ||
| Matrix< R, C > & | result ) |
Function to multiply two matrices element-wise.
| A | First matrix in the element-wise multiplication operation |
| B | Second matrix in the element-wise multiplication operation |
| result | PBR return of A.*B result |
| void clockwerk::eSubtract | ( | Matrix< R, C > | A, |
| Matrix< R, C > | B, | ||
| Matrix< R, C > & | result ) |
Function to subtract B from A, element-wise.
| A | First matrix in the element-wise subtraction operation |
| B | Second matrix in the element-wise subtraction operation |
| result | PBR return of A-B result |
| bool clockwerk::floatEquals | ( | floating_point | a, |
| floating_point | b, | ||
| floating_point | tolerance = 1e-6 ) |
Compares if two floats are equal within a certain range.
| a | First float to compare |
| b | Second float to compare |
| tolerance | Tolerance between float compares, default 1e-6 |
| bool clockwerk::isValidNumber | ( | const char * | s | ) |
Checks whether a C-style string represents a valid number.
| [in] | s | Null-terminated string to check. |
| void clockwerk::multiply | ( | const floating_point & | a, |
| const Matrix< R, C > & | A, | ||
| Matrix< R, C > & | result ) |
Function to multiply a scalar by a matrix.
| a | Scalar by which to multiply A |
| A | Matrix in the scalar multiplication operation |
| result | PBR return of a*A result |
| void clockwerk::multiply | ( | const Matrix< R1, C1R2 > & | A, |
| const Matrix< C1R2, C2 > & | B, | ||
| Matrix< R1, C2 > & | result ) |
Function to multiply two matrices.
| A | First matrix in the multiplication operation |
| B | Second matrix in the multiplication operation |
| result | PBR return of A*B result |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| double & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| float & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| int16 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| int32 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| int64 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| int8 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| uint16 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| uint32 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| uint64 & | num ) |
| int16 clockwerk::numberFromString | ( | const char * | s, |
| uint8 & | num ) |
Overloaded - convert string to number.
| s | The string to convert |
| num | Implicit return of the converted number |
| int16 clockwerk::numberToString | ( | bool | num, |
| char * | out, | ||
| size_t | out_size ) |
Converts an integer to a C-style string.
| [in] | num | The integer value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| int16 clockwerk::numberToString | ( | char | num, |
| char * | out, | ||
| size_t | out_size ) |
Converts a char to a C-style string.
| [in] | num | The value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| int16 clockwerk::numberToString | ( | const std::array< char, N > & | val, |
| char * | retval, | ||
| size_t | size ) |
Converts an array to a C-style string.
| [in] | num | The value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| int16 clockwerk::numberToString | ( | const std::array< Tn, N > & | val, |
| char * | retval, | ||
| size_t | size ) |
Converts an array to a C-style string.
| [in] | num | The value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| int16 clockwerk::numberToString | ( | double | num, |
| char * | out, | ||
| size_t | out_size, | ||
| uint8 | precision = 6 ) |
Converts a double to a C-style string with a specified precision.
| [in] | num | The double value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| [in] | precision | Number of decimal places to include. Must be 0-->9 and rounds to 9 if above |
| int16 clockwerk::numberToString | ( | float | num, |
| char * | out, | ||
| size_t | out_size, | ||
| uint8 | precision = 6 ) |
Converts a float to a C-style string with a specified precision.
| [in] | num | The float value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| [in] | precision | Number of decimal places to include. Must be 0-->9 and rounds to 9 if above |
| int16 clockwerk::numberToString | ( | float16 | num, |
| char * | out, | ||
| size_t | out_size, | ||
| uint8 | precision = 3 ) |
Converts a float16 to a C-style string with a specified precision.
| [in] | num | The float16 value to convert. |
| [out] | out | Output buffer to store the string. |
| [in] | out_size | Size of the output buffer. |
| [in] | precision | Number of decimal places to include. Must be 0-->9 and rounds to 9 if above |
| int16 clockwerk::numberToString | ( | int16 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | int32 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | int64 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | int8 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | uint16 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | uint32 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | uint64 | num, |
| char * | out, | ||
| size_t | out_size ) |
| int16 clockwerk::numberToString | ( | uint8 | num, |
| char * | out, | ||
| size_t | out_size ) |
| CartesianVector< L > clockwerk::operator* | ( | const CartesianVector< L > & | A, |
| const floating_point & | a ) |
| CartesianVector< 3 > clockwerk::operator* | ( | const DCM & | A, |
| const CartesianVector< 3 > & | b ) |
Attitude rotation of vector via DCM.
Overload of DCM multiplication - Two DCMs.
Operator overloads – NOTE: May be less efficient than equivalent PBR function in some cases due to
| CartesianVector< 3 > clockwerk::operator* | ( | const Euler321 & | a, |
| const CartesianVector< 3 > & | b ) |
Attitude rotation of vector via Euler321.
| CartesianVector< L > clockwerk::operator* | ( | const floating_point & | a, |
| const CartesianVector< L > & | A ) |
Overload of vector multiplication - vector and scalar.
| Matrix< R, C > clockwerk::operator* | ( | const floating_point & | a, |
| const Matrix< R, C > & | A ) |
Overload of matrix multiplication - Matrix and scalar.
| Matrix< R, C > clockwerk::operator* | ( | const Matrix< R, C > & | A, |
| const floating_point & | a ) |
| CartesianVector< R1 > clockwerk::operator* | ( | const Matrix< R1, C1R2 > & | A, |
| const CartesianVector< C1R2 > & | B ) |
Overload of matrix multiplication - Matrix and vector.
Operator overloads – NOTE: May be less efficient than equivalent PBR function in some cases due to
| CartesianVector< 3 > clockwerk::operator* | ( | const MRP & | a, |
| const CartesianVector< 3 > & | b ) |
Attitude rotation of vector via MRP.
| CartesianVector< L > clockwerk::operator+ | ( | const CartesianVector< L > & | A, |
| const CartesianVector< L > & | B ) |
Overload of matrix addition - Two matrices.
| CartesianVector< L > clockwerk::operator+ | ( | const CartesianVector< L > & | A, |
| const floating_point & | a ) |
| CartesianVector< L > clockwerk::operator+ | ( | const floating_point & | a, |
| const CartesianVector< L > & | A ) |
Overload of matrix addition - Matrix and scalar.
| Matrix< R, C > clockwerk::operator+ | ( | const floating_point & | a, |
| const Matrix< R, C > & | A ) |
Overload of matrix addition - Matrix and scalar.
| Matrix< R, C > clockwerk::operator+ | ( | const Matrix< R, C > & | A, |
| const floating_point & | a ) |
| Matrix< R, C > clockwerk::operator+ | ( | const Matrix< R, C > & | A, |
| const Matrix< R, C > & | B ) |
Overload of matrix addition - Two matrices.
| CartesianVector< L > clockwerk::operator- | ( | const CartesianVector< L > & | A, |
| const CartesianVector< L > & | B ) |
Returns value – less efficient in some cases.
| Matrix< R, C > clockwerk::operator- | ( | const Matrix< R, C > & | A, |
| const Matrix< R, C > & | B ) |
Returns value – less efficient in some cases.
| int16 clockwerk::safeAcos | ( | double | input, |
| double & | result ) |
| int16 clockwerk::safeAcos | ( | float | input, |
| float & | result ) |
Overloaded functions to perform save cosine inverse.
| input | The input value to take cosine of |
| result | The result of the cos |
| int16 clockwerk::safeAsin | ( | double | input, |
| double & | result ) |
| int16 clockwerk::safeAsin | ( | float | input, |
| float & | result ) |
Overloaded functions to perform save sine inverse.
| input | The input value to take sine of |
| result | The result of the sin |
| int16 clockwerk::safeDivide | ( | double | a, |
| double | b, | ||
| double & | result ) |
| int16 clockwerk::safeDivide | ( | float | a, |
| float | b, | ||
| float & | result ) |
Overloaded functions to perform safe division.
| a | Dividend |
| b | Divisor |
| result | PBR value to receive result of division |
| int16 clockwerk::safeDivide | ( | int32 | a, |
| int32 | b, | ||
| int32 & | result ) |
| int16 clockwerk::safeDivide | ( | uint64 | a, |
| uint64 | b, | ||
| uint64 & | result ) |
| int16 clockwerk::safeNroot | ( | double | input, |
| int32 | rt, | ||
| double & | result ) |
| int16 clockwerk::safeNroot | ( | float | input, |
| int32 | rt, | ||
| float & | result ) |
Overloaded functions to perform safe n root.
| input | The value to take the n root of |
| rt | The degree of root to take |
| result | PBR value to receive result of n-root |
| int16 clockwerk::safeSqrt | ( | double | input, |
| double & | result ) |
| int16 clockwerk::safeSqrt | ( | float | input, |
| float & | result ) |
Overloaded functions to perform safe square root.
| input | The value to take the square root of |
| result | PBR value to receive result of square |
| int16 clockwerk::safeTan | ( | double | input, |
| double & | result ) |
| int16 clockwerk::safeTan | ( | float | input, |
| float & | result ) |
Overloaded functions to perform safe tangent.
| input | The input value to take tangent of |
| result | The result of the tangent |
| int16 clockwerk::setArrayFromString | ( | const char * | s, |
| T * | array, | ||
| size_t | array_size ) |
Converts a bracket-enclosed comma-separated string to a float array.
Example string: "[1.0,2.5,3.4]"
| [in] | s | Null-terminated string in bracketed format. |
| [out] | array | Destination array to receive parsed floats. |
| [in] | array_size | Expected size of the array to populate. |
| int16 clockwerk::sgn | ( | floating_point | val | ) |
Return the sign of the value.
| val | The value to return the sign of |
| int16 clockwerk::splitString | ( | const char * | text, |
| const char * | delimiter, | ||
| char ** | tokens, | ||
| size_t | max_tokens, | ||
| char * | token_buf, | ||
| size_t | token_buf_size ) |
Splits a string using a specified delimiter.
This function tokenizes the input text, placing pointers to each token in the tokens array, and stores the tokens themselves in a provided static buffer.
| [in] | text | Input null-terminated string to split. |
| [in] | delimiter | Delimiter string. |
| [out] | tokens | Array of pointers to store token locations. |
| [in] | max_tokens | Maximum number of tokens to store in the array. |
| [out] | token_buf | Buffer to store token strings. |
| [in] | token_buf_size | Size of token_buf. |
| int16 clockwerk::stringReplace | ( | const char * | source, |
| const char * | orig, | ||
| const char * | repl, | ||
| char * | output, | ||
| size_t | output_size ) |
Replaces the first occurrence of a substring with another string.
Writes the result to the provided output buffer.
| [in] | source | Input source string. |
| [in] | orig | Substring to search for in the source. |
| [in] | repl | Replacement substring. |
| [out] | output | Output buffer to receive the new string. |
| [in] | output_size | Size of the output buffer, including null terminator. |
| int16 clockwerk::strip | ( | const char * | input, |
| char * | output, | ||
| size_t | output_size ) |
Removes leading and trailing whitespace from an input string.
Copies the stripped result into the provided output buffer.
| [in] | input | Input null-terminated string. |
| [out] | output | Output buffer to receive stripped string. |
| [in] | output_size | Size of the output buffer, including space for null terminator. |
| size_t clockwerk::strnlen | ( | const char * | s, |
| size_t | maxlen ) |
Function to calculate the string length with a length bound.
| s | point to string array |
| maxlen | Max length of the string |
| Matrix< 3, 3 > clockwerk::tilde | ( | const CartesianVector< 3 > & | v | ) |
| void clockwerk::tilde | ( | const CartesianVector< 3 > & | v, |
| Matrix< 3, 3 > & | t ) |
| void clockwerk::toLower | ( | char * | input | ) |
Converts a C-style string to lowercase in place.
| [in,out] | input | Pointer to a null-terminated string to be converted. |
| void clockwerk::toUpper | ( | char * | input | ) |
Converts a C-style string to uppercase in place.
| [in,out] | input | Pointer to a null-terminated string to be converted. |
| const uint16 clockwerk::MAX_CHARS_PER_ARRAY_STRING = 200 |
| const uint32 clockwerk::MAX_CHARS_PER_MATRIX_STRING = 1000 |
| const uint8 clockwerk::MAX_CHARS_PER_STRING_VALUE = 32 |
| const uint16 clockwerk::MSEC_PER_SEC_I = 1000 |
| const uint32 clockwerk::NSEC_PER_MSEC_I = 1000000 |
| const floating_point clockwerk::NSEC_PER_SEC_D = 1000000000.0 |
| const uint32 clockwerk::NSEC_PER_SEC_I = 1000000000 |
| const uint8 clockwerk::QUATERNION_NUM_ELEMENTS = 4 |
Constant for the number of elements in a quaternion.