Go to the documentation of this file.
69 static inline bool isEven(
const int Value) {
return Value % 2 == 0; }
71 static inline bool isOdd(
const int Value) {
return Value % 2 != 0; }
92 void operator*=(
const double Scalar) { multiply(Scalar); }
102 const double&
operator()(
const int Row,
const int Col)
const {
return value(Row, Col); }
103 double&
operator()(
const int Row,
const int Col) {
return changeValue(Row, Col); }
151 void setValue(
const int Row,
const int Col,
const double Value);
164 const double&
value(
const int Row,
const int Col)
const;
171 double _matrix[2][2];
Mat2d multiplied(const Mat2d &Other) const
XY diagonal() const
Returns the main diagonal of the matrix.
Mat2d subtracted(const Mat2d &Other) const
void multiply(const Mat2d &Other)
Computes the product of two matrices <me> * <Other>
const double & value(const int Row, const int Col) const
void setCols(const XY &Col1, const XY &Col2)
Assigns the number pairs Col1, Col2 to the two columns of this matrix
static bool isOdd(const int Value)
Definition: Mat2d.h:71
Mat2d added(const Mat2d &Other) const
double & operator()(const int Row, const int Col)
Definition: Mat2d.h:103
void setScale(const double S)
Mat2d powered(const int N) const
void divide(const double Scalar)
void preMultiply(const Mat2d &Other)
Mat2d()
Creates a matrix with null coefficients.
Mat2d transposed() const
Transposes the matrix. A(j, i) -> A (i, j)
void setValue(const int Row, const int Col, const double Value)
void operator+=(const Mat2d &Other)
Definition: Mat2d.h:84
void operator-=(const Mat2d &Other)
Definition: Mat2d.h:88
Mat2d(const XY &Col1, const XY &Col2)
Col1, Col2 are the 2 columns of the matrix.
double & changeValue(const int Row, const int Col)
void subtract(const Mat2d &Other)
void multiply(const double Scalar)
Multiplies all the coefficients of the matrix by a scalar.
static bool isEven(const int Value)
Definition: Mat2d.h:69
Mat2d operator*(const double Scalar) const
Definition: Mat2d.h:94
Mat2d operator+(const Mat2d &Other) const
Definition: Mat2d.h:86
void setCol(const int Col, const XY &Value)
void operator*=(const double Scalar)
Definition: Mat2d.h:92
void add(const Mat2d &Other)
void setRotation(const double Ang)
Mat2d multiplied(const double Scalar) const
Mat2d operator/(const double Scalar) const
Definition: Mat2d.h:100
void setDiagonal(const double X1, const double X2)
const double & operator()(const int Row, const int Col) const
Definition: Mat2d.h:102
Mat2d divided(const double Scalar) const
Divides all the coefficients of the matrix by a scalar.
void operator/=(const double Scalar)
Definition: Mat2d.h:98
void setRows(const XY &Row1, const XY &Row2)
Assigns the number pairs Row1, Row2 to the two rows of this matrix.
XY column(const int Col) const
Mat2d operator*(const Mat2d &Other) const
Definition: Mat2d.h:96
XY row(const int Row) const
Returns the row of index Row. //! Raised if Row < 1 or Row > 2
Mat2d operator-(const Mat2d &Other) const
Definition: Mat2d.h:90
void setIdentity()
Modifies this matrix, so that it represents the Identity matrix.
void setRow(const int Row, const XY &Value)
Definition: PropertyContainer.h:33
double determinant() const
Computes the determinant of the matrix.