From 1eef70b184f3aed3dfe5080e21d7a80e964ec87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Jan 2013 01:22:35 +0100 Subject: [PATCH] Doc++ --- src/Math/Quaternion.h | 4 ++-- src/Math/Vector.h | 36 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/Math/Quaternion.h b/src/Math/Quaternion.h index abac00de5..808413a15 100644 --- a/src/Math/Quaternion.h +++ b/src/Math/Quaternion.h @@ -117,10 +117,10 @@ template class Quaternion { } /** @brief Default constructor */ - inline constexpr Quaternion(): _scalar(T(1)) {} + inline constexpr /*implicit*/ Quaternion(): _scalar(T(1)) {} /** @brief Create quaternion from vector and scalar */ - inline constexpr Quaternion(const Vector3& vector, T scalar): _vector(vector), _scalar(scalar) {} + inline constexpr /*implicit*/ Quaternion(const Vector3& vector, T scalar): _vector(vector), _scalar(scalar) {} /** @brief Equality comparison */ inline bool operator==(const Quaternion& other) const { diff --git a/src/Math/Vector.h b/src/Math/Vector.h index 34fe81911..5cb7d25c2 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -151,20 +151,12 @@ template class Vector: public RectangularMatrix<1, si return true; } - /** - * @brief Multiply vector component-wise - * - * @see operator*=(const Vector&) - */ - template inline Vector operator*(const Vector& other) const { - return Vector(*this)*=other; - } - /** * @brief Multiply vector component-wise and assign * - * More efficient than operator*(const Vector&) const, - * because it does the computation in-place. + * The computation is done in-place. @f[ + * \boldsymbol a_i = \boldsymbol a_i \boldsymbol b_i + * @f] */ template Vector& operator*=(const Vector& other) { for(std::size_t i = 0; i != size; ++i) @@ -174,19 +166,20 @@ template class Vector: public RectangularMatrix<1, si } /** - * @brief Divide vector component-wise + * @brief Multiply vector component-wise * - * @see operator/=(const Vector&) + * @see operator*=(const Vector&) */ - template inline Vector operator/(const Vector& other) const { - return Vector(*this)/=other; + template inline Vector operator*(const Vector& other) const { + return Vector(*this)*=other; } /** * @brief Divide vector component-wise and assign * - * More efficient than operator/(const Vector&) const, - * because it does the computation in-place. + * The computation is done in-place. @f[ + * \boldsymbol a_i = \frac{\boldsymbol a_i}{\boldsymbol b_i} + * @f] */ template Vector& operator/=(const Vector& other) { for(std::size_t i = 0; i != size; ++i) @@ -195,6 +188,15 @@ template class Vector: public RectangularMatrix<1, si return *this; } + /** + * @brief Divide vector component-wise + * + * @see operator/=(const Vector&) + */ + template inline Vector operator/(const Vector& other) const { + return Vector(*this)/=other; + } + /** * @brief Dot product of the vector *