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

Immutable grid where all elements have the value zero of type double. More...

+ Inheritance diagram for CDPL.Math.DZeroGrid:

Public Member Functions

None __init__ ()
 Constructs an empty zero grid (zero size on every axis).
 
None __init__ (DZeroGrid g)
 Contructs a copy of the DZeroGrid instance g. More...
 
None __init__ (int m, int n, int o)
 Constructs a zero grid of size m×n×o. More...
 
None resize (int m, int n, int o)
 Resizes the grid axes to (m, n, o). More...
 
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 (any axis has zero size). More...
 
float getElement (int i, int j, int k)
 Returns the zero element. More...
 
float getElement (int i)
 Returns the zero element. More...
 
object toArray ()
 Converts the DZeroGrid instance into a corresponding numpy.ndarray object. More...
 
int getSize ()
 Returns the total element count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \). More...
 
DZeroGrid assign (DZeroGrid g)
 Copy-assigns the axis sizes from g. More...
 
None swap (DZeroGrid g)
 Swaps the axis sizes with g. More...
 
float __call__ (int i, int j, int k)
 Returns the zero element. More...
 
float __call__ (int i)
 Returns the zero element. More...
 
float __getitem__ (tuple ijk)
 Returns the zero element. More...
 
float __getitem__ (int i)
 Returns the zero element. More...
 
int __len__ ()
 Returns the total element count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \). More...
 
bool __eq__ (DZeroGrid g)
 Returns the result of the comparison operation self == g. More...
 
bool __eq__ (ConstDGridExpression e)
 Returns the result of the comparison operation self == e. More...
 
bool __ne__ (DZeroGrid g)
 Returns the result of the comparison operation self != g. More...
 
bool __ne__ (ConstDGridExpression e)
 Returns the result of the comparison operation self != e. More...
 
str __str__ ()
 Returns a string representation of the DZeroGrid instance. More...
 
DZeroGrid __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...
 

Properties

 objectID = property(getObjectID)
 
 size1 = property(getSize1)
 
 size2 = property(getSize2)
 
 size3 = property(getSize3)
 

Detailed Description

Immutable grid where all elements have the value zero of type double.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Math.DZeroGrid.__init__ ( DZeroGrid  g)

Contructs a copy of the DZeroGrid instance g.

Parameters
gThe DZeroGrid instance to copy.

◆ __init__() [2/2]

None CDPL.Math.DZeroGrid.__init__ ( int  m,
int  n,
int  o 
)

Constructs a zero grid of size m×n×o.

Parameters
mThe first-axis size.
nThe second-axis size.
oThe third-axis size.

Member Function Documentation

◆ resize()

None CDPL.Math.DZeroGrid.resize ( int  m,
int  n,
int  o 
)

Resizes the grid axes to (m, n, o).

Parameters
mThe new first-axis size.
nThe new second-axis size.
oThe new third-axis size.

◆ getObjectID()

int CDPL.Math.DZeroGrid.getObjectID ( )

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

Different Python DZeroGrid 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 DZeroGrid 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.

◆ getSize1()

int CDPL.Math.DZeroGrid.getSize1 ( )

Returns the first-axis size.

Returns
The size along the first axis.

◆ getSize2()

int CDPL.Math.DZeroGrid.getSize2 ( )

Returns the second-axis size.

Returns
The size along the second axis.

◆ getSize3()

int CDPL.Math.DZeroGrid.getSize3 ( )

Returns the third-axis size.

Returns
The size along the third axis.

◆ isEmpty()

bool CDPL.Math.DZeroGrid.isEmpty ( )

Tells whether the grid is empty (any axis has zero size).

Returns
True if any axis is zero, and False otherwise.

◆ getElement() [1/2]

float CDPL.Math.DZeroGrid.getElement ( int  i,
int  j,
int  k 
)

Returns the zero element.

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

◆ getElement() [2/2]

float CDPL.Math.DZeroGrid.getElement ( int  i)

Returns the zero element.

