Go to the documentation of this file.
76 #define realSwap(a,b) { XsReal t = *a; *a = *b; *b = t; }
79 #pragma diag_suppress=Pa039
93 assert(sz == 0 || buffer != 0);
132 assert(sz == thisPtr->
m_size);
136 if (sz > thisPtr->
m_size || sz == 0)
228 #if XSREAL_ALLOWS_MEMCPY
232 for (i = 0; i < thisPtr->
m_size; ++i)
241 for (i = 0; i < thisPtr->
m_size; ++i)
242 thisPtr->
m_data[i] = value;
256 for (i = 0; i < thisPtr->
m_size; ++i)
289 #pragma diag_suppress=Pe370
326 if (thisPtr == thatPtr)
328 if (!thisPtr || !thatPtr)
337 for (i = 0; i < thisPtr->
m_size; ++i)
XSCPPPROTECTED XsReal *const m_data
Points to contained data buffer.
A class that represents a vector of real numbers.
XSMATHCONST XsReal XsMath_one
1.0
void XsVector_fill(struct XsVector *thisPtr, XsReal value)
Sets all elements of the XsVector to value.
void XsVector_assign(XsVector *thisPtr, XsSize sz, const XsReal *src)
Initialize the XsVector using sz number of items from src.
void XsVector_copy(XsVector *copy, XsVector const *src)
Copy the contents of the XsVector to copy.
void XsVector_swap(XsVector *a, XsVector *b)
Swap the contents of a and b.
XsReal XsVector_cartesianLength(const XsVector *thisPtr)
Compute and return the cartesian length.
void XsVector_angularVelocityFromQuaternion(XsVector *thisPtr, XsReal deltaT, const XsQuaternion *quat)
Get an effective angular velocity from the quaternion, which must represent a delta angle.
@ XSDF_FixedSize
The contained data points to a fixed-size buffer, this allows creation of dynamic objects on the stac...
XSMATHCONST XsReal XsMath_tinyValue
A really small value.
int XsVector_equal(const struct XsVector *a, const struct XsVector *b)
Returns non-zero when the two vectors are identical.
int XsVector_empty(const XsVector *thisPtr)
Returns a non-zero value if the XsVector does not contain any values.
A class that implements a quaternion.
static int XsVector_incFreeCount(void)
int XsQuaternion_empty(const XsQuaternion *thisPtr)
Test if this is a null object.
#define XSLISTSWAP3(C, B, S)
double XsReal
Defines the floating point type used by the Xsens libraries.
int XsVector_compare(const struct XsVector *thisPtr, const struct XsVector *thatPtr, XsReal epsilon)
Returns non-zero if the two vectors are equal within epsilon.
size_t XsSize
XsSize must be unsigned number!
XsReal m_data[4]
Stores the quaternion in an array of four elements.
XsReal XsVector_dotProduct(const XsVector *a, const XsVector *b)
Compute and return the dot product of XsVectors a and b.
@ XSDF_Empty
The object contains undefined data / should be considered empty. Usually only relevant when XSDF_Fixe...
XSMATHCONST XsReal XsMath_two
2
const XsSize m_size
Size of contained data buffer in elements.
XSMATHCONST XsReal XsMath_zero
0
void XsVector_normalize(XsVector *thisPtr)
Normalize the vector.
void XsVector_ref(XsVector *thisPtr, XsSize sz, XsReal *buffer, XsDataFlags flags)
Initialize the XsVector to refer to the supplied buffer.
XsDataFlags
These flags define the behaviour of data contained by Xsens data structures.
TF2SIMD_FORCE_INLINE tf2Scalar length(const Quaternion &q)
void XsVector_construct(XsVector *thisPtr, XsSize sz, const XsReal *src)
Initialize the XsVector using sz number of items from src.
@ XSDF_Managed
The contained data should be managed (freed) by the object, when false, the object assumes the memory...
void XsVector_setZero(XsVector *thisPtr)
Sets all elements of the XsVector to 0.
const XsSize m_flags
Flags for data management.
void XsVector_multiplyScalar(const XsVector *thisPtr, XsReal scalar, XsVector *dest)
Multiplies all values in this XsVector by scalar and puts the result in XsVector dest.
void XsVector_destruct(XsVector *thisPtr)
Release and clear the contents of the vector.
static int XsVector_incAllocCount(void)