5#include <Common/assertion.h>
12template<
typename Derived,
typename T, std::
size_t N>
16 set(
static_cast<T
>(0));
18 for(std::size_t ni = 0; ni < N; ++ni)
20 m[ni][ni] =
static_cast<T
>(1);
23 return static_cast<Derived&
>(*this);
26template<
typename Derived,
typename T, std::
size_t N>
30 set(
static_cast<T
>(0));
32 for(std::size_t ni = 0; ni < N; ++ni)
34 m[ni][ni] = scaleFactor[ni];
37 return static_cast<Derived&
>(*this);
40template<
typename Derived,
typename T, std::
size_t N>
44 Derived result(
static_cast<const Derived&
>(*
this));
45 mul(rhsMatrix, &result);
49template<
typename Derived,
typename T, std::
size_t N>
53 Derived result(
static_cast<const Derived&
>(*
this));
54 mul(rhsMatrix, &result);
55 Derived::operator = (result);
57 return static_cast<Derived&
>(*this);
60template<
typename Derived,
typename T, std::
size_t N>
64 Derived result(
static_cast<const Derived&
>(*
this));
65 mulTransposed(rhsMatrix, &result);
69template<
typename Derived,
typename T, std::
size_t N>
73 Derived result(
static_cast<const Derived&
>(*
this));
74 mulTransposed(rhsMatrix, &result);
75 Derived::operator = (result);
77 return static_cast<Derived&
>(*this);
80template<
typename Derived,
typename T, std::
size_t N>
83 PH_ASSERT(out_result);
84 PH_ASSERT(out_result !=
this);
86 Base::template multiplyMatrix<N>(rhsMatrix.Self::m, &(out_result->Self::m));
89template<
typename Derived,
typename T, std::
size_t N>
92 PH_ASSERT(out_result);
94 Base::template multiplyTransposedMatrix<N>(rhsMatrix.Self::m, &(out_result->Self::m));
97template<
typename Derived,
typename T, std::
size_t N>
101 Derived result(
static_cast<const Derived&
>(*
this));
102 result.Self::transposeLocal();
106template<
typename Derived,
typename T, std::
size_t N>
113 static_assert(N >= 1);
116 for(std::size_t ri = 0; ri < N - 1; ++ri)
119 for(std::size_t ci = ri + 1; ci < N; ++ci)
124 swap(m[ri][ci], m[ci][ri]);
128 return static_cast<Derived&
>(*this);
Derived mul(const Derived &rhsMatrix) const
Definition TMatrixNBase.ipp:41
Derived & setIdentity()
Sets the matrix to be an identity matrix.
Definition TMatrixNBase.ipp:13
Derived & mulTransposedLocal(const Derived &rhsMatrix)
Definition TMatrixNBase.ipp:70
Derived & transposeLocal()
Definition TMatrixNBase.ipp:107
Derived transpose() const
Definition TMatrixNBase.ipp:98
Derived & mulLocal(const Derived &rhsMatrix)
Definition TMatrixNBase.ipp:50
Derived mulTransposed(const Derived &rhsMatrix) const
Definition TMatrixNBase.ipp:61
Derived & setScale(const TRawColVector< T, N > &scaleFactor)
Definition TMatrixNBase.ipp:27
Math functions and utilities.
Definition TransformInfo.h:10
std::array< T, M > TRawColVector
Definition TMatrixMxNBase.h:20