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

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

+ Inheritance diagram for CDPL.Math.ULRealQuaternion:

Public Member Functions

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

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Math.ULRealQuaternion.__init__ ( ULRealQuaternion  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.ULRealQuaternion.__init__ ( int  r)

Constructs the real quaternion with the supplied real component.

Parameters
rThe real component value.

Member Function Documentation

◆ set()

ULRealQuaternion CDPL.Math.ULRealQuaternion.set ( int   r = 0)

Assigns the scalar r to the real component.

Parameters
rThe scalar value.
Returns
self.

◆ getObjectID()

int CDPL.Math.ULRealQuaternion.getObjectID ( )

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

Different Python ULRealQuaternion 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 ULRealQuaternion 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()

int CDPL.Math.ULRealQuaternion.getC1 ( )

Returns the real component C1.

Returns
The value of C1.

◆ getC2()

int CDPL.Math.ULRealQuaternion.getC2 ( )

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

Returns
The zero element.

◆ getC3()

int CDPL.Math.ULRealQuaternion.getC3 ( )

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

Returns
The zero element.

◆ getC4()

int CDPL.Math.ULRealQuaternion.getC4 ( )

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

Returns
The zero element.

◆ toArray()

object CDPL.Math.ULRealQuaternion.toArray ( )

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

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

◆ assign()

ULRealQuaternion CDPL.Math.ULRealQuaternion.assign ( ULRealQuaternion  q)

Copy-assigns the real component from q.

Parameters
qThe source real quaternion.
Returns
self.

◆ swap()

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

Swaps the real component value with q.

Parameters
qThe real quaternion to swap with.

◆ __iadd__() [1/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__iadd__ ( int  t)

Adds the scalar t to the real component.

Parameters
tThe scalar addend.
Returns
self.

◆ __iadd__() [2/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__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]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__isub__ ( int  t)

Subtracts the scalar t from the real component.

Parameters
tThe scalar subtrahend.
Returns
self.

◆ __isub__() [2/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__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]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__imul__ ( int  t)

Multiplies the real component by the scalar t.

Parameters
tThe scalar multiplier.
Returns
self.

◆ __imul__() [2/2]

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

Multiplies the real component by the real component of q.

Parameters
qThe source real quaternion.
Returns
self.

◆ __idiv__() [1/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__idiv__ ( int  t)

Divides the real component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __idiv__() [2/2]

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

Divides the real component by the real component of q.

Parameters
qThe source real quaternion.
Returns
self.

◆ __itruediv__() [1/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__itruediv__ ( int  t)

Divides the real component by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __itruediv__() [2/2]

ULRealQuaternion CDPL.Math.ULRealQuaternion.__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.ULRealQuaternion.__eq__ ( ULRealQuaternion  q)

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

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

◆ __eq__() [2/2]

bool CDPL.Math.ULRealQuaternion.__eq__ ( ConstULQuaternionExpression  q)

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

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

◆ __ne__() [1/2]

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

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

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

◆ __ne__() [2/2]

bool CDPL.Math.ULRealQuaternion.__ne__ ( ConstULQuaternionExpression  q)

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

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

◆ __str__()

str CDPL.Math.ULRealQuaternion.__str__ ( )

Returns a string representation of the ULRealQuaternion instance.

Returns
The generated string representation.

◆ __pos__()

ULRealQuaternion CDPL.Math.ULRealQuaternion.__pos__ ( )

Returns self.

Returns
self.

◆ __neg__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__neg__ ( )

Returns the result of the operation self * -1.

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

◆ __add__() [1/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__add__ ( int  t)

Returns the result of the addition operation self + t.

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

◆ __add__() [2/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__add__ ( ConstULQuaternionExpression  e)

Returns the result of the addition operation self + e.

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

◆ __radd__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__radd__ ( int  t)

Returns the result of the addition operation t + self.

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

◆ __sub__() [1/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__sub__ ( int  t)

Returns the result of the subtraction operation self - t.

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

◆ __sub__() [2/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__sub__ ( ConstULQuaternionExpression  e)

Returns the result of the subtraction operation self - e.

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

◆ __rsub__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__rsub__ ( int  t)

Returns the result of the subtraction operation t - self.

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

◆ __mul__() [1/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__mul__ ( int  t)

Returns the result of the multiplication operation self * t.

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

◆ __mul__() [2/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__mul__ ( ConstULQuaternionExpression  e)

Returns the result of the multiplication operation self * e.

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

◆ __rmul__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__rmul__ ( int  t)

Returns the result of the multiplication operation t * self.

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

◆ __div__() [1/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__div__ ( int  t)

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

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

◆ __div__() [2/2]

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__div__ ( ConstULQuaternionExpression  e)

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

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

◆ __truediv__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__truediv__ ( int  t)

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

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

◆ __rdiv__()

ConstULQuaternionExpression CDPL.Math.ULRealQuaternion.__rdiv__ ( int  t)

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

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