Go to the documentation of this file.
78 #if __cplusplus >= 201103L && !defined(XSENS_HAVE_TYPE_TRAITS)
79 #include <type_traits>
80 #define XSENS_HAVE_TYPE_TRAITS
86 #define XSVECTOR_INITIALIZER { NULL, 0, 0 }
110 #ifndef XSENS_NO_PACK
123 #pragma diag_suppress=Pa039
127 inline XsSize flags()
const
177 #if !defined(SWIG) && !defined(__ADSP21000__) && !defined(__AVR32__)
214 inline void setSize(
XsSize sz)
220 inline XsSize size()
const
236 v.m_data[i] =
m_data[i] * scalar;
241 inline void operator *=(
XsReal scalar)
278 inline XsReal operator[](J index)
const
280 #ifdef XSENS_HAVE_TYPE_TRAITS
281 static_assert(std::is_integral<J>::value || std::is_enum<J>::value,
"Integral index required.");
289 inline XsReal& operator[](J index)
291 #ifdef XSENS_HAVE_TYPE_TRAITS
292 static_assert(std::is_integral<J>::value || std::is_enum<J>::value,
"Integral index required.");
320 inline XsReal cartesianLength()
const
326 inline void normalize()
332 inline void setZero()
338 inline bool empty()
const
405 inline std::vector<XsReal> toVector()
const
408 std::vector<XsReal> tmp(
m_size);
423 inline void fill(
XsReal val)
451 XsVector tmp(size() + other.size());
452 for (
XsSize i = 0; i < size(); ++i)
454 for (
XsSize i = 0; i < other.size(); ++i)
455 tmp[i + size()] = other[i];
467 inline void reverse()
474 for (
XsSize i = 0; i < half; ++i)
475 swap(
operator[](i),
operator[](sz - i));
480 #pragma diag_default=Pa039
485 #ifndef XSENS_NO_PACK
XSCPPPROTECTED XsReal *const m_data
Points to contained data buffer.
A class that represents a vector of real numbers.
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.
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.
bool operator==(const XsFilterProfile &lhs, const XsFilterProfile &rhs)
Returns true if lhs has the same type as rhs.
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 XsVector_dotProduct(const XsVector *a, const XsVector *b)
Compute and return the dot product of XsVectors a and b.
const XsSize m_size
Size of contained data buffer in elements.
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
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.
TF2SIMD_FORCE_INLINE Vector3 operator+(const Vector3 &v1, const Vector3 &v2)
XsDataFlags
These flags define the behaviour of data contained by Xsens data structures.
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.
TF2SIMD_FORCE_INLINE Quaternion operator-(const Quaternion &q)
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.