Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f0f0408

Browse filesBrowse files
committed
creating compute_matrix func
1 parent a8ebbe8 commit f0f0408
Copy full SHA for f0f0408

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
import numpy as np
2+
from matrix_utils import get_square_matrix
23

4+
def compute_inverse(matrix):
5+
try:
6+
inverse_matrix = np.linalg.inv(matrix)
7+
return inverse_matrix
8+
except np.linalg.LinAlgError:
9+
raise ValueError('The matrix is not invertible because its determinant is zero.')
10+
11+
matrix = get_square_matrix()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.