OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Quaternion Class Reference

#include <Quaternion.h>

Inheritance diagram for Quaternion:
Inheritance graph
Collaboration diagram for Quaternion:
Collaboration graph

Public Types

enum  
 
enum  
 
typedef double Element_t
 

Public Member Functions

 Quaternion ()
 
 Quaternion (const Quaternion &)
 
 Quaternion (const double &, const double &, const double &, const double &)
 
 Quaternion (const Vector_t &)
 
 Quaternion (const double &, const Vector_t &)
 
 Quaternion (const matrix_t &)
 
Quaternion operator* (const double &) const
 
Quaternion operator* (const Quaternion &) const
 
Quaternionoperator= (const Quaternion &)=default
 
Quaternionoperator*= (const Quaternion &)
 
Quaternion operator/ (const double &) const
 
double Norm () const
 
double length () const
 
Quaternionnormalize ()
 
bool isUnit () const
 
bool isPure () const
 
bool isPureUnit () const
 
Quaternion inverse () const
 
Quaternion conjugate () const
 
double real () const
 
Vector_t imag () const
 
Vector_t rotate (const Vector_t &) const
 
matrix_t getRotationMatrix () const
 
Vektor< double, D > & operator+= (const Vektor< T1, D > &rhs)
 
Vektor< double, D > & operator+= (const double &rhs)
 
Vektor< double, D > & operator-= (const Vektor< T1, D > &rhs)
 
Vektor< double, D > & operator-= (const double &rhs)
 
Vektor< double, D > & operator*= (const Vektor< T1, D > &rhs)
 
Vektor< double, D > & operator*= (const double &rhs)
 
Vektor< double, D > & operator/= (const Vektor< T1, D > &rhs)
 
Vektor< double, D > & operator/= (const double &rhs)
 
Element_toperator[] (unsigned int i)
 
Element_t operator[] (unsigned int i) const
 
Element_toperator() (unsigned int i)
 
Element_t operator() (unsigned int i) const
 
bool operator== (const Vektor< double, D > &that) const
 
bool operator!= (const Vektor< double, D > &that) const
 
MessageputMessage (Message &m) const
 
MessagegetMessage (Message &m)
 

Private Attributes

double X [D]
 

Detailed Description

Definition at line 8 of file Quaternion.h.

Member Typedef Documentation

◆ Element_t

typedef double Vektor< double , D >::Element_t
inherited

Definition at line 35 of file ippl/src/AppTypes/Vektor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Definition at line 36 of file ippl/src/AppTypes/Vektor.h.

◆ anonymous enum

anonymous enum
inherited

Definition at line 37 of file ippl/src/AppTypes/Vektor.h.

Constructor & Destructor Documentation

◆ Quaternion() [1/6]

Quaternion::Quaternion ( )
inline

Definition at line 48 of file Quaternion.h.

Referenced by operator*=().

◆ Quaternion() [2/6]

Quaternion::Quaternion ( const Quaternion quat)
inline

Definition at line 53 of file Quaternion.h.

◆ Quaternion() [3/6]

Quaternion::Quaternion ( const double &  x0,
const double &  x1,
const double &  x2,
const double &  x3 
)
inline

Definition at line 58 of file Quaternion.h.

◆ Quaternion() [4/6]

Quaternion::Quaternion ( const Vector_t vec)
inline

Definition at line 63 of file Quaternion.h.

◆ Quaternion() [5/6]

Quaternion::Quaternion ( const double &  realPart,
const Vector_t vec 
)
inline

Definition at line 68 of file Quaternion.h.

◆ Quaternion() [6/6]

Quaternion::Quaternion ( const matrix_t M)

Definition at line 22 of file Quaternion.cpp.

References abs(), copysign(), max(), and sqrt().

Here is the call graph for this function:

Member Function Documentation

◆ conjugate()

◆ getMessage()

Message & Vektor< double , D >::getMessage ( Message m)
inlineinherited

Definition at line 180 of file ippl/src/AppTypes/Vektor.h.

◆ getRotationMatrix()

matrix_t Quaternion::getRotationMatrix ( ) const

Definition at line 135 of file Quaternion.cpp.

References normalize().

Referenced by CoordinateSystemTrafo::operator*=().

Here is the call graph for this function:

◆ imag()

Vector_t Quaternion::imag ( ) const
inline

Definition at line 117 of file Quaternion.h.

Referenced by conjugate(), operator*(), operator*=(), and operator/().

◆ inverse()

Quaternion Quaternion::inverse ( ) const

Definition at line 115 of file Quaternion.cpp.

References conjugate(), and normalize().

Here is the call graph for this function:

◆ isPure()

bool Quaternion::isPure ( ) const
inline

Definition at line 91 of file Quaternion.h.

References abs(), and Physics::e.

Referenced by isPureUnit().

Here is the call graph for this function:

◆ isPureUnit()

bool Quaternion::isPureUnit ( ) const
inline

Definition at line 97 of file Quaternion.h.

References isPure(), and isUnit().

Here is the call graph for this function:

◆ isUnit()

bool Quaternion::isUnit ( ) const
inline

Definition at line 85 of file Quaternion.h.

References abs(), Physics::e, and Norm().

Referenced by isPureUnit(), and rotate().