Parameters
iThe zero-based linear index.
Returns
The zero element.
Exceptions
Base.IndexErrorif i is out of range.

◆ toArray()

object CDPL.Math.DZeroGrid.toArray ( )

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

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

◆ getSize()

int CDPL.Math.DZeroGrid.getSize ( )

Returns the total element count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \).

Returns
The total number of elements.

◆ assign()

DZeroGrid CDPL.Math.DZeroGrid.assign ( DZeroGrid  g)

Copy-assigns the axis sizes from g.

Parameters
gThe source zero grid.
Returns
self.

◆ swap()

None CDPL.Math.DZeroGrid.swap ( DZeroGrid  g)

Swaps the axis sizes with g.

Parameters
gThe zero grid to swap with.

◆ __call__() [1/2]

float CDPL.Math.DZeroGrid.__call__ ( int  i,
int  j,
int  k 
)

Returns the zero element.

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

◆ __call__() [2/2]

float CDPL.Math.DZeroGrid.__call__ ( int  i)

Returns the zero element.

Parameters
iThe zero-based linear index.
Returns
The zero element.
Exceptions
Base.IndexErrorif i is out of range.

◆ __getitem__() [1/2]

float CDPL.Math.DZeroGrid.__getitem__ ( tuple  ijk)

Returns the zero element.

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

◆ __getitem__() [2/2]

float CDPL.Math.DZeroGrid.__getitem__ ( int  i)

Returns the zero element.

Parameters
iThe zero-based linear index.
Returns
The zero element.
Exceptions
Base.IndexErrorif i is out of range.

◆ __len__()

int CDPL.Math.DZeroGrid.__len__ ( )

Returns the total element count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \).

Returns
The total number of elements.

◆ __eq__() [1/2]

bool CDPL.Math.DZeroGrid.__eq__ ( DZeroGrid  g)

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

Parameters
gThe DZeroGrid instance to be compared with.
Returns
The result of the comparison operation.

◆ __eq__() [2/2]

bool CDPL.Math.DZeroGrid.__eq__ ( ConstDGridExpression  e)

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

Parameters
eThe ConstDGridExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [1/2]

bool CDPL.Math.DZeroGrid.__ne__ ( DZeroGrid  g)

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

Parameters
gThe DZeroGrid instance to be compared with.
Returns
The result of the comparison operation.

◆ __ne__() [2/2]

bool CDPL.Math.DZeroGrid.__ne__ ( ConstDGridExpression  e)

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

Parameters
eThe ConstDGridExpression instance to be compared with.
Returns
The result of the comparison operation.

◆ __str__()

str CDPL.Math.DZeroGrid.__str__ ( )

Returns a string representation of the DZeroGrid instance.

Returns
The generated string representation.

◆ __pos__()

DZeroGrid CDPL.Math.DZeroGrid.__pos__ ( )

Returns self.

Returns
self.

◆ __neg__()

ConstDGridExpression CDPL.Math.DZeroGrid.__neg__ ( )

Returns the result of the operation self * -1.

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

◆ __add__()

ConstDGridExpression CDPL.Math.DZeroGrid.__add__ ( ConstDGridExpression  e)

Returns the result of the addition operation self + e.

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

◆ __sub__()

ConstDGridExpression CDPL.Math.DZeroGrid.__sub__ ( ConstDGridExpression  e)

Returns the result of the subtraction operation self - e.

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

◆ __mul__()

ConstDGridExpression CDPL.Math.DZeroGrid.__mul__ ( float  t)

Returns the result of the multiplication operation self * t.

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

◆ __div__()

ConstDGridExpression CDPL.Math.DZeroGrid.__div__ ( float  t)

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

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

◆ __truediv__()

ConstDGridExpression CDPL.Math.DZeroGrid.__truediv__ ( float  t)

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

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

◆ __rmul__()

ConstDGridExpression CDPL.Math.DZeroGrid.__rmul__ ( float  t)

Returns the result of the multiplication operation t * self.

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