![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Unbounded dense grid storing floating point values of type float.
More...
Inheritance diagram for CDPL.Math.FGrid:Public Member Functions | |
| None | __init__ () |
| Constructs an empty grid (zero size on every axis). | |
| None | __init__ (FGrid g) |
| Move-constructs a grid from g (g is left in a valid empty state). More... | |
| None | __init__ (int m, int n, int o) |
| Constructs an m × n × o grid with default-initialized elements. More... | |
| None | __init__ (int m, int n, int o, float v) |
| Constructs an m × n × o grid with every element initialized to v. More... | |
| None | __init__ (ConstFGridExpression e) |
Initializes the FGrid instance. More... | |
| None | __init__ (ConstDGridExpression e) |
Initializes the FGrid instance. More... | |
| None | __init__ (object e) |
Initializes the FGrid instance. More... | |
| None | resize (int m, int n, int o, bool preserve=True, float v=0.0) |
| Resizes the grid to \( m \times n \times o \) cells. More... | |
| None | clear (float v=0.0) |
| Sets every cell of the grid to the value v. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| FGrid | assign (ConstFGridExpression e) |
| Resizes this grid to match e and assigns its cells without intermediate temporary. More... | |
| FGrid | assign (ConstDGridExpression e) |
| Resizes this grid to match e and assigns its cells without intermediate temporary. More... | |
| FGrid | assign (object e) |
| Resizes this grid to match e and assigns its cells without intermediate temporary. More... | |
| FGrid | assign (FGrid g) |
| Move-assigns the contents of g to this grid. 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) |
| float | getElement (int i) |
| object | toArray () |
| int | getSize () |
| Returns the total cell count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \). More... | |
| None | swap (FGrid g) |
| Swaps the contents of this grid with those of g. More... | |
| None | setElement (int i, int j, int k, float v) |
| None | setElement (int i, float v) |
| float | __call__ (int i, int j, int k) |
| Returns a reference to the element at (i, j, k). More... | |
| float | __call__ (int i) |
| Returns a reference to the element at linear index i. More... | |
| float | __getitem__ (tuple ijk) |
| float | __getitem__ (int i) |
| int | __len__ () |
| bool | __eq__ (FGrid g) |
Returns the result of the comparison operation self == g. More... | |
| bool | __eq__ (ConstFGridExpression e) |
Returns the result of the comparison operation self == e. More... | |
| bool | __ne__ (FGrid g) |
Returns the result of the comparison operation self != g. More... | |
| bool | __ne__ (ConstFGridExpression e) |
Returns the result of the comparison operation self != e. More... | |
| str | __str__ () |
Returns a string representation of the FGrid instance. More... | |
| FGrid | __pos__ () |
| ConstFGridExpression | __neg__ () |
| ConstFGridExpression | __add__ (ConstFGridExpression e) |
Returns the result of the addition operation self + e. More... | |
| ConstFGridExpression | __sub__ (ConstFGridExpression e) |
Returns the result of the subtraction operation self - e. More... | |
| ConstFGridExpression | __mul__ (float t) |
Returns the result of the multiplication operation self * t. More... | |
| ConstFGridExpression | __div__ (float t) |
Returns the result of the division operation self // t. More... | |
| ConstFGridExpression | __truediv__ (float t) |
Returns the result of the true division operation self / t. More... | |
| ConstFGridExpression | __rmul__ (float t) |
Returns the result of the multiplication operation t * self. More... | |
| None | __setitem__ (tuple ijk, float v) |
| None | __setitem__ (int i, float v) |
| FGrid | __iadd__ (FGrid g) |
Performs the in-place addition operation self += g. More... | |
| FGrid | __iadd__ (ConstFGridExpression e) |
Performs the in-place addition operation self += e. More... | |
| FGrid | __isub__ (FGrid g) |
Performs the in-place subtraction operation self -= g. More... | |
| FGrid | __isub__ (ConstFGridExpression e) |
Performs the in-place subtraction operation self -= e. More... | |
| FGrid | __imul__ (float t) |
Performs the in-place multiplication operation self *= t. More... | |
| FGrid | __idiv__ (float t) |
Performs the in-place division operation self /= t. More... | |
| FGrid | __itruediv__ (float t) |
Properties | |
| objectID = property(getObjectID) | |
| size1 = property(getSize1) | |
| size2 = property(getSize2) | |
| size3 = property(getSize3) | |
Unbounded dense grid storing floating point values of type float.
| None CDPL.Math.FGrid.__init__ | ( | FGrid | g | ) |
Move-constructs a grid from g (g is left in a valid empty state).
| g | The grid to move from. |
| None CDPL.Math.FGrid.__init__ | ( | int | m, |
| int | n, | ||
| int | o | ||
| ) |
Constructs an m × n × o grid with default-initialized elements.
| m | The size along the first axis. |
| n | The size along the second axis. |
| o | The size along the third axis. |
| None CDPL.Math.FGrid.__init__ | ( | int | m, |
| int | n, | ||
| int | o, | ||
| float | v | ||
| ) |
Constructs an m × n × o grid with every element initialized to v.
| m | The size along the first axis. |
| n | The size along the second axis. |
| o | The size along the third axis. |
| v | The element value used to initialize every cell. |
| None CDPL.Math.FGrid.__init__ | ( | ConstFGridExpression | e | ) |
Initializes the FGrid instance.
| e |
| None CDPL.Math.FGrid.__init__ | ( | ConstDGridExpression | e | ) |
Initializes the FGrid instance.
| e |
| None CDPL.Math.FGrid.__init__ | ( | object | e | ) |
Initializes the FGrid instance.
| e |
| None CDPL.Math.FGrid.resize | ( | int | m, |
| int | n, | ||
| int | o, | ||
| bool | preserve = True, |
||
| float | v = 0.0 |
||
| ) |
Resizes the grid to \( m \times n \times o \) cells.
| m | The new first-axis size. |
| n | The new second-axis size. |
| o | The new third-axis size. |
| preserve | If True, existing cell values at indices that remain valid are kept. If False, all cells are set to v. |
| v | The fill value for newly added cells (or for all cells when preserve is False). |
| None CDPL.Math.FGrid.clear | ( | float | v = 0.0 | ) |
Sets every cell of the grid to the value v.
| v | The fill value. |
| int CDPL.Math.FGrid.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python FGrid 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 FGrid 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().
| FGrid CDPL.Math.FGrid.assign | ( | ConstFGridExpression | e | ) |
Resizes this grid to match e and assigns its cells without intermediate temporary.
| e | The source grid expression. |
| FGrid CDPL.Math.FGrid.assign | ( | ConstDGridExpression | e | ) |
Resizes this grid to match e and assigns its cells without intermediate temporary.
| e | The source grid expression. |
| FGrid CDPL.Math.FGrid.assign | ( | object | e | ) |
Resizes this grid to match e and assigns its cells without intermediate temporary.
| e | The source grid expression. |
Move-assigns the contents of g to this grid.
| g | The source grid (left in a valid but unspecified state). |
| int CDPL.Math.FGrid.getSize1 | ( | ) |
Returns the first-axis size.
| int CDPL.Math.FGrid.getSize2 | ( | ) |
Returns the second-axis size.
| int CDPL.Math.FGrid.getSize3 | ( | ) |
Returns the third-axis size.
| bool CDPL.Math.FGrid.isEmpty | ( | ) |
Tells whether the grid is empty.
True if the underlying storage holds no elements, and False otherwise. | float CDPL.Math.FGrid.getElement | ( | int | i, |
| int | j, | ||
| int | k | ||
| ) |
| i | |
| j | |
| k |
| float CDPL.Math.FGrid.getElement | ( | int | i | ) |
| i |
| object CDPL.Math.FGrid.toArray | ( | ) |
| int CDPL.Math.FGrid.getSize | ( | ) |
Returns the total cell count \( \mathrm{size}_1 \cdot \mathrm{size}_2 \cdot \mathrm{size}_3 \).
| None CDPL.Math.FGrid.swap | ( | FGrid | g | ) |
Swaps the contents of this grid with those of g.
| g | The grid to swap with. |
| None CDPL.Math.FGrid.setElement | ( | int | i, |
| int | j, | ||
| int | k, | ||
| float | v | ||
| ) |
| i | |
| j | |
| k | |
| v |
| None CDPL.Math.FGrid.setElement | ( | int | i, |
| float | v | ||
| ) |
| i | |
| v |
| float CDPL.Math.FGrid.__call__ | ( | int | i, |
| int | j, | ||
| int | k | ||
| ) |
Returns a reference to the element at (i, j, k).
| i | The zero-based first-axis index. |
| j | The zero-based second-axis index. |
| k | The zero-based third-axis index. |
| Base.IndexError | if any of the indices is out of range. |
| float CDPL.Math.FGrid.__call__ | ( | int | i | ) |
Returns a reference to the element at linear index i.
| i | The zero-based linear index. |
| Base.IndexError | if i is out of range. |
| float CDPL.Math.FGrid.__getitem__ | ( | tuple | ijk | ) |
| ijk |
| float CDPL.Math.FGrid.__getitem__ | ( | int | i | ) |
| i |
| int CDPL.Math.FGrid.__len__ | ( | ) |
| bool CDPL.Math.FGrid.__eq__ | ( | FGrid | g | ) |
Returns the result of the comparison operation self == g.
| g | The FGrid instance to be compared with. |
| bool CDPL.Math.FGrid.__eq__ | ( | ConstFGridExpression | e | ) |
Returns the result of the comparison operation self == e.
| e | The ConstFGridExpression instance to be compared with. |
| bool CDPL.Math.FGrid.__ne__ | ( | FGrid | g | ) |
Returns the result of the comparison operation self != g.
| g | The FGrid instance to be compared with. |
| bool CDPL.Math.FGrid.__ne__ | ( | ConstFGridExpression | e | ) |
Returns the result of the comparison operation self != e.
| e | The ConstFGridExpression instance to be compared with. |
| str CDPL.Math.FGrid.__str__ | ( | ) |
Returns a string representation of the FGrid instance.
| FGrid CDPL.Math.FGrid.__pos__ | ( | ) |
| ConstFGridExpression CDPL.Math.FGrid.__neg__ | ( | ) |
| ConstFGridExpression CDPL.Math.FGrid.__add__ | ( | ConstFGridExpression | e | ) |
Returns the result of the addition operation self + e.
| e | Specifies the second addend. |
ConstFGridExpression instance holding the result of the addition. | ConstFGridExpression CDPL.Math.FGrid.__sub__ | ( | ConstFGridExpression | e | ) |
Returns the result of the subtraction operation self - e.
| e | Specifies the subtrahend. |
FGrid instance holding the result of the subtraction. | ConstFGridExpression CDPL.Math.FGrid.__mul__ | ( | float | t | ) |
Returns the result of the multiplication operation self * t.
| t | Specifies the multiplier. |
ConstFGridExpression instance holding the result of the multiplication. | ConstFGridExpression CDPL.Math.FGrid.__div__ | ( | float | t | ) |
Returns the result of the division operation self // t.
| t | Specifies the divisor. |
ConstFGridExpression instance holding the result of the division. | ConstFGridExpression CDPL.Math.FGrid.__truediv__ | ( | float | t | ) |
Returns the result of the true division operation self / t.
| t | Specifies the divisor. |
ConstFGridExpression instance holding the result of the division. | ConstFGridExpression CDPL.Math.FGrid.__rmul__ | ( | float | t | ) |
Returns the result of the multiplication operation t * self.
| t | Specifies the multiplicand. |
ConstFGridExpression instance holding the result of the multiplication. | None CDPL.Math.FGrid.__setitem__ | ( | tuple | ijk, |
| float | v | ||
| ) |
| ijk | |
| v |
| None CDPL.Math.FGrid.__setitem__ | ( | int | i, |
| float | v | ||
| ) |
| i | |
| v |
Performs the in-place addition operation self += g.
| g | Specifies the second addend. |
FGrid instance self. | FGrid CDPL.Math.FGrid.__iadd__ | ( | ConstFGridExpression | e | ) |
Performs the in-place addition operation self += e.
| e | Specifies the second addend. |
FGrid instance self. Performs the in-place subtraction operation self -= g.
| g | Specifies the subtrahend. |
FGrid instance self. | FGrid CDPL.Math.FGrid.__isub__ | ( | ConstFGridExpression | e | ) |
Performs the in-place subtraction operation self -= e.
| e | Specifies the subtrahend. |
FGrid instance self. | FGrid CDPL.Math.FGrid.__imul__ | ( | float | t | ) |
Performs the in-place multiplication operation self *= t.
| t | Specifies the multiplier. |
FGrid instance self. | FGrid CDPL.Math.FGrid.__idiv__ | ( | float | t | ) |
Performs the in-place division operation self /= t.
| t | Specifies the divisor. |
FGrid instance self. | FGrid CDPL.Math.FGrid.__itruediv__ | ( | float | t | ) |
| t |