Lines Matching refs:MatrixType

21 template<typename MatrixType, typename ResultType, int Size = MatrixType::RowsAtCompileTime>
24 static inline void run(const MatrixType& matrix, ResultType& result)
30 template<typename MatrixType, typename ResultType, int Size = MatrixType::RowsAtCompileTime>
37 template<typename MatrixType, typename ResultType>
38 struct compute_inverse<MatrixType, ResultType, 1>
40 static inline void run(const MatrixType& matrix, ResultType& result)
42 typedef typename MatrixType::Scalar Scalar;
47 template<typename MatrixType, typename ResultType>
48 struct compute_inverse_and_det_with_check<MatrixType, ResultType, 1>
51 const MatrixType& matrix,
52 const typename MatrixType::RealScalar& absDeterminantThreshold,
69 template<typename MatrixType, typename ResultType>
71 const MatrixType& matrix, const typename ResultType::Scalar& invdet,
80 template<typename MatrixType, typename ResultType>
81 struct compute_inverse<MatrixType, ResultType, 2>
83 static inline void run(const MatrixType& matrix, ResultType& result)
86 const Scalar invdet = typename MatrixType::Scalar(1) / matrix.determinant();
91 template<typename MatrixType, typename ResultType>
92 struct compute_inverse_and_det_with_check<MatrixType, ResultType, 2>
95 const MatrixType& matrix,
96 const typename MatrixType::RealScalar& absDeterminantThreshold,
116 template<typename MatrixType, int i, int j>
117 inline typename MatrixType::Scalar cofactor_3x3(const MatrixType& m)
129 template<typename MatrixType, typename ResultType>
131 const MatrixType& matrix,
137 result.coeffRef(1,0) = cofactor_3x3<MatrixType,0,1>(matrix) * invdet;
138 result.coeffRef(1,1) = cofactor_3x3<MatrixType,1,1>(matrix) * invdet;
139 result.coeffRef(1,2) = cofactor_3x3<MatrixType,2,1>(matrix) * invdet;
140 result.coeffRef(2,0) = cofactor_3x3<MatrixType,0,2>(matrix) * invdet;
141 result.coeffRef(2,1) = cofactor_3x3<MatrixType,1,2>(matrix) * invdet;
142 result.coeffRef(2,2) = cofactor_3x3<MatrixType,2,2>(matrix) * invdet;
145 template<typename MatrixType, typename ResultType>
146 struct compute_inverse<MatrixType, ResultType, 3>
148 static inline void run(const MatrixType& matrix, ResultType& result)
151 Matrix<typename MatrixType::Scalar,3,1> cofactors_col0;
152 cofactors_col0.coeffRef(0) = cofactor_3x3<MatrixType,0,0>(matrix);
153 cofactors_col0.coeffRef(1) = cofactor_3x3<MatrixType,1,0>(matrix);
154 cofactors_col0.coeffRef(2) = cofactor_3x3<MatrixType,2,0>(matrix);
161 template<typename MatrixType, typename ResultType>
162 struct compute_inverse_and_det_with_check<MatrixType, ResultType, 3>
165 const MatrixType& matrix,
166 const typename MatrixType::RealScalar& absDeterminantThreshold,
175 cofactors_col0.coeffRef(0) = cofactor_3x3<MatrixType,0,0>(matrix);
176 cofactors_col0.coeffRef(1) = cofactor_3x3<MatrixType,1,0>(matrix);
177 cofactors_col0.coeffRef(2) = cofactor_3x3<MatrixType,2,0>(matrix);
198 template<typename MatrixType, int i, int j>
199 inline typename MatrixType::Scalar cofactor_4x4(const MatrixType& matrix)
214 template<int Arch, typename Scalar, typename MatrixType, typename ResultType>
217 static void run(const MatrixType& matrix, ResultType& result)
219 result.coeffRef(0,0) = cofactor_4x4<MatrixType,0,0>(matrix);
220 result.coeffRef(1,0) = -cofactor_4x4<MatrixType,0,1>(matrix);
221 result.coeffRef(2,0) = cofactor_4x4<MatrixType,0,2>(matrix);
222 result.coeffRef(3,0) = -cofactor_4x4<MatrixType,0,3>(matrix);
223 result.coeffRef(0,2) = cofactor_4x4<MatrixType,2,0>(matrix);
224 result.coeffRef(1,2) = -cofactor_4x4<MatrixType,2,1>(matrix);
225 result.coeffRef(2,2) = cofactor_4x4<MatrixType,2,2>(matrix);
226 result.coeffRef(3,2) = -cofactor_4x4<MatrixType,2,3>(matrix);
227 result.coeffRef(0,1) = -cofactor_4x4<MatrixType,1,0>(matrix);
228 result.coeffRef(1,1) = cofactor_4x4<MatrixType,1,1>(matrix);
229 result.coeffRef(2,1) = -cofactor_4x4<MatrixType,1,2>(matrix);
230 result.coeffRef(3,1) = cofactor_4x4<MatrixType,1,3>(matrix);
231 result.coeffRef(0,3) = -cofactor_4x4<MatrixType,3,0>(matrix);
232 result.coeffRef(1,3) = cofactor_4x4<MatrixType,3,1>(matrix);
233 result.coeffRef(2,3) = -cofactor_4x4<MatrixType,3,2>(matrix);
234 result.coeffRef(3,3) = cofactor_4x4<MatrixType,3,3>(matrix);
239 template<typename MatrixType, typename ResultType>
240 struct compute_inverse<MatrixType, ResultType, 4>
241 : compute_inverse_size4<Architecture::Target, typename MatrixType::Scalar,
242 MatrixType, ResultType>
246 template<typename MatrixType, typename ResultType>
247 struct compute_inverse_and_det_with_check<MatrixType, ResultType, 4>
250 const MatrixType& matrix,
251 const typename MatrixType::RealScalar& absDeterminantThreshold,
260 if(invertible) compute_inverse<MatrixType, ResultType>::run(matrix, inverse);
268 template<typename MatrixType>
269 struct traits<inverse_impl<MatrixType> >
271 typedef typename MatrixType::PlainObject ReturnType;
274 template<typename MatrixType>
275 struct inverse_impl : public ReturnByValue<inverse_impl<MatrixType> >
277 typedef typename MatrixType::Index Index;
278 typedef typename internal::eval<MatrixType>::type MatrixTypeNested;
282 inverse_impl(const MatrixType& matrix)
291 const int Size = EIGEN_PLAIN_ENUM_MIN(MatrixType::ColsAtCompileTime,Dest::ColsAtCompileTime);
362 >::type MatrixType;
363 internal::compute_inverse_and_det_with_check<MatrixType, ResultType>::run