On Wed May 17 09:15:05 2023 +0000, Bartosz Kosiorek wrote:
I have tried such approach, but unfortunately I don't know how to do not calculate `matrix_det(matrix)` twice. Maybe we could introduce function and provide calculated `det`, like:
static inline BOOL check_det(GDIPCONST REAL det) { return (fabs(det) >= 1e-5); }
for
if(matrix->matrix[1] == 0 && matrix->matrix[2] == 0)
check we are already using that check for optimization. So with proposed optimization, we have limited that check to one.
I don't see a way to do this optimization while leaving the logic in GdipIsMatrixInvertible intact. There isn't much logic in there to begin with, so to me it seems fine to duplicate.