Defined as:
sdynpy.core.sdynpy_matrix.MatrixModule:
sdynpy.core.sdynpy_matrixSource: GitHub
Parent:
sdynpy.SdynpyArrayParent:
numpy.ndarray
Signature¶
class sdynpy.Matrix(shape, nrows, ncols, is_complex=False, buffer=None, offset=0, strides=None, order=None)Matrix with degrees of freedom stored for better bookkeeping.
Use the matrix helper function to create the object.
Attributes¶
| Name | Summary |
|---|---|
coordinate | Returns the full coordinate array for the matrix |
H | |
num_coordinate_columns | Returns the number of coordinate columns |
num_coordinate_rows | Returns the number of coordinate rows |
T | View of the transposed array. |
coordinate¶
Returns the full coordinate array for the matrix
H¶
num_coordinate_columns¶
Returns the number of coordinate columns
num_coordinate_rows¶
Returns the number of coordinate rows
T¶
Methods¶
| Name | Summary |
|---|---|
argsort_coordinate | Returns indices used to sort the coordinates on the rows and columns |
data_dtype | Data type of the underlying numpy structured array for real shapes |
eye | Creates an identity matrix with the specified coordinates |
pinv | Creates the pseudoinverse of the matrix |
plot | Plots the matrix with coordinates labeled |
sort_coordinate | Returns a copy of the Matrix with coordinate sorted |
argsort_coordinate¶
Source: GitHub
def sdynpy.Matrix.argsort_coordinate(self)Returns indices used to sort the coordinates on the rows and columns
Returns¶
row_indices
Indices used to sort the row coordinates.
column_indices
Indices used to sort the column coordinates
data_dtype¶
Source: GitHub
def sdynpy.Matrix.data_dtype(rows, columns, is_complex=False)Data type of the underlying numpy structured array for real shapes
Parameters¶
rows : int Number of rows in the matrix
columns : int Number of columns in the matrix
Returns¶
list
Numpy dtype that can be passed into any of the numpy array
constructors
eye¶
Source: GitHub
def sdynpy.Matrix.eye(cls, row_coordinate, column_coordinate=None)Creates an identity matrix with the specified coordinates
Parameters¶
row_coordinate : CoordinateArray Coordinate array to use as the row coordinates
column_coordinate : CoordinateArray, optional Coordinate array to use as the column coordinates. If not specified, the row coordinates are used.
Returns¶
Matrix
Diagonal matrix with the specified coordinates
pinv¶
Source: GitHub
def sdynpy.Matrix.pinv(self, **pinv_params)Creates the pseudoinverse of the matrix
Parameters¶
**pinv_params : various Extra keyword arguments are passed directly to np.linalg.pinv
Returns¶
Matrix
A matrix consisting of the pseudoinverse of the original matrix
plot¶
Source: GitHub
def sdynpy.Matrix.plot(self, ax=None, show_colorbar=True, **imshow_args)Plots the matrix with coordinates labeled
Parameters¶
ax : axis, optional Axis on which the matrix will be plotted. If not specified, a new figure will be created.
show_colorbar : bool, optional If true, show a colorbar. Default is true.
**imshow_args : various Additional arguments passed to imshow
Raises¶
ValueError
Raised if matrix is multi-dimensional.
sort_coordinate¶
Source: GitHub
def sdynpy.Matrix.sort_coordinate(self)Returns a copy of the Matrix with coordinate sorted
Returns¶
return_val : Matrix Matrix with row and column coordinates sorted.