Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Math.FRealQuaternion Class Reference

A memory-efficient pure-real quaternion with component values of type float. More...

+ Inheritance diagram for CDPL.Math.FRealQuaternion:

Public Member Functions

None __init__ ()
 Constructs a zero-valued real quaternion (C1 = 0).
 
None __init__ (FRealQuaternion q)
 Constructs a copy of the real quaternion q (possibly converting the component type). More...
 
None __init__ (float r)
 Constructs the real quaternion with the supplied real component. More...
 
FRealQuaternion set (float r=0.0)
 Assigns the scalar r to the real component. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
float getC1 ()
 Returns the real component C1. More...
 
float getC2 ()
 Returns the imaginary component C2 (always zero for a real quaternion). More...
 
float getC3 ()
 Returns the imaginary component C3 (always zero for a real quaternion). More...
 
float getC4 ()
 Returns the imaginary component C4 (always zero for a real quaternion). More...
 
object toArray ()
 Converts the FRealQuaternion instance into a corresponding numpy.ndarray object. More...
 
FRealQuaternion assign (FRealQuaternion q)
 Copy-assigns the real component from q. More...
 
None swap (FRealQuaternion q)
 Swaps the real component value with q. More...
 
FRealQuaternion __iadd__ (float t)
 Adds the scalar t to the real component. More...
 
FRealQuaternion __iadd__ (object q)
 Adds the real component of q to this quaternion's real component. More...
 
FRealQuaternion __isub__ (float t)
 Subtracts the scalar t from the real component. More...
 
FRealQuaternion __isub__ (object q)
 Subtracts the real component of q from this quaternion's real component. More...
 
FRealQuaternion __imul__ (float t)
 Multiplies the real component by the scalar t. More...
 
FRealQuaternion __imul__ (object q)
 Multiplies the real component by the real component of q. More...
 
FRealQuaternion __idiv__ (float t)
 Divides the real component by the scalar t. More...
 
FRealQuaternion __idiv__ (object q)
 Divides the real component by the real component of q. More...
 
FRealQuaternion __itruediv__ (float t)
 Divides the real component by the scalar t. More...
 
FRealQuaternion __itruediv__ (object q)
 Divides the real component by the real component of q. More...
 
bool __eq__ (FRealQuaternion q)
 Returns the result of the comparison operation self == q. More...
 
bool __eq__ (ConstFQuaternionExpression q)
 Returns the result of the comparison operation self == q. More...
 
bool __ne__ (FRealQuaternion q)
 Returns the result of the comparison operation self != q. More...
 
bool __ne__ (ConstFQuaternionExpression q)
 Returns the result of the comparison operation self != q. More...
 
str __str__ ()
 Returns a string representation of the FRealQuaternion instance. More...
 
FRealQuaternion __pos__ ()
 Returns self. More...
 
ConstFQuaternionExpression __neg__ ()
 Returns the result of the operation self * -1. More...
 
ConstFQuaternionExpression __add__ (float t)
 Returns the result of the addition operation self + t. More...
 
ConstFQuaternionExpression __add__ (ConstFQuaternionExpression e)
 Returns the result of the addition operation self + e. More...
 
ConstFQuaternionExpression __radd__ (float t)
 Returns the result of the addition operation t + self. More...
 
ConstFQuaternionExpression __sub__ (float t)
 Returns the result of the subtraction operation self - t. More...
 
ConstFQuaternionExpression __sub__ (ConstFQuaternionExpression e)
 Returns the result of the subtraction operation self - e. More...
 
ConstFQuaternionExpression __rsub__ (float t)
 Returns the result of the subtraction operation t - self. More...
 
ConstFQuaternionExpression __mul__ (float t)
 Returns the result of the multiplication operation self * t. More...
 
ConstFQuaternionExpression __mul__ (ConstFQuaternionExpression e)
 Returns the result of the multiplication operation self * e. More...
 
ConstFQuaternionExpression __rmul__ (float t)
 Returns the result of the multiplication operation t * self. More...
 
