Open alexey-malov opened 4 years ago
i != j
- избыточное условиеoptional<Matrix3x3>
[[nodiscard]] bool Invert3x3Matrix(Matrix3x3 &matrix)
{
float det = GetDeterminant3x3(matrix);
if (det == 0)
{
return false;
//throw std::logic_error("Determinant is zero. Inverted matrix do not exist");
}
TransposeMatrix(matrix);
matrix = GetMinorMatrix(matrix);
MultiplyMatrixByNumber(matrix, 1 / det);
return true;
}
https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L162