mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
[mypy] Fix directory arithmetic_analysis (#4304)
* fix directory arithmetic_analysis * Update build.yml * temporary fix for psf/black bug see https://github.com/psf/black/issues/2079 * Update in_static_equilibrium.py
This commit is contained in:
@ -7,7 +7,7 @@ Gaussian elimination - https://en.wikipedia.org/wiki/Gaussian_elimination
|
||||
import numpy as np
|
||||
|
||||
|
||||
def retroactive_resolution(coefficients: np.matrix, vector: np.array) -> np.array:
|
||||
def retroactive_resolution(coefficients: np.matrix, vector: np.ndarray) -> np.ndarray:
|
||||
"""
|
||||
This function performs a retroactive linear system resolution
|
||||
for triangular matrix
|
||||
@ -38,7 +38,7 @@ def retroactive_resolution(coefficients: np.matrix, vector: np.array) -> np.arra
|
||||
return x
|
||||
|
||||
|
||||
def gaussian_elimination(coefficients: np.matrix, vector: np.array) -> np.array:
|
||||
def gaussian_elimination(coefficients: np.matrix, vector: np.ndarray) -> np.ndarray:
|
||||
"""
|
||||
This function performs Gaussian elimination method
|
||||
|
||||
@ -57,7 +57,7 @@ def gaussian_elimination(coefficients: np.matrix, vector: np.array) -> np.array:
|
||||
# coefficients must to be a square matrix so we need to check first
|
||||
rows, columns = np.shape(coefficients)
|
||||
if rows != columns:
|
||||
return []
|
||||
return np.array((), dtype=float)
|
||||
|
||||
# augmented matrix
|
||||
augmented_mat = np.concatenate((coefficients, vector), axis=1)
|
||||
|
Reference in New Issue
Block a user