Skip to content

Commit

Permalink
debug #2
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvsh committed May 19, 2020
1 parent edd7d72 commit 9339f56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language = "bash"
run = "python processor.py"

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ The code may (most certainly) have bugs. Please feel free to open up an issue de

## ToDO
- Add comments
- Try to find extreme cases when this doesn't work.
- Beautify output
- Debug ?!


9 changes: 3 additions & 6 deletions processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def inverse(self):
return 1 / M[0][0]
elif len(M) == 2:
det = self.det_recur(M)
if det == 0:
return "This matrix doesn't have an inverse.\nReason: Singular Matrix"
return [[M[1][1] / det, -1 * M[0][1] / det], [-1 * M[1][0] / det, M[0][0] / det]]
elif (self.det_recur(M) != 0) and (self.R == self.C):
det = self.determinant()
Expand Down Expand Up @@ -210,9 +212,4 @@ def init():


init()
"""
2.65 3.54 3.88 8.99
3.12 5.45 7.77 5.56
5.31 2.23 2.33 9.81
1.67 1.67 1.01 9.99
"""

0 comments on commit 9339f56

Please sign in to comment.