Lines Matching refs:matrix

24   static inline void run(const MatrixType& matrix, ResultType& result)
26 result = matrix.partialPivLu().inverse();
40 static inline void run(const MatrixType& matrix, ResultType& result)
43 result.coeffRef(0,0) = Scalar(1) / matrix.coeff(0,0);
51 const MatrixType& matrix,
59 determinant = matrix.coeff(0,0);
71 const MatrixType& matrix, const typename ResultType::Scalar& invdet,
74 result.coeffRef(0,0) = matrix.coeff(1,1) * invdet;
75 result.coeffRef(1,0) = -matrix.coeff(1,0) * invdet;
76 result.coeffRef(0,1) = -matrix.coeff(0,1) * invdet;
77 result.coeffRef(1,1) = matrix.coeff(0,0) * invdet;
83 static inline void run(const MatrixType& matrix, ResultType& result)
86 const Scalar invdet = typename MatrixType::Scalar(1) / matrix.determinant();
87 compute_inverse_size2_helper(matrix, invdet, result);
95 const MatrixType& matrix,
104 determinant = matrix.determinant();
108 compute_inverse_size2_helper(matrix, invdet, inverse);
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;
148 static inline void run(const MatrixType& matrix, ResultType& result)
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);
155 const Scalar det = (cofactors_col0.cwiseProduct(matrix.col(0))).sum();
157 compute_inverse_size3_helper(matrix, invdet, cofactors_col0, result);
165 const MatrixType& matrix,
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);
178 determinant = (cofactors_col0.cwiseProduct(matrix.col(0))).sum();
182 compute_inverse_size3_helper(matrix, invdet, cofactors_col0, inverse);
192 (const MatrixBase<Derived>& matrix, int i1, int i2, int i3, int j1, int j2, int j3)
194 return matrix.coeff(i1,j1)
195 * (matrix.coeff(i2,j2) * matrix.coeff(i3,j3) - matrix.coeff(i2,j3) * matrix.coeff(i3,j2));
199 inline typename MatrixType::Scalar cofactor_4x4(const MatrixType& matrix)
209 return general_det3_helper(matrix, i1, i2, i3, j1, j2, j3)
210 + general_det3_helper(matrix, i2, i3, i1, j1, j2, j3)
211 + general_det3_helper(matrix, i3, i1, i2, j1, j2, j3);
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);
235 result /= (matrix.col(0).cwiseProduct(result.row(0).transpose())).sum();
250 const MatrixType& matrix,
258 determinant = matrix.determinant();
260 if(invertible) compute_inverse<MatrixType, ResultType>::run(matrix, inverse);
282 inverse_impl(const MatrixType& matrix)
283 : m_matrix(matrix)
304 * \returns the matrix inverse of this matrix.
309 * \note This matrix must be invertible, otherwise the result is undefined. If you need an
329 * Computation of matrix inverse and determinant, with invertibility check.
333 * \param inverse Reference to the matrix in which to store the inverse.
335 * \param invertible Reference to the bool variable in which to store whether the matrix is invertible.
337 * The matrix will be declared invertible if the absolute value of its
369 * Computation of matrix inverse, with invertibility check.
373 * \param inverse Reference to the matrix in which to store the inverse.
374 * \param invertible Reference to the bool variable in which to store whether the matrix is invertible.
376 * The matrix will be declared invertible if the absolute value of its