Open alexey-malov opened 8 years ago
double matrixDeterminant = GetMatrix3x3Determinant(matrix);
if (matrixDeterminant == 0)
{
cout << "The inverted matrix does not exist" << "\n";
return 1;
}
double invertedMatrix[MATRIX_HEIGHT][MATRIX_WIDTH];
InvertMatrix(matrix, invertedMatrix, matrixDeterminant);
void GetMinor(const double inputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], double outputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], const unsigned int &line, const unsigned int &column)
//Получение матрицы алгебраических дополнений
void GetAlgebraicAdditionsMatrix(const double inputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], double outputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH])
void TransposeMatrix(const double inputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], double outputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH])
{
GetAlgebraicAdditionsMatrix(inputMatrix, outputMatrix);
for (unsigned int i = 0; i < MATRIX_HEIGHT; ++i)
{
for (unsigned int j = i; j < MATRIX_WIDTH; ++j)
{
double tmp = outputMatrix[i][j];
outputMatrix[i][j] = outputMatrix[j][i];
outputMatrix[j][i] = tmp;
}
}
}