Go to the documentation of this file.
75 #pragma diag_suppress=Pa039
103 XsSize size = rows * stride;
108 size = rows * stride;
127 if (srcStride == 0 || srcStride == stride)
131 for (r = 0; r < rows; ++r)
133 #if XSREAL_ALLOWS_MEMCPY
134 memcpy(thisPtr->
m_data + r * stride, src + r * srcStride, cols *
sizeof(
XsReal));
137 for (c = 0; c < cols; ++c)
138 thisPtr->
m_data[r * stride + c] = src[r * srcStride + c];
149 XsSize size = rows * stride;
153 if (rows == 0 && cols == 0)
159 assert(thisPtr->
m_rows == rows && thisPtr->
m_cols == cols);
161 size = thisPtr->
m_rows * stride;
166 if (thisPtr->
m_rows == rows && thisPtr->
m_cols == cols &&
167 (stride == 0 || stride == thisPtr->
m_stride))
170 size = rows * stride;
177 size = rows * stride;
199 if (stride == cols && (srcStride == 0 || srcStride == stride))
203 for (r = 0; r < rows; ++r)
205 #if XSREAL_ALLOWS_MEMCPY
206 memcpy(thisPtr->
m_data + r * stride, src + r * srcStride, cols *
sizeof(
XsReal));
209 for (c = 0; c < cols; ++c)
210 thisPtr->
m_data[r * stride + c] = src[r * srcStride + c];
250 #if XSREAL_ALLOWS_MEMCPY
256 for (r = 0; r < thisPtr->
m_rows; ++r)
261 for (r = 0; r < thisPtr->
m_rows; ++r)
262 for (c = 0; c < thisPtr->
m_cols; ++c)
282 for (r = 0; r < thisPtr->
m_rows; ++r)
283 for (c = 0; c < thisPtr->
m_cols; ++c)
284 dest->
m_data[r * stride2 + c] = thisPtr->
m_data[r * stride + c] * scalar;
314 return thisPtr->
m_rows == rows && thisPtr->
m_cols == columns;
320 XsReal q00, q11, q22, q33, q01, q02, q03, q12, q13, q23;
328 q00 = quat->
m_w * quat->
m_w;
329 q11 = quat->
m_x * quat->
m_x;
330 q22 = quat->
m_y * quat->
m_y;
331 q33 = quat->
m_z * quat->
m_z;
333 q01 = quat->
m_w * quat->
m_x;
334 q02 = quat->
m_w * quat->
m_y;
335 q03 = quat->
m_w * quat->
m_z;
337 q12 = quat->
m_x * quat->
m_y;
338 q13 = quat->
m_x * quat->
m_z;
339 q23 = quat->
m_y * quat->
m_z;
365 #pragma diag_suppress=Pe370
393 for (r = 0; r < a->
m_rows; ++r)
397 for (c = 0; c < a->
m_cols; ++c, ++aa, ++bb)
void XsMatrix_swap(XsMatrix *a, XsMatrix *b)
Swap the contents of a and b.
void XsMatrix_ref(XsMatrix *thisPtr, XsSize rows, XsSize cols, XsSize stride, XsReal *buffer, XsDataFlags flags)
Construct the XsMatrix as a reference to data in buffer.
A class that represents a matrix of real numbers.
void XsMatrix_destruct(XsMatrix *thisPtr)
Clear the XsMatrix and release allocated resources.
void XsMatrix_setZero(XsMatrix *thisPtr)
Set all the values in the matrix to zero.
XsReal XsMatrix_value(const XsMatrix *thisPtr, XsSize row, XsSize column)
Returns the data value at row and column.
void XsMatrix_copy(XsMatrix *copy, XsMatrix const *src)
Copy the contents of copy to the XsMatrix.
int XsMatrix_empty(const XsMatrix *thisPtr)
Returns not zero if the matrix contains no values.
@ XSDF_FixedSize
The contained data points to a fixed-size buffer, this allows creation of dynamic objects on the stac...
int XsMatrix_dimensionsMatch(const XsMatrix *thisPtr, XsSize rows, XsSize columns)
Returns not zero if the dimensions of the XsMatrix are equal to rows and columns.
A class that implements a quaternion.
const XsSize m_rows
Number of rows in the matrix.
int XsQuaternion_empty(const XsQuaternion *thisPtr)
Test if this is a null object.
XsSize XsMatrix_offset(const XsMatrix *thisPtr, XsSize row, XsSize column)
Returns the offset in the data for accessing the value at row and column.
void XsMatrix_setValue(XsMatrix *thisPtr, XsSize row, XsSize column, XsReal value)
Sets the data value at row and column.
XSCPPPROTECTED XsReal *const m_data
Contained data.
#define XsMatrix_offsetM(thisPtr, row, column)
static int XsMatrix_incFreeCount(void)
double XsReal
Defines the floating point type used by the Xsens libraries.
size_t XsSize
XsSize must be unsigned number!
XsReal m_x
Stores the x component of the quaternion.
void XsMatrix_construct(XsMatrix *thisPtr, XsSize rows, XsSize cols, XsSize stride, const XsReal *src, XsSize srcStride)
Init the XsMatrix and copy the data from src into the matrix if src is not null.
const XsSize m_cols
Number of columns in the matrix.
@ XSDF_Empty
The object contains undefined data / should be considered empty. Usually only relevant when XSDF_Fixe...
static int XsMatrix_incAllocCount(void)
XSMATHCONST XsReal XsMath_two
2
XSMATHCONST XsReal XsMath_zero
0
const XsSize m_stride
Number of items per row in memory (usually equal to cols but not always)
void XsMatrix_assign(XsMatrix *thisPtr, XsSize rows, XsSize cols, XsSize stride, const XsReal *src, XsSize srcStride)
Init the XsMatrix and copy the data from src into the matrix if src is not null.
void XsMatrix_fromQuaternion(XsMatrix *thisPtr, const XsQuaternion *quat)
Get an orientation matrix representation of the quaternion.
XsDataFlags
These flags define the behaviour of data contained by Xsens data structures.
XsReal m_y
Stores the y component of the quaternion.
@ XSDF_Managed
The contained data should be managed (freed) by the object, when false, the object assumes the memory...
XsReal m_w
Stores the w component of the quaternion.
void XsMatrix_multiplyScalar(const XsMatrix *thisPtr, XsReal scalar, XsMatrix *dest)
Multiplies all values in this XsMatrix by scalar.
XsReal m_z
Stores the z component of the quaternion.
const XsSize m_flags
Flags for data management.