public Matrice <T> Cofacteur(Matrice <T> M) { Matrice <T> C = new Matrice <T>(M.NbLig, M.NbCol); for (int i = 1; i <= M.NbLig; i++) { for (j = 1; j <= M.NbCol; j++) { C[i, j] = new T(); Matrice <T> M_bis = new Matrice <T>(M.NbLig - 1, M.NbCol - 1); for (int k = 1; k <= M_bis.NbLig; k++) { for (int l = 1; l <= M_bis.NbCol; l++) { } } if ((i + j) % 2 == 0) { C[i, j] = M_bis.Determinant(M_bis); } else { C[i, j] = M_bis.Determinant(M_bis).Oppose(); } } } return(C); }
static void Main(string[] args) { /*int d=3; * Matrice<DoubleA> A = new Matrice<FractionA>(d,d); * for (int i=1; i<=d; i++){ * for (int j=1; j<=d; j++){ * A[i,j]= new FractionA(1 , i+j-1); * } * }*/ Matrice <DoubleA> test = new Matrice <DoubleA>(2, 2); test[1, 1] = 1; test[1, 2] = 2; //test[1,3]= 3; test[2, 1] = 3; test[2, 2] = 4; //test[2,3]= 6; //test[3,1]= 3; //test[3,2]= 4; //test[3,3]= 5; DoubleA det = new DoubleA(0); det = test.Determinant(test); Console.WriteLine(det); //FractionA f = new FractionA(3,2); //Console.WriteLine(f.MultiplierPar(f)); }