Skip to content

Commit

Permalink
Use slightly more efficient identity() instead of diag() in inv()
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Jan 28, 2023
1 parent 2aa6cc3 commit 2f122b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coloraide/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ def inv(matrix: MatrixLike) -> Matrix:
m = acopy(matrix)

# Create an identity matrix of the same size as our provided vector
im = diag([1] * s[0])
im = identity(s[0])

# Iterating through each row, we will scale each row by it's "focus diagonal".
# Then using the scaled row, we will adjust the other rows.
Expand Down

0 comments on commit 2f122b0

Please sign in to comment.