Browse Source

Math: minor code reorganization.

Place "alias" methods after "implementation" methods.
pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
08312ae335
  1. 36
      src/Math/RectangularMatrix.h

36
src/Math/RectangularMatrix.h

@ -204,19 +204,6 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
return RectangularMatrix<cols, rows, T>(*this)-=other; return RectangularMatrix<cols, rows, T>(*this)-=other;
} }
/**
* @brief Multiply matrix with number
*
* @see operator*=(U), operator*(U, const RectangularMatrix<cols, rows, T>&)
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class U> inline typename std::enable_if<std::is_arithmetic<U>::value, RectangularMatrix<cols, rows, T>>::type operator*(U number) const {
#else
template<class U> inline RectangularMatrix<cols, rows, T> operator*(U number) const {
#endif
return RectangularMatrix<cols, rows, T>(*this)*=number;
}
/** /**
* @brief Multiply matrix with number and assign * @brief Multiply matrix with number and assign
* *
@ -236,16 +223,16 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
} }
/** /**
* @brief Divide matrix with number * @brief Multiply matrix with number
* *
* @see operator/=(), operator/(U, const RectangularMatrix<cols, rows, T>&) * @see operator*=(U), operator*(U, const RectangularMatrix<cols, rows, T>&)
*/ */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
template<class U> inline typename std::enable_if<std::is_arithmetic<U>::value, RectangularMatrix<cols, rows, T>>::type operator/(U number) const { template<class U> inline typename std::enable_if<std::is_arithmetic<U>::value, RectangularMatrix<cols, rows, T>>::type operator*(U number) const {
#else #else
template<class U> inline RectangularMatrix<cols, rows, T> operator/(U number) const { template<class U> inline RectangularMatrix<cols, rows, T> operator*(U number) const {
#endif #endif
return RectangularMatrix<cols, rows, T>(*this)/=number; return RectangularMatrix<cols, rows, T>(*this)*=number;
} }
/** /**
@ -266,6 +253,19 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
return *this; return *this;
} }
/**
* @brief Divide matrix with number
*
* @see operator/=(), operator/(U, const RectangularMatrix<cols, rows, T>&)
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
template<class U> inline typename std::enable_if<std::is_arithmetic<U>::value, RectangularMatrix<cols, rows, T>>::type operator/(U number) const {
#else
template<class U> inline RectangularMatrix<cols, rows, T> operator/(U number) const {
#endif
return RectangularMatrix<cols, rows, T>(*this)/=number;
}
/** /**
* @brief Multiply matrix * @brief Multiply matrix
* *

Loading…
Cancel
Save