ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Utils::Quaternion< T > Struct Template Reference

Quaternion representation. More...

#include <quaternion.hpp>

+ Collaboration diagram for Utils::Quaternion< T >:

Public Types

using container = typename Utils::Array< T, 4 >
 
using pointer = typename container::pointer
 
using const_pointer = typename container::const_pointer
 
using value_type = typename container::value_type
 
using reference = typename container::reference
 

Public Member Functions

void normalize ()
 Normalize the quaternion in place.
 
Quaternion< T > normalized () const
 Retrieve a normalized copy of the quaternion.
 
value_type operator[] (std::size_t i) const
 Element access (const).
 
reference operator[] (std::size_t i)
 Element access (non const).
 
value_type norm () const
 Retrieve the norm of the quaternion.
 
value_type norm2 () const
 Retrieve the square of the norm of the quaternion.
 
constexpr pointer data ()
 Access to the underlying data (non const).
 
constexpr const_pointer data () const noexcept
 Access to the underlying data (const).
 

Static Public Member Functions

static Quaternion< T > identity ()
 Construct an identity quaternion.
 
static Quaternion< T > zero ()
 Construct a zero quaternion.
 

Public Attributes

container m_data
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename T>
struct Utils::Quaternion< T >

Quaternion representation.

Template Parameters
TElement data type.

Definition at line 57 of file quaternion.hpp.

Member Typedef Documentation

◆ const_pointer

template<typename T >
using Utils::Quaternion< T >::const_pointer = typename container::const_pointer

Definition at line 61 of file quaternion.hpp.

◆ container

template<typename T >
using Utils::Quaternion< T >::container = typename Utils::Array<T, 4>

Definition at line 58 of file quaternion.hpp.

◆ pointer

template<typename T >
using Utils::Quaternion< T >::pointer = typename container::pointer

Definition at line 60 of file quaternion.hpp.

◆ reference

template<typename T >
using Utils::Quaternion< T >::reference = typename container::reference

Definition at line 63 of file quaternion.hpp.

◆ value_type

template<typename T >
using Utils::Quaternion< T >::value_type = typename container::value_type

Definition at line 62 of file quaternion.hpp.

Member Function Documentation

◆ data() [1/2]

template<typename T >
constexpr pointer Utils::Quaternion< T >::data ( )
inlineconstexpr

Access to the underlying data (non const).

Returns
Pointer to the first data member.

Definition at line 123 of file quaternion.hpp.

References Utils::Quaternion< T >::m_data.

◆ data() [2/2]

template<typename T >
constexpr const_pointer Utils::Quaternion< T >::data ( ) const
inlineconstexprnoexcept

Access to the underlying data (const).

Returns
Pointer to the first data member.

Definition at line 129 of file quaternion.hpp.

References Utils::Quaternion< T >::m_data.

◆ identity()

template<typename T >
static Quaternion< T > Utils::Quaternion< T >::identity ( )
inlinestatic

Construct an identity quaternion.

Returns
Identity quaternion.

Definition at line 111 of file quaternion.hpp.

Referenced by propagate_omega_quat_particle().

◆ norm()

template<typename T >
value_type Utils::Quaternion< T >::norm ( ) const
inline

Retrieve the norm of the quaternion.

Returns
The norm.

Definition at line 100 of file quaternion.hpp.

◆ norm2()

template<typename T >
value_type Utils::Quaternion< T >::norm2 ( ) const
inline

Retrieve the square of the norm of the quaternion.

Returns
The squared norm.

Definition at line 105 of file quaternion.hpp.

Referenced by calculate_vs_relate_to_params(), and define_Qdd().

◆ normalize()

template<typename T >
void Utils::Quaternion< T >::normalize ( )
inline

Normalize the quaternion in place.

Definition at line 75 of file quaternion.hpp.

◆ normalized()

template<typename T >
Quaternion< T > Utils::Quaternion< T >::normalized ( ) const
inline

Retrieve a normalized copy of the quaternion.

Returns
Normalized quaternion.

Definition at line 81 of file quaternion.hpp.

Referenced by Utils::rotation_matrix().

◆ operator[]() [1/2]

template<typename T >
reference Utils::Quaternion< T >::operator[] ( std::size_t  i)
inline

Element access (non const).

Parameters
iElement index.
Returns
Value of element i.

Definition at line 94 of file quaternion.hpp.

References Utils::Quaternion< T >::m_data.

◆ operator[]() [2/2]

template<typename T >
value_type Utils::Quaternion< T >::operator[] ( std::size_t  i) const
inline

Element access (const).

Parameters
iElement index.
Returns
Value of element i.

Definition at line 88 of file quaternion.hpp.

References Utils::Quaternion< T >::m_data.

◆ zero()

template<typename T >
static Quaternion< T > Utils::Quaternion< T >::zero ( )
inlinestatic

Construct a zero quaternion.

Returns
Quaternion with all elements set to zero.

Definition at line 117 of file quaternion.hpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<typename T >
friend class boost::serialization::access
friend

Definition at line 66 of file quaternion.hpp.

Member Data Documentation

◆ m_data


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