Relz / OOP

Лабораторные работы по Объектно-ориентированному программированию (IDE - Visual Studio 2015)
0 stars 0 forks source link

Замечания по Invert Matrix #3

Open alexey-malov opened 8 years ago

alexey-malov commented 8 years ago
alexey-malov commented 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);
alexey-malov commented 8 years ago
void GetMinor(const double inputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], double outputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], const unsigned int &line, const unsigned int &column)
alexey-malov commented 8 years ago
//Получение матрицы алгебраических дополнений
void GetAlgebraicAdditionsMatrix(const double inputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH], double outputMatrix[MATRIX_HEIGHT][MATRIX_WIDTH])
alexey-malov commented 8 years ago
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;
        }
    }
}