2.1.4.1.3. sf_tools.math.matrix module¶
MATRIX ROUTINES
This module contains methods for matrix operations.
Author: | Samuel Farrens <samuel.farrens@gmail.com> |
---|---|
Version: | 1.2 |
Date: | 20/10/2017 |
-
sf_tools.math.matrix.
gram_schmidt
(matrix, return_opt='orthonormal')[source]¶ Gram-Schmit
This method orthonormalizes the row vectors of the input matrix.
Parameters: - matrix (np.ndarray) – Input matrix array
- return_opt (str {orthonormal, orthogonal, both}) – Option to return u, e or both.
Returns: Return type: Lists of orthogonal vectors, u, and/or orthonormal vectors, e
Todo
Add citation and equation
-
sf_tools.math.matrix.
nuclear_norm
(data)[source]¶ Nuclear norm
This method computes the nuclear (or trace) norm of the input data.
Parameters: data (np.ndarray) – Input data array Returns: Return type: float nuclear norm value Todo
Add equation
-
sf_tools.math.matrix.
project
(u, v)[source]¶ Project vector
This method projects vector v onto vector u.
Parameters: - u (np.ndarray) – Input vector
- v (np.ndarray) – Input vector
Returns: Return type: np.ndarray projection
Todo
Add equation
-
sf_tools.math.matrix.
rot_matrix
(angle)[source]¶ Rotation matrix
This method produces a 2x2 rotation matrix for the given input angle.
Parameters: angle (float) – Rotation angle Returns: Return type: np.ndarray 2x2 rotation matrix
-
sf_tools.math.matrix.
rotate
(matrix, angle)[source]¶ Rotate
This method rotates an input matrix about the input angle.
Parameters: - matrix (np.ndarray) – Input matrix array
- angle (float) – Rotation angle
Returns: Return type: np.ndarray rotated matrix
Raises: ValueError
– For invalid matrix shape
-
class
sf_tools.math.matrix.
PowerMethod
(operator, data_shape, auto_run=True)[source]¶ Bases:
object
Power method class
This method performs implements power method to calculate the spectral radius of the input data
Parameters: