array_matrix/matrix/
cofactor.rs1use crate::{SquareMatrix, Transpose, Adj};
2
3pub trait Cofactor: SquareMatrix
4where
5 Self::Output: SquareMatrix
6{
7 type Output;
8
9 fn cofactor(&self) -> Self::Output;
27}
28
29impl<M> Cofactor for M
30where
31 Self: Adj,
32 <Self as Adj>::Output: Transpose,
33 <<Self as Adj>::Output as Transpose>::Output: SquareMatrix
34{
35 type Output = <<Self as Adj>::Output as Transpose>::Output;
36 fn cofactor(&self) -> Self::Output
37 {
38 self.adj().transpose()
39 }
40}