Class translotator::DualNumber¶
template <typename Type>
ClassList > translotator > DualNumber
Represents a dual number. More...
#include <DualNumber.hpp>
Inherits the following classes: translotator::MatrixBase
Public Types inherited from translotator::MatrixBase¶
| Type | Name | 
|---|---|
| typedef Type | DATATYPE   | 
Public Static Attributes¶
| Type | Name | 
|---|---|
| constexpr static ObjectType | OBJECT_TYPE   = = ObjectType::DUAL_NUMBER | 
Public Static Attributes inherited from translotator::MatrixBase¶
| Type | Name | 
|---|---|
| constexpr static size_t | COLS   = = M | 
| constexpr static bool | MATRIX_BASE   = = true | 
| constexpr static size_t | ROWS   = = N | 
Public Functions¶
| Type | Name | 
|---|---|
| Type | Du () const | 
| Type & | Du ()  | 
| DualNumber ()  | 
|
| DualNumber (const Type & r, const Type & d)  | 
|
| Type | Re () const | 
| Type & | Re ()  | 
| void | conjugate ()  return the conjugate of this dual number  | 
| DualNumber< Type > | conjugated () const | 
| DualNumber< Type > | dualNumDiv (const DualNumber< Type > & other) const multiply this dual number with another dual number  | 
| void | dualNumDivEq (const DualNumber< Type > & other)  return the division of two dual numbers  | 
| DualNumber< Type > | dualNumMul (const DualNumber< Type > & other) const divide this dual number with another dual number  | 
| void | dualNumMulEq (const DualNumber< Type > & other)  return the multiplication of two dual numbers  | 
| DualNumber< Type > | inversed () const normalize the real part of this dual number  | 
| Type | norm () const return the squared norm of this dual number  | 
| Type | normSquared () const conjugate this dual number  | 
| void | normalize ()  return a new DualNumber with normalized real part  | 
| DualNumber< Type > | normalized () const return the norm of this dual number  | 
| DualNumber< Type > | operator* (const DualNumber< Type > & other) const return the multiplication of two dual numbers  | 
| void | operator*= (const DualNumber< Type > & other)  | 
| DualNumber< Type > | operator/ (const DualNumber< Type > & other) const return the division of two dual numbers  | 
| void | operator/= (const DualNumber< Type > & other)  multiply this dual number with another dual number  | 
| Type | operator[] (size_t i) const | 
| Type & | operator[] (size_t i)  | 
| SquareMatrix< 2, Type > | toMulMatrix () const return a 2x2 matrix that represents the multiplication of this dual number  | 
Public Functions inherited from translotator::MatrixBase¶
| Type | Name | 
|---|---|
| MatrixBase () = default Returns the number of columns.  | 
|
| MatrixBase (const MatrixBase & other) = default | 
|
| MatrixBase (const Type data)  | 
|
| MatrixBase (const Type data)  | 
|
| MatrixBase (const initializer_list< N *M, Type > & list)  Initializer list constructor.  | 
|
| auto | T () const Transpose.  | 
| Matrix< P, Q, Type > | block (size_t i, size_t j) const Returns a block of the matrix.  | 
| Matrix< P, Q, Type > | block () const Returns a block of the matrix.  | 
| ComplexNum< Type > | cast2ComplexNum () const Casts the object to a complex number by copying.  | 
| ComplexNum< Type > & | cast2ComplexNumRef ()  Casts the object to a complex number reference without copying.  | 
| DualNumber< Type > | cast2DualNumber () const Casts the object to a dual number by copying.  | 
| DualNumber< Type > & | cast2DualNumberRef ()  Casts the object to a dual number reference without copying.  | 
| DualQuaternion< Type > | cast2DualQuaternion () const Casts the object to a dual quaternion by copying.  | 
| DualQuaternion< Type > & | cast2DualQuaternionRef ()  Casts the object to a dual quaternion reference without copying.  | 
| Matrix< N, M, Type > | cast2Matrix () const Casts the object to a different matrix type by copying.  | 
| Matrix< N, M, Type > & | cast2MatrixRef ()  Casts the object to a matrix reference without copying.  | 
| Quaternion< Type > | cast2Quaternion () const Casts the object to a quaternion by copying.  | 
| Quaternion< Type > & | cast2QuaternionRef ()  Casts the object to a quaternion reference without copying.  | 
| SOGroup< N, Type > | cast2SOGroup () const Casts the object to a special orthogonal group by copying.  | 
| SOGroup< N, Type > & | cast2SOGroupRef ()  Casts the object to a special orthogonal group reference without copying.  | 
| SquareMatrix< N, Type > | cast2SquareMatrix () const Casts the object to a square matrix by copying.  | 
| SquareMatrix< N, Type > & | cast2SquareMatrixRef ()  Casts the object to a square matrix reference without copying.  | 
| UnitComplexNum< Type > | cast2UnitComplexNum () const Casts the object to a unit complex number by copying.  | 
| UnitComplexNum< Type > & | cast2UnitComplexNumRef ()  Casts the object to a unit complex number reference without copying.  | 
| UnitDualQuaternion< Type > | cast2UnitDualQuaternion () const Casts the object to a unit dual quaternion by copying.  | 
| UnitDualQuaternion< Type > & | cast2UnitDualQuaternionRef ()  Casts the object to a unit dual quaternion reference without copying.  | 
| UnitQuaternion< Type > | cast2UnitQuaternion () const Casts the object to a unit quaternion by copying.  | 
| UnitQuaternion< Type > & | cast2UnitQuaternionRef ()  Casts the object to a unit quaternion reference without copying.  | 
| Vector< N, Type > | cast2Vector () const Casts the object to a vector by copying.  | 
| Vector< N, Type > & | cast2VectorRef ()  Casts the object to a vector reference without copying.  | 
| NewContainer | castContainer () const Casts the matrix to a different container type by copying.  | 
| NewContainer & | castContainerRef ()  Casts the object to a different container reference without copying.  | 
| NewDerived & | castContainerRef ()  | 
| auto | castDataType () const Returns the Frobenius norm.  | 
| Matrix< N, 1, Type > | col (size_t j) const Returns the j-th column.  | 
| void | copyTo (Type * data) const Returns the raw data pointer.  | 
| void | fill (const Type & v)  Fills the matrix with a value.  | 
| Type | frobeniusNorm () const | 
| Type | frobeniusNormSquared () const Returns the squared Frobenius norm.  | 
| Type * | getData () const | 
| const Type & | operator() (size_t i, size_t j) const Accesses the element at (i, j)  | 
| Type & | operator() (size_t i, size_t j)  Accesses the element at (i, j)  | 
| auto | operator* (const OtherDerived & other) const Matrix multiplication.  | 
| Derived | operator* (const Type & v) const Matrix multiplication by scalar.  | 
| void | operator*= (const OtherDerived & other)  Matrix multiplication by scalar.  | 
| Derived | operator+ (const OtherDerived & other) const Multiplication by scalar.  | 
| void | operator+= (const OtherDerived & other)  Matrix division by scalar.  | 
| Derived | operator- (const OtherDerived & other) const Matrix subtraction.  | 
| Derived | operator- () const Matrix multiplication by scalar.  | 
| void | operator-= (const OtherDerived & other)  Matrix subtraction by scalar.  | 
| Derived | operator/ (Type v) const Division by scalar.  | 
| void | operator/= (Type v)  Division by scalar.  | 
| Derived & | operator= (const Derived & other)  Copies the data to the given pointer.  | 
| void | print () const Prints the matrix.  | 
| Matrix< 1, M, Type > | row (size_t i) const Returns the i-th row.  | 
| Derived & | setBlock (size_t i, size_t j, const OtherDerived & block)  Sets the element at (i, j)  | 
| Derived & | setBlock (const OtherDerived & block)  Sets the i-th row.  | 
| Derived & | setCol (size_t j, const OtherDerived & col)  Sets the j-th column.  | 
| Derived & | setCol (const OtherDerived & col)  Sets the j-th column.  | 
| Derived & | setRow (size_t i, const OtherDerived & row)  Sets the i-th row.  | 
| Derived & | setRow (const OtherDerived & row)  Sets the i-th row.  | 
| void | swapCols (size_t j1, size_t j2)  Swaps two columns.  | 
| void | swapRows (size_t i1, size_t i2)  Swaps two rows.  | 
| Type | toScalar () const Casts the matrix to a scalar if it is a 1x1 matrix.  | 
Public Static Functions¶
| Type | Name | 
|---|---|
| DualNumber< Type > | sqrt (const DualNumber< Type > & dn)  divide this dual number with another dual number  | 
Public Static Functions inherited from translotator::MatrixBase¶
| Type | Name | 
|---|---|
| Derived | NaN ()  Returns a matrix filled with NaN.  | 
| constexpr static size_t | colSize ()  Returns the number of rows.  | 
| Derived | eye ()  Returns an identity matrix.  | 
| Derived | ones ()  Returns a matrix filled with ones.  | 
| constexpr static size_t | rowSize ()  | 
| Derived | zeros ()  Returns a matrix filled with zeros.  | 
Protected Attributes inherited from translotator::MatrixBase¶
| Type | Name | 
|---|---|
| Type | data_   | 
Detailed Description¶
Template parameters:
Typefloating point type
A dual number is a pair of real numbers, where one is the real part and the other is the dual part. The dual part is a number that squares to zero, i.e., e^2 = 0. It is used to represent infinitesimal quantities.
Note:
Data structure : [real, dual], (2 x 1)
Public Static Attributes Documentation¶
variable OBJECT_TYPE¶
constexpr static ObjectType translotator::DualNumber< Type >::OBJECT_TYPE;
Public Functions Documentation¶
function Du [1/2]¶
inline Type translotator::DualNumber::Du () const
function Du [2/2]¶
inline Type & translotator::DualNumber::Du () 
function DualNumber [1/2]¶
inline translotator::DualNumber::DualNumber () 
function DualNumber [2/2]¶
inline translotator::DualNumber::DualNumber (
    const Type & r,
    const Type & d
) 
function Re [1/2]¶
inline Type translotator::DualNumber::Re () const
accessors
function Re [2/2]¶
inline Type & translotator::DualNumber::Re () 
function conjugate¶
inline void translotator::DualNumber::conjugate () 
function conjugated¶
inline DualNumber < Type > translotator::DualNumber::conjugated () const
utils
function dualNumDiv¶
inline DualNumber < Type > translotator::DualNumber::dualNumDiv (
    const DualNumber < Type > & other
) const
function dualNumDivEq¶
inline void translotator::DualNumber::dualNumDivEq (
    const DualNumber < Type > & other
) 
function dualNumMul¶
inline DualNumber < Type > translotator::DualNumber::dualNumMul (
    const DualNumber < Type > & other
) const
function dualNumMulEq¶
inline void translotator::DualNumber::dualNumMulEq (
    const DualNumber < Type > & other
) 
function inversed¶
inline DualNumber < Type > translotator::DualNumber::inversed () const
function norm¶
inline Type translotator::DualNumber::norm () const
function normSquared¶
inline Type translotator::DualNumber::normSquared () const
function normalize¶
inline void translotator::DualNumber::normalize () 
function normalized¶
inline DualNumber < Type > translotator::DualNumber::normalized () const
function operator*¶
inline DualNumber < Type > translotator::DualNumber::operator* (
    const DualNumber < Type > & other
) const
function operator*=¶
inline void translotator::DualNumber::operator*= (
    const DualNumber < Type > & other
) 
function operator/¶
inline DualNumber < Type > translotator::DualNumber::operator/ (
    const DualNumber < Type > & other
) const
function operator/=¶
inline void translotator::DualNumber::operator/= (
    const DualNumber < Type > & other
) 
function operator[]¶
inline Type translotator::DualNumber::operator[] (
    size_t i
) const
function operator[]¶
inline Type & translotator::DualNumber::operator[] (
    size_t i
) 
function toMulMatrix¶
return a 2x2 matrix that represents the multiplication of this dual number
inline SquareMatrix < 2, Type > translotator::DualNumber::toMulMatrix () const
casts
Public Static Functions Documentation¶
function sqrt¶
divide this dual number with another dual number
static inline DualNumber < Type > translotator::DualNumber::sqrt (
    const DualNumber < Type > & dn
) 
static functions return the square root of a dual number. Re > 0 is required
The documentation for this class was generated from the following file include/translotator/objects/DualNumber.hpp