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,
58 determinant = matrix.coeff(0,0);
70 const MatrixType& matrix, const typename ResultType::Scalar& invdet,
73 result.coeffRef(0,0) = matrix.coeff(1,1) * invdet;
74 result.coeffRef(1,0) = -matrix.coeff(1,0) * invdet;
75 result.coeffRef(0,1) = -matrix.coeff(0,1) * invdet;
76 result.coeffRef(1,1) = matrix.coeff(0,0) * invdet;
82 static inline void run(const MatrixType& matrix, ResultType& result)
85 const Scalar invdet = typename MatrixType::Scalar(1) / matrix.determinant();
86 compute_inverse_size2_helper(matrix, invdet, result);
94 const MatrixType& matrix,
102 determinant = matrix.determinant();
106 compute_inverse_size2_helper(matrix, invdet, inverse);
129 const MatrixType& matrix,
131 const Matrix<typename ResultType::Scalar,3,1>& cofactors_col0,
135 result.coeffRef(1,0) = cofactor_3x3<MatrixType,0,1>(matrix) * invdet;
136 result.coeffRef(1,1) = cofactor_3x3<MatrixType,1,1>(matrix) * invdet;
137 result.coeffRef(1,2) = cofactor_3x3<MatrixType,2,1>(matrix) * invdet;
138 result.coeffRef(2,0) = cofactor_3x3<MatrixType,0,2>(matrix) * invdet;
139 result.coeffRef(2,1) = cofactor_3x3<MatrixType,1,2>(matrix) * invdet;
140 result.coeffRef(2,2) = cofactor_3x3<MatrixType,2,2>(matrix) * invdet;
146 static inline void run(const MatrixType& matrix, ResultType& result)
149 Matrix<typename MatrixType::Scalar,3,1> cofactors_col0;
150 cofactors_col0.coeffRef(0) = cofactor_3x3<MatrixType,0,0>(matrix);
151 cofactors_col0.coeffRef(1) = cofactor_3x3<MatrixType,1,0>(matrix);
152 cofactors_col0.coeffRef(2) = cofactor_3x3<MatrixType,2,0>(matrix);
153 const Scalar det = (cofactors_col0.cwiseProduct(matrix.col(0))).sum();
155 compute_inverse_size3_helper(matrix, invdet, cofactors_col0, result);
163 const MatrixType& matrix,
171 Matrix<Scalar,3,1> cofactors_col0;
172 cofactors_col0.coeffRef(0) = cofactor_3x3<MatrixType,0,0>(matrix);
173 cofactors_col0.coeffRef(1) = cofactor_3x3<MatrixType,1,0>(matrix);
174 cofactors_col0.coeffRef(2) = cofactor_3x3<MatrixType,2,0>(matrix);
175 determinant = (cofactors_col0.cwiseProduct(matrix.col(0))).sum();
179 compute_inverse_size3_helper(matrix, invdet, cofactors_col0, inverse);
189 (const MatrixBase<Derived>& matrix, int i1, int i2, int i3, int j1, int j2, int j3)
191 return matrix.coeff(i1,j1)
192 * (matrix.coeff(i2,j2) * matrix.coeff(i3,j3) - matrix.coeff(i2,j3) * matrix.coeff(i3,j2));
196 inline typename MatrixType::Scalar cofactor_4x4(const MatrixType& matrix)
206 return general_det3_helper(matrix, i1, i2, i3, j1, j2, j3)
207 + general_det3_helper(matrix, i2, i3, i1, j1, j2, j3)
208 + general_det3_helper(matrix, i3, i1, i2, j1, j2, j3);
214 static void run(const MatrixType& matrix, ResultType& result)
216 result.coeffRef(0,0) = cofactor_4x4<MatrixType,0,0>(matrix);
217 result.coeffRef(1,0) = -cofactor_4x4<MatrixType,0,1>(matrix);
218 result.coeffRef(2,0) = cofactor_4x4<MatrixType,0,2>(matrix);
219 result.coeffRef(3,0) = -cofactor_4x4<MatrixType,0,3>(matrix);
220 result.coeffRef(0,2) = cofactor_4x4<MatrixType,2,0>(matrix);
221 result.coeffRef(1,2) = -cofactor_4x4<MatrixType,2,1>(matrix);
222 result.coeffRef(2,2) = cofactor_4x4<MatrixType,2,2>(matrix);
223 result.coeffRef(3,2) = -cofactor_4x4<MatrixType,2,3>(matrix);
224 result.coeffRef(0,1) = -cofactor_4x4<MatrixType,1,0>(matrix);
225 result.coeffRef(1,1) = cofactor_4x4<MatrixType,1,1>(matrix);
226 result.coeffRef(2,1) = -cofactor_4x4<MatrixType,1,2>(matrix);
227 result.coeffRef(3,1) = cofactor_4x4<MatrixType,1,3>(matrix);
228 result.coeffRef(0,3) = -cofactor_4x4<MatrixType,3,0>(matrix);
229 result.coeffRef(1,3) = cofactor_4x4<MatrixType,3,1>(matrix);
230 result.coeffRef(2,3) = -cofactor_4x4<MatrixType,3,2>(matrix);
231 result.coeffRef(3,3) = cofactor_4x4<MatrixType,3,3>(matrix);
232 result /= (matrix.col(0).cwiseProduct(result.row(0).transpose())).sum();
247 const MatrixType& matrix,
254 determinant = matrix.determinant();
256 if(invertible) compute_inverse<MatrixType, ResultType>::run(matrix, inverse);
278 inverse_impl(const MatrixType& matrix)
279 : m_matrix(matrix)
300 * \returns the matrix inverse of this matrix.
305 * \note This matrix must be invertible, otherwise the result is undefined. If you need an
325 * Computation of matrix inverse and determinant, with invertibility check.
329 * \param inverse Reference to the matrix in which to store the inverse.
331 * \param invertible Reference to the bool variable in which to store whether the matrix is invertible.
333 * The matrix will be declared invertible if the absolute value of its
365 * Computation of matrix inverse, with invertibility check.
369 * \param inverse Reference to the matrix in which to store the inverse.
370 * \param invertible Reference to the bool variable in which to store whether the matrix is invertible.
372 * The matrix will be declared invertible if the absolute value of its