Initial structure for refactoring, some conversions still missing. Especially required further test cases.

This commit is contained in:
Klaus Basan
2013-04-19 00:19:41 +02:00
parent 5bf308c54b
commit 8121babe77
22 changed files with 607 additions and 120 deletions

View File

@@ -52,6 +52,30 @@ CMatrix3x3 CMatrix3x3::inverse() const
return inverse;
}
/*
* Get a row
*/
CMatrix1x3 CMatrix3x3::getRow(int row) const
{
bool valid = row >= 0 && row <= 3;
Q_ASSERT_X(valid, "getRow", "invalid row");
if (!valid) throw new std::range_error("invalid row");
return CMatrix1x3(this->getElement(row, 0), this->getElement(row, 1), this->getElement(row, 2));
}
/*
* Get a column
*/
CMatrix3x1 CMatrix3x3::getColumn(int column) const
{
bool valid = column >= 0 && column <= 3;
Q_ASSERT_X(valid, "getColumn", "invalid column");
if (!valid) throw new std::range_error("invalid column");
return CMatrix3x1(this->getElement(0, column), this->getElement(1, column), this->getElement(2, column));
}
} // namespace
} // namespace