slightly better minor
This commit is contained in:
@@ -83,11 +83,11 @@ impl<const H: usize, const W: usize> Matrix<H, W> {
|
||||
}
|
||||
|
||||
pub fn cofactor(&self, row: usize, col: usize) -> f32 {
|
||||
self.minor(row, col) * if row + col % 1 == 0 {
|
||||
1.0
|
||||
}
|
||||
else {
|
||||
-1.0
|
||||
let minor = self.minor(row, col);
|
||||
if row + col % 1 == 0 {
|
||||
minor
|
||||
} else {
|
||||
minor * -1.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user