ConstFQuaternionExpression __div__ (float t)
 Returns the result of the division operation self // t. More...
 
ConstFQuaternionExpression __div__ (ConstFQuaternionExpression e)
 Returns the result of the division operation self // e. More...
 
ConstFQuaternionExpression __truediv__ (float t)
 Returns the result of the true division operation self / t. More...
 
ConstFQuaternionExpression __rdiv__ (float t)
 Returns the result of the division operation t // self. More...
 

Properties

 objectID = property(getObjectID)
 

Detailed Description

A memory-efficient pure-real quaternion with component values of type float.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Math.FRealQuaternion.__init__ ( FRealQuaternion  q)

Constructs a copy of the real quaternion q (possibly converting the component type).

Parameters
qThe real quaternion to copy.

◆ __init__() [2/2]

None CDPL.Math.FRealQuaternion.__init__ ( float  r)

Constructs the real quaternion with the supplied real component.

Parameters
rThe real component value.

Member Function Documentation

◆ set()

FRealQuaternion CDPL.Math.FRealQuaternion.set ( float   r = 0.0)

Assigns the scalar r to the real component.

Parameters
rThe scalar value.
Returns
self.

◆ getObjectID()

int CDPL.Math.FRealQuaternion.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python FRealQuaternion instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two FRealQuaternion instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ getC1()

float CDPL.Math.FRealQuaternion.getC1 ( )

Returns the real component C1.

Returns
The value of C1.

◆ getC2()

float CDPL.Math.FRealQuaternion.getC2 ( )

Returns the imaginary component C2 (always zero for a real quaternion).

Returns
The zero element.

◆ getC3()

float CDPL.Math.FRealQuaternion.getC3 ( )

Returns the imaginary component C3 (always zero for a real quaternion).

Returns
The zero element.

◆ getC4()

float CDPL.Math.FRealQuaternion.getC4 ( )

Returns the imaginary component C4 (always zero for a real quaternion).

Returns
The zero element.

◆ toArray()

object CDPL.Math.FRealQuaternion.toArray ( )

Converts the FRealQuaternion instance into a corresponding numpy.ndarray object.

Returns
The generated numpy.ndarray object.
See also
[NUMPY]

◆ assign()

FRealQuaternion CDPL.Math.FRealQuaternion.assign ( FRealQuaternion  q)

Copy-assigns the real component from q.

Parameters
qThe source real quaternion.
Returns
self.

◆ swap()

None CDPL.Math.FRealQuaternion.swap ( FRealQuaternion  q)

Swaps the real component value with q.

Parameters
qThe real quaternion to swap with.

