package math.matrix;

import math.utils.Util;

public class Matrix24 {
    public static void main(String[] args) {
        double[][] array = {{2, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        Matrix matrix = new Matrix(array);
        matrix.printToConsole();
        Util.print("");
        Matrix matrixac = new Matrix(matrix.getRowCount(), matrix.getColCount());
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                double ac = MatrixUtil.algComplement(matrix, i + 1, j + 1);
                try {
                    matrixac.setCell(i, j, ac);
                } catch (MatrixException e) {
                    e.printStackTrace();
                }
            }
        }
        matrixac.printToConsole();
        double det = matrix.det();
        Util.print("");
        Util.print("det: " + det);
        Matrix matrix1 = MatrixUtil.transpose(matrixac);
        matrix1.printToConsole();
        Util.print("det: " + matrix1.det());
    }
}
