![]() |
Chemical Data Processing Library Python API - Version 1.4.0
|
Matrix expression proxy that views a strided rectangular slice of an underlying matrix. More...
Inheritance diagram for CDPL.Math.FMatrixSlice:Public Member Functions | |
| None | __init__ (FMatrixSlice s) |
Contructs a copy of the FMatrixSlice instance s. More... | |
| None | __init__ (FMatrixExpression m, Slice s1, Slice s2) |
| Constructs the matrix slice proxy viewing rows in s1 and columns in s2 of m. More... | |
| int | getStart1 () |
| Returns the row slice's start index in the wrapped matrix. More... | |
| int | getStart2 () |
| Returns the column slice's start index in the wrapped matrix. More... | |
| int | getStride1 () |
| Returns the row slice's stride in the wrapped matrix. More... | |
| int | getStride2 () |
| Returns the column slice's stride in the wrapped matrix. More... | |
| int | getObjectID () |
| Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
| FMatrixSlice | assign (ConstFMatrixExpression e) |
| Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | assign (ConstDMatrixExpression e) |
| Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | assign (ConstLMatrixExpression e) |
| Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | assign (ConstULMatrixExpression e) |
| Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | assign (FMatrixSlice s) |
| Copy-assigns the contents of s to this matrix slice (via a temporary to handle aliasing). More... | |
| None | assign (object a) |
Assigns the contents of the numpy.ndarray object a to this matrix slice. More... | |
| int | getSize1 () |
| Returns the number of rows in the proxy (size of the row slice). More... | |
| int | getSize2 () |
| Returns the number of columns in the proxy (size of the column slice). More... | |
| bool | isEmpty () |
| Tells whether the proxy is empty (either slice has size zero). More... | |
| float | getElement (int i, int j) |
| Returns the element at proxy index (i, j). More... | |
| object | toArray () |
Converts the FMatrixSlice instance into a corresponding numpy.ndarray object. More... | |
| None | swap (FMatrixSlice s) |
| Swaps the contents of this matrix slice with those of s (via element-wise swap of the underlying matrix elements). More... | |
| None | setElement (int i, int j, float v) |
| Sets the value of the element at proxy index (i, j) to v. More... | |
| FMatrixExpression | getData () |
| Returns the wrapped matrix. More... | |
| float | __call__ (int i, int j) |
| Returns the element at proxy index (i, j). More... | |
| float | __getitem__ (tuple ij) |
| Returns the element at proxy index (i, j). More... | |
| int | __len__ () |
| Returns the number of rows in the proxy (size of the row slice). More... | |
| bool | __eq__ (FMatrixSlice s) |
Returns the result of the comparison operation self == s. More... | |
| bool | __eq__ (ConstFMatrixExpression e) |
Returns the result of the comparison operation self == e. More... | |
| bool | __ne__ (FMatrixSlice s) |
Returns the result of the comparison operation self != s. More... | |
| bool | __ne__ (ConstFMatrixExpression e) |
Returns the result of the comparison operation self != e. More... | |
| str | __str__ () |
Returns a string representation of the FMatrixSlice instance. More... | |
| FMatrixSlice | __pos__ () |
| Returns self. More... | |
| ConstFMatrixExpression | __neg__ () |
Returns the result of the operation self * -1. More... | |
| ConstFMatrixExpression | __add__ (ConstFMatrixExpression e) |
Returns the result of the addition operation self + e. More... | |
| ConstFMatrixExpression | __sub__ (ConstFMatrixExpression e) |
Returns the result of the subtraction operation self - e. More... | |
| ConstFMatrixExpression | __mul__ (float t) |
Returns the result of the multiplication operation self * t. More... | |
| ConstFMatrixExpression | __mul__ (ConstFMatrixExpression e) |
Returns the result of the multiplication operation self * e. More... | |
| ConstFVectorExpression | __mul__ (ConstFVectorExpression e) |
Returns the result of the multiplication operation self * e. More... | |
| ConstFMatrixExpression | __div__ (float t) |
Returns the result of the division operation self // t. More... | |
| ConstFMatrixExpression | __truediv__ (float t) |
Returns the result of the true division operation self / t. More... | |
| ConstFMatrixExpression | __rmul__ (float t) |
Returns the result of the multiplication operation t * self. More... | |
| None | __setitem__ (tuple ij, float v) |
| Sets the value of the element at proxy index (i, j) to v. More... | |
| FMatrixSlice | __iadd__ (FMatrixSlice s) |
| Adds the elements of the matrix slice s to this slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | __iadd__ (ConstFMatrixExpression e) |
| Adds the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | __isub__ (FMatrixSlice s) |
| Subtracts the elements of the matrix slice s from this slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | __isub__ (ConstFMatrixExpression e) |
| Subtracts the elements of the matrix expression e from this matrix slice (via a temporary to handle aliasing). More... | |
| FMatrixSlice | __imul__ (float t) |
| Multiplies every element of this matrix slice by the scalar t. More... | |
| FMatrixSlice | __idiv__ (float t) |
| Divides every element of this matrix slice by the scalar t. More... | |
| FMatrixSlice | __itruediv__ (float t) |
| Divides every element of this matrix slice by the scalar t. More... | |
Properties | |
| objectID = property(getObjectID) | |
| size1 = property(getSize1) | |
| size2 = property(getSize2) | |
| data = property(getData) | |
| start1 = property(getStart1) | |
| start2 = property(getStart2) | |
| stride1 = property(getStride1) | |
| stride2 = property(getStride2) | |
Matrix expression proxy that views a strided rectangular slice of an underlying matrix.
| None CDPL.Math.FMatrixSlice.__init__ | ( | FMatrixSlice | s | ) |
Contructs a copy of the FMatrixSlice instance s.
| s | The FMatrixSlice instance to copy. |
| None CDPL.Math.FMatrixSlice.__init__ | ( | FMatrixExpression | m, |
| Slice | s1, | ||
| Slice | s2 | ||
| ) |
Constructs the matrix slice proxy viewing rows in s1 and columns in s2 of m.
| m | The wrapped matrix. |
| s1 | The row slice (start, stride, size). |
| s2 | The column slice (start, stride, size). |
| int CDPL.Math.FMatrixSlice.getStart1 | ( | ) |
Returns the row slice's start index in the wrapped matrix.
| int CDPL.Math.FMatrixSlice.getStart2 | ( | ) |
Returns the column slice's start index in the wrapped matrix.
| int CDPL.Math.FMatrixSlice.getStride1 | ( | ) |
Returns the row slice's stride in the wrapped matrix.
| int CDPL.Math.FMatrixSlice.getStride2 | ( | ) |
Returns the column slice's stride in the wrapped matrix.
| int CDPL.Math.FMatrixSlice.getObjectID | ( | ) |
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python FMatrixSlice 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 FMatrixSlice 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().
| FMatrixSlice CDPL.Math.FMatrixSlice.assign | ( | ConstFMatrixExpression | e | ) |
Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.assign | ( | ConstDMatrixExpression | e | ) |
Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.assign | ( | ConstLMatrixExpression | e | ) |
Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.assign | ( | ConstULMatrixExpression | e | ) |
Assigns the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.assign | ( | FMatrixSlice | s | ) |
Copy-assigns the contents of s to this matrix slice (via a temporary to handle aliasing).
| s | The source matrix slice. |
| None CDPL.Math.FMatrixSlice.assign | ( | object | a | ) |
Assigns the contents of the numpy.ndarray object a to this matrix slice.
| a | The numpy.ndarray object. |
| int CDPL.Math.FMatrixSlice.getSize1 | ( | ) |
Returns the number of rows in the proxy (size of the row slice).
| int CDPL.Math.FMatrixSlice.getSize2 | ( | ) |
Returns the number of columns in the proxy (size of the column slice).
| bool CDPL.Math.FMatrixSlice.isEmpty | ( | ) |
Tells whether the proxy is empty (either slice has size zero).
True if either slice has zero size, and False otherwise. | float CDPL.Math.FMatrixSlice.getElement | ( | int | i, |
| int | j | ||
| ) |
Returns the element at proxy index (i, j).
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
m(s1(i), s2(j)). | object CDPL.Math.FMatrixSlice.toArray | ( | ) |
Converts the FMatrixSlice instance into a corresponding numpy.ndarray object.
numpy.ndarray object. | None CDPL.Math.FMatrixSlice.swap | ( | FMatrixSlice | s | ) |
Swaps the contents of this matrix slice with those of s (via element-wise swap of the underlying matrix elements).
| s | The matrix slice to swap with. |
| None CDPL.Math.FMatrixSlice.setElement | ( | int | i, |
| int | j, | ||
| float | v | ||
| ) |
Sets the value of the element at proxy index (i, j) to v.
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
| Base.IndexError | if any of the indices is out of range. |
| FMatrixExpression CDPL.Math.FMatrixSlice.getData | ( | ) |
Returns the wrapped matrix.
| float CDPL.Math.FMatrixSlice.__call__ | ( | int | i, |
| int | j | ||
| ) |
Returns the element at proxy index (i, j).
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
m(s1(i), s2(j)). | float CDPL.Math.FMatrixSlice.__getitem__ | ( | tuple | ij | ) |
Returns the element at proxy index (i, j).
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
m(s1(i), s2(j)). | int CDPL.Math.FMatrixSlice.__len__ | ( | ) |
Returns the number of rows in the proxy (size of the row slice).
| bool CDPL.Math.FMatrixSlice.__eq__ | ( | FMatrixSlice | s | ) |
Returns the result of the comparison operation self == s.
| s | The FMatrixSlice instance to be compared with. |
| bool CDPL.Math.FMatrixSlice.__eq__ | ( | ConstFMatrixExpression | e | ) |
Returns the result of the comparison operation self == e.
| e | The ConstFMatrixExpression instance to be compared with. |
| bool CDPL.Math.FMatrixSlice.__ne__ | ( | FMatrixSlice | s | ) |
Returns the result of the comparison operation self != s.
| s | The FMatrixSlice instance to be compared with. |
| bool CDPL.Math.FMatrixSlice.__ne__ | ( | ConstFMatrixExpression | e | ) |
Returns the result of the comparison operation self != e.
| e | The ConstFMatrixExpression instance to be compared with. |
| str CDPL.Math.FMatrixSlice.__str__ | ( | ) |
Returns a string representation of the FMatrixSlice instance.
| FMatrixSlice CDPL.Math.FMatrixSlice.__pos__ | ( | ) |
Returns self.
| ConstFMatrixExpression CDPL.Math.FMatrixSlice.__neg__ | ( | ) |
Returns the result of the operation self * -1.
ConstFMatrixExpression instance holding the result of the element negation. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__add__ | ( | ConstFMatrixExpression | e | ) |
Returns the result of the addition operation self + e.
| e | Specifies the second addend. |
ConstFMatrixExpression instance holding the result of the addition. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__sub__ | ( | ConstFMatrixExpression | e | ) |
Returns the result of the subtraction operation self - e.
| e | Specifies the subtrahend. |
FMatrixSlice instance holding the result of the subtraction. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__mul__ | ( | float | t | ) |
Returns the result of the multiplication operation self * t.
| t | Specifies the multiplier. |
ConstFMatrixExpression instance holding the result of the multiplication. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__mul__ | ( | ConstFMatrixExpression | e | ) |
Returns the result of the multiplication operation self * e.
| e | Specifies the multiplier. |
ConstFMatrixExpression instance holding the result of the multiplication. | ConstFVectorExpression CDPL.Math.FMatrixSlice.__mul__ | ( | ConstFVectorExpression | e | ) |
Returns the result of the multiplication operation self * e.
| e | Specifies the multiplier. |
ConstFVectorExpression instance holding the result of the multiplication. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__div__ | ( | float | t | ) |
Returns the result of the division operation self // t.
| t | Specifies the divisor. |
ConstFMatrixExpression instance holding the result of the division. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__truediv__ | ( | float | t | ) |
Returns the result of the true division operation self / t.
| t | Specifies the divisor. |
ConstFMatrixExpression instance holding the result of the division. | ConstFMatrixExpression CDPL.Math.FMatrixSlice.__rmul__ | ( | float | t | ) |
Returns the result of the multiplication operation t * self.
| t | Specifies the multiplicand. |
ConstFMatrixExpression instance holding the result of the multiplication. | None CDPL.Math.FMatrixSlice.__setitem__ | ( | tuple | ij, |
| float | v | ||
| ) |
Sets the value of the element at proxy index (i, j) to v.
| i | The zero-based proxy row index. |
| j | The zero-based proxy column index. |
| v | The new value of the element. |
| Base.IndexError | if any of the indices is out of range. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__iadd__ | ( | FMatrixSlice | s | ) |
Adds the elements of the matrix slice s to this slice (via a temporary to handle aliasing).
| s | The source matrix slice. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__iadd__ | ( | ConstFMatrixExpression | e | ) |
Adds the elements of the matrix expression e to this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__isub__ | ( | FMatrixSlice | s | ) |
Subtracts the elements of the matrix slice s from this slice (via a temporary to handle aliasing).
| s | The source matrix slice. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__isub__ | ( | ConstFMatrixExpression | e | ) |
Subtracts the elements of the matrix expression e from this matrix slice (via a temporary to handle aliasing).
| e | The source matrix expression. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__imul__ | ( | float | t | ) |
Multiplies every element of this matrix slice by the scalar t.
| t | The scalar multiplier. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__idiv__ | ( | float | t | ) |
Divides every element of this matrix slice by the scalar t.
| t | The scalar divisor. |
| FMatrixSlice CDPL.Math.FMatrixSlice.__itruediv__ | ( | float | t | ) |
Divides every element of this matrix slice by the scalar t.
| t | The scalar divisor. |