◆ __iadd__() [1/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__iadd__ ( float  t)

Adds the scalar t to the real component.

Parameters
tThe scalar addend.
Returns
self.

◆ __iadd__() [2/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__iadd__ ( object  q)

Adds the real component of q to this quaternion's real component.

Parameters
qThe source real quaternion.
Returns
self.

◆ __isub__() [1/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__isub__ ( float  t)

Subtracts the scalar t from the real component.

Parameters
tThe scalar subtrahend.
Returns
self.

◆ __isub__() [2/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__isub__ ( object  q)

Subtracts the real component of q from this quaternion's real component.

Parameters
qThe source real quaternion.
Returns
self.

◆ __imul__() [1/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__imul__ ( float  t)

Multiplies the real component by the scalar t.

Parameters
tThe scalar multiplier.
Returns
self.

◆ __imul__() [2/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__imul__ ( object  q)

Multiplies the real component by the real component of q.

Parameters
qThe source real quaternion.
Returns
self.

◆ __idiv__() [1/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__idiv__ ( float  t)

Divides the real component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __idiv__() [2/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__idiv__ ( object  q)

Divides the real component by the real component of q.

Parameters
qThe source real quaternion.
Returns
self.

◆ __itruediv__() [1/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__itruediv__ ( float  t)

Divides the real component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __itruediv__() [2/2]

FRealQuaternion CDPL.Math.FRealQuaternion.__itruediv__ ( object  q)

Divides the real component by the real component of q.

Parameters
qThe source real quaternion.
Returns
self.

◆ __eq__() [1/2]

bool CDPL.Math.FRealQuaternion.__eq__ ( FRealQuaternion  q)

Returns the result of the comparison operation self == q.

Parameters
qThe FRealQuaternion instance to be compared with.
Returns
The result of the comparison operation.

◆ __eq__() [2/2]

bool CDPL.Math.FRealQuaternion.__eq__ ( ConstFQuaternionExpression  q)

Returns the result of the comparison operation self == q.

Parameters
qThe ConstFQuaternionExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [1/2]

bool CDPL.Math.FRealQuaternion.__ne__ ( FRealQuaternion  q)

Returns the result of the comparison operation self != q.

Parameters
qThe FRealQuaternion instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [2/2]

bool CDPL.Math.FRealQuaternion.__ne__ ( ConstFQuaternionExpression  q)

Returns the result of the comparison operation self != q.

Parameters
qThe ConstFQuaternionExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __str__()

str CDPL.Math.FRealQuaternion.__str__ ( )

Returns a string representation of the FRealQuaternion instance.

Returns
The generated string representation.

◆ __pos__()

FRealQuaternion CDPL.Math.FRealQuaternion.__pos__ ( )

Returns self.

Returns
self.

◆ __neg__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__neg__ ( )

Returns the result of the operation self * -1.

Returns
A ConstFQuaternionExpression instance holding the result of the element negation.

◆ __add__() [1/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__add__ ( float  t)

Returns the result of the addition operation self + t.

Parameters
tSpecifies the second addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __add__() [2/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__add__ ( ConstFQuaternionExpression  e)

Returns the result of the addition operation self + e.

Parameters
eSpecifies the second addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __radd__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__radd__ ( float  t)

Returns the result of the addition operation t + self.

Parameters
tSpecifies the first addend.
Returns
A ConstFQuaternionExpression instance holding the result of the addition.

◆ __sub__() [1/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__sub__ ( float  t)

Returns the result of the subtraction operation self - t.

Parameters
tSpecifies the subtrahend.
Returns
A FRealQuaternion instance holding the result of the subtraction.

◆ __sub__() [2/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__sub__ ( ConstFQuaternionExpression  e)

Returns the result of the subtraction operation self - e.

Parameters
eSpecifies the subtrahend.
Returns
A FRealQuaternion instance holding the result of the subtraction.

◆ __rsub__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__rsub__ ( float  t)

Returns the result of the subtraction operation t - self.

Parameters
tSpecifies the minuend.
Returns
A FRealQuaternion instance holding the result of the subtraction.

◆ __mul__() [1/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__mul__ ( float  t)

Returns the result of the multiplication operation self * t.

Parameters
tSpecifies the multiplier.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __mul__() [2/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__mul__ ( ConstFQuaternionExpression  e)

Returns the result of the multiplication operation self * e.

Parameters
eSpecifies the multiplier.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __rmul__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__rmul__ ( float  t)

Returns the result of the multiplication operation t * self.

Parameters
tSpecifies the multiplicand.
Returns
A ConstFQuaternionExpression instance holding the result of the multiplication.

◆ __div__() [1/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__div__ ( float  t)

Returns the result of the division operation self // t.

Parameters
tSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __div__() [2/2]

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__div__ ( ConstFQuaternionExpression  e)

Returns the result of the division operation self // e.

Parameters
eSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __truediv__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__truediv__ ( float  t)

Returns the result of the true division operation self / t.

Parameters
tSpecifies the divisor.
Returns
A ConstFQuaternionExpression instance holding the result of the division.

◆ __rdiv__()

ConstFQuaternionExpression CDPL.Math.FRealQuaternion.__rdiv__ ( float  t)

Returns the result of the division operation t // self.

Parameters
tSpecifies the dividend.
Returns
A ConstFQuaternionExpression instance holding the result of the division.