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

Represents the outcome of mathematical expressions/operations that result in a 3D grid. More...

+ Inheritance diagram for CDPL.Math.DGridExpression:

Public Member Functions

None swap (DGridExpression e)
 Swaps the contents of this grid expression with those of e. More...
 
DGridExpression assign (DGridExpression e)
 Assigns the contents of the grid expression e to this expression. More...
 
DGridExpression assign (ConstFGridExpression e)
 Assigns the contents of the grid expression e to this expression. More...
 
DGridExpression assign (ConstDGridExpression e)
 Assigns the contents of the grid expression e to this expression. More...
 
None assign (object a)
 Assigns the contents of the 3D numpy.ndarray object a to this grid expression. More...
 
None setElement (int i, int j, int k, float v)
 Sets the value of the element (i, j, k) to v. More...
 
None __setitem__ (tuple ijk, float v)
 Sets the value of the element (i, j, k) to v. More...
 
DGridExpression __iadd__ (DGridExpression e)
 Adds the grid expression e element-wise to this expression. More...
 
DGridExpression __iadd__ (ConstDGridExpression e)
 Adds the grid expression e element-wise to this expression. More...
 
DGridExpression __isub__ (DGridExpression e)
 Subtracts the grid expression e element-wise from this expression. More...
 
DGridExpression __isub__ (ConstDGridExpression e)
 Subtracts the grid expression e element-wise from this expression. More...
 
DGridExpression __imul__ (float t)
 Multiplies every element by the scalar t. More...
 
DGridExpression __idiv__ (float t)
 Divides every element by the scalar t. More...
 
DGridExpression __itruediv__ (float t)
 Divides every element by the scalar t. More...
 
- Public Member Functions inherited from CDPL.Math.ConstDGridExpression
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
int getSize1 ()
 Returns the first-axis size. More...
 
int getSize2 ()
 Returns the second-axis size. More...
 
int getSize3 ()
 Returns the third-axis size. More...
 
bool isEmpty ()
 Tells whether the grid is empty. More...
 
float getElement (int i, int j, int k)
 Returns the element at (i, j, k). More...
 
object toArray ()
 Converts the ConstDGridExpression instance into a corresponding numpy.ndarray object. More...
 
float __call__ (int i, int j, int k)
 Returns the element at (i, j, k). More...
 
float __getitem__ (tuple ijk)
 Returns the element at (i, j, k). More...
 
int __len__ ()
 Returns the total element count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \). More...
 
bool __eq__ (ConstDGridExpression e)
 Returns the result of the comparison operation self == e. More...
 
bool __ne__ (ConstDGridExpression e)
 Returns the result of the comparison operation self != e. More...
 
str __str__ ()
 Returns a string representation of the ConstDGridExpression instance. More...
 
ConstDGridExpression __pos__ ()
 Returns self. More...
 
ConstDGridExpression __neg__ ()
 Returns the result of the operation self * -1. More...
 
ConstDGridExpression __add__ (ConstDGridExpression e)
 Returns the result of the addition operation self + e. More...
 
ConstDGridExpression __sub__ (ConstDGridExpression e)
 Returns the result of the subtraction operation self - e. More...
 
ConstDGridExpression __mul__ (float t)
 Returns the result of the multiplication operation self * t. More...
 
ConstDGridExpression __div__ (float t)
 Returns the result of the division operation self // t. More...
 
ConstDGridExpression __truediv__ (float t)
 Returns the result of the true division operation self / t. More...
 
ConstDGridExpression __rmul__ (float t)
 Returns the result of the multiplication operation t * self. More...
 

Additional Inherited Members

- Properties inherited from CDPL.Math.ConstDGridExpression
 objectID = property(getObjectID)
 
 size1 = property(getSize1)
 
 size2 = property(getSize2)
 
 size3 = property(getSize3)
 

Detailed Description

Represents the outcome of mathematical expressions/operations that result in a 3D grid.

Member Function Documentation

◆ swap()

None CDPL.Math.DGridExpression.swap ( DGridExpression  e)

Swaps the contents of this grid expression with those of e.

Parameters
eThe grid expression to swap with.

◆ assign() [1/4]

DGridExpression CDPL.Math.DGridExpression.assign ( DGridExpression  e)

Assigns the contents of the grid expression e to this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ assign() [2/4]

DGridExpression CDPL.Math.DGridExpression.assign ( ConstFGridExpression  e)

Assigns the contents of the grid expression e to this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ assign() [3/4]

DGridExpression CDPL.Math.DGridExpression.assign ( ConstDGridExpression  e)

Assigns the contents of the grid expression e to this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ assign() [4/4]

None CDPL.Math.DGridExpression.assign ( object  a)

Assigns the contents of the 3D numpy.ndarray object a to this grid expression.

Parameters
aThe numpy.ndarray object.
See also
[NUMPY]

◆ setElement()

None CDPL.Math.DGridExpression.setElement ( int  i,
int  j,
int  k,
float  v 
)

Sets the value of the element (i, j, k) to v.

Parameters
iThe zero-based first-axis index.
jThe zero-based second-axis index.
kThe zero-based third-axis index.
vThe new value of the element.
Exceptions
Base.IndexErrorif any of the indices is out of range.

◆ __setitem__()

None CDPL.Math.DGridExpression.__setitem__ ( tuple  ijk,
float  v 
)

Sets the value of the element (i, j, k) to v.

Parameters
iThe zero-based first-axis index.
jThe zero-based second-axis index.
kThe zero-based third-axis index.
vThe new value of the element.
Exceptions
Base.IndexErrorif any of the indices is out of range.

◆ __iadd__() [1/2]

DGridExpression CDPL.Math.DGridExpression.__iadd__ ( DGridExpression  e)

Adds the grid expression e element-wise to this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ __iadd__() [2/2]

DGridExpression CDPL.Math.DGridExpression.__iadd__ ( ConstDGridExpression  e)

Adds the grid expression e element-wise to this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ __isub__() [1/2]

DGridExpression CDPL.Math.DGridExpression.__isub__ ( DGridExpression  e)

Subtracts the grid expression e element-wise from this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ __isub__() [2/2]

DGridExpression CDPL.Math.DGridExpression.__isub__ ( ConstDGridExpression  e)

Subtracts the grid expression e element-wise from this expression.

Parameters
eThe source grid expression.
Returns
self.

◆ __imul__()

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

Multiplies every element by the scalar t.

Parameters
tThe scalar multiplier.
Returns
self.

◆ __idiv__()

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

Divides every element by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.

◆ __itruediv__()

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

Divides every element by the scalar t.

Parameters
tThe scalar divisor.
Returns
self.