mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
inverse_error as a separate function (helps with debugging)
This commit is contained in:
parent
676ea3a1f9
commit
1c8f0e7e37
@ -472,17 +472,19 @@ ld det(const transmatrix& T) {
|
||||
return det;
|
||||
}
|
||||
|
||||
void inverse_error(const transmatrix& T) {
|
||||
printf("Warning: inverting a singular matrix\n");
|
||||
display(T);
|
||||
}
|
||||
|
||||
transmatrix inverse(const transmatrix& T) {
|
||||
profile_start(7);
|
||||
|
||||
ld d = det(T);
|
||||
transmatrix T2;
|
||||
if(d == 0) {
|
||||
printf("Warning: inverting a singular matrix\n");
|
||||
display(T);
|
||||
display(T2);
|
||||
T2 = Id;
|
||||
return T2;
|
||||
inverse_error(T);
|
||||
return Id;
|
||||
}
|
||||
|
||||
for(int i=0; i<3; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user