From 2f122b045c5730c5aea7ac94bf0da6e61c080c04 Mon Sep 17 00:00:00 2001 From: facelessuser Date: Sat, 28 Jan 2023 10:21:24 -0700 Subject: [PATCH] Use slightly more efficient `identity()` instead of `diag()` in `inv()` --- coloraide/algebra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coloraide/algebra.py b/coloraide/algebra.py index f22ad87d3..1180a7f3d 100644 --- a/coloraide/algebra.py +++ b/coloraide/algebra.py @@ -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.