Here is the call graph for this function:

◆ length()

double Quaternion::length ( ) const
inline

Definition at line 79 of file Quaternion.h.

References Norm(), and sqrt().

Referenced by normalize().

Here is the call graph for this function:

◆ Norm()

double Quaternion::Norm ( ) const
inline

Definition at line 73 of file Quaternion.h.

References dot().

Referenced by isUnit(), length(), normalize(), and rotate().

Here is the call graph for this function:

◆ normalize()

Quaternion & Quaternion::normalize ( )

Definition at line 102 of file Quaternion.cpp.

References Physics::e, length(), and Norm().

Referenced by getRotationMatrix(), inverse(), and CoordinateSystemTrafo::operator*=().

Here is the call graph for this function:

◆ operator!=()

bool Vektor< double , D >::operator!= ( const Vektor< double , D > &  that) const
inlineinherited

Definition at line 168 of file ippl/src/AppTypes/Vektor.h.

◆ operator()() [1/2]

Vektor< double , D >::Element_t & Vektor< double , D >::operator() ( unsigned int  i)
inherited

Definition at line 160 of file ippl/src/AppTypes/Vektor.h.

◆ operator()() [2/2]

Vektor< double , D >::Element_t Vektor< double , D >::operator() ( unsigned int  i) const
inherited

Definition at line 162 of file ippl/src/AppTypes/Vektor.h.

◆ operator*() [1/2]

Quaternion Quaternion::operator* ( const double &  d) const

Definition at line 71 of file Quaternion.cpp.

References imag(), and real().

Here is the call graph for this function:

◆ operator*() [2/2]

Quaternion Quaternion::operator* ( const Quaternion other) const

Definition at line 78 of file Quaternion.cpp.

◆ operator*=() [1/3]

Vektor< double , D > & Vektor< double , D >::operator*= ( const double &  rhs)
inlineinherited

Definition at line 135 of file ippl/src/AppTypes/Vektor.h.

◆ operator*=() [2/3]

Quaternion & Quaternion::operator*= ( const Quaternion other)

Definition at line 84 of file Quaternion.cpp.

References cross(), dot(), imag(), and Quaternion().

Here is the call graph for this function:

◆ operator*=() [3/3]

Vektor< double , D > & Vektor< double , D >::operator*= ( const Vektor< T1, D > &  rhs)
inlineinherited

Definition at line 130 of file ippl/src/AppTypes/Vektor.h.

◆ operator+=() [1/2]

Vektor< double , D > & Vektor< double , D >::operator+= ( const double &  rhs)
inlineinherited

Definition at line 111 of file ippl/src/AppTypes/Vektor.h.

◆ operator+=() [2/2]

Vektor< double , D > & Vektor< double , D >::operator+= ( const Vektor< T1, D > &  rhs)
inlineinherited

Definition at line 106 of file ippl/src/AppTypes/Vektor.h.

◆ operator-=() [1/2]

Vektor< double , D > & Vektor< double , D >::operator-= ( const double &  rhs)
inlineinherited

Definition at line 123 of file ippl/src/AppTypes/Vektor.h.

◆ operator-=() [2/2]

Vektor< double , D > & Vektor< double , D >::operator-= ( const Vektor< T1, D > &  rhs)
inlineinherited

Definition at line 118 of file ippl/src/AppTypes/Vektor.h.

◆ operator/()

Quaternion Quaternion::operator/ ( const double &  d) const

Definition at line 95 of file Quaternion.cpp.

References imag(), and real().

Here is the call graph for this function:

◆ operator/=() [1/2]

Vektor< double , D > & Vektor< double , D >::operator/= ( const double &  rhs)
inlineinherited

Definition at line 148 of file ippl/src/AppTypes/Vektor.h.

◆ operator/=() [2/2]

Vektor< double , D > & Vektor< double , D >::operator/= ( const Vektor< T1, D > &  rhs)
inlineinherited

Definition at line 142 of file ippl/src/AppTypes/Vektor.h.

◆ operator=()

Quaternion & Quaternion::operator= ( const Quaternion )
default

◆ operator==()

bool Vektor< double , D >::operator== ( const Vektor< double , D > &  that) const
inlineinherited

Definition at line 165 of file ippl/src/AppTypes/Vektor.h.

◆ operator[]() [1/2]

Vektor< double , D >::Element_t & Vektor< double , D >::operator[] ( unsigned int  i)
inherited

Definition at line 156 of file ippl/src/AppTypes/Vektor.h.

◆ operator[]() [2/2]

Vektor< double , D >::Element_t Vektor< double , D >::operator[] ( unsigned int  i) const
inherited

Definition at line 158 of file ippl/src/AppTypes/Vektor.h.

◆ putMessage()

Message & Vektor< double , D >::putMessage ( Message m) const
inlineinherited

Definition at line 174 of file ippl/src/AppTypes/Vektor.h.

◆ real()

double Quaternion::real ( ) const
inline

Definition at line 111 of file Quaternion.h.

Referenced by conjugate(), operator*(), and operator/().

◆ rotate()

Member Data Documentation

◆ X

double Vektor< double , D >::X[D]
privateinherited

Definition at line 188 of file ippl/src/AppTypes/Vektor.h.


The documentation for this class was generated from the following files: