mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-23 07:42:44 +08:00
fix(mypy): type annotations for linear algebra algorithms (#4317)
* fix(mypy): type annotations for linear algebra algorithms * refactor: remove linear algebra directory from mypy exclude
This commit is contained in:
@ -2,8 +2,11 @@ import numpy as np
|
||||
|
||||
|
||||
def power_iteration(
|
||||
input_matrix: np.array, vector: np.array, error_tol=1e-12, max_iterations=100
|
||||
) -> [float, np.array]:
|
||||
input_matrix: np.ndarray,
|
||||
vector: np.ndarray,
|
||||
error_tol: float = 1e-12,
|
||||
max_iterations: int = 100,
|
||||
) -> tuple[float, np.ndarray]:
|
||||
"""
|
||||
Power Iteration.
|
||||
Find the largest eignevalue and corresponding eigenvector
|
||||
|
Reference in New Issue
Block a user