minor regularization of vectors and matrices

This commit is contained in:
Mathew Sutcliffe
2013-08-19 17:44:33 +01:00
parent f9f35f27d5
commit 5f267e8245
9 changed files with 72 additions and 177 deletions

View File

@@ -87,6 +87,17 @@ public:
this->m_matrix = this->m_matrix * other.m_matrix;
return *this;
}
/*!
* \brief Operator *
* \param other
* \return
*/
CMatrix3x3 operator *(const CMatrix3x3 &other) const
{
CMatrix3x3 m(*this);
m *= other;
return m;
}
/*!
* \brief Operator *
@@ -101,27 +112,24 @@ public:
}
/*!
* \brief Operator *
* \param other
* \return
*/
CMatrix3x3 operator *(const CMatrix3x3 &other) const
{
CMatrix3x3 m(*this);
m *= other;
return m;
}
/*!
* \brief Multiply vector with this 3x3 matrix
* \brief Multiply this matrix with vector
* \param vector
* \return
*/
CVector3D operator *(const CVector3D &vector) const
{
CVector3D v(vector);
v.matrixMultiplication(*this);
return v;
return ((*this) * CMatrix3x1(vector.toMatrix3x1())).toVector3D();
}
/*!
* \brief Multiply with factor
* \param factor
* \return
*/
CMatrix3x3 &operator *=(double factor)
{
this->CMatrixBase::operator *=(factor);
return *this;
}
/*!
@@ -136,17 +144,6 @@ public:
return m;
}
/*!
* \brief Multiply with factor
* \param factor
* \return
*/
CMatrix3x3 &operator *=(double factor)
{
CMatrixBase::operator *=(factor);
return *this;
}
/*!
* \brief Transposed matrix
* \return
@@ -171,7 +168,6 @@ public:
* \return
*/
CMatrix1x3 getRow(int row) const;
};
} // namespace