MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / solveInPlace

Method solveInPlace

include/Eigen/Eigen/src/Core/SolveTriangular.h:174–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172template<typename MatrixType, unsigned int Mode>
173template<int Side, typename OtherDerived>
174EIGEN_DEVICE_FUNC void TriangularViewImpl<MatrixType,Mode,Dense>::solveInPlace(const MatrixBase<OtherDerived>& _other) const
175{
176 OtherDerived& other = _other.const_cast_derived();
177 eigen_assert( derived().cols() == derived().rows() && ((Side==OnTheLeft && derived().cols() == other.rows()) || (Side==OnTheRight && derived().cols() == other.cols())) );
178 eigen_assert((!(int(Mode) & int(ZeroDiag))) && bool(int(Mode) & (int(Upper) | int(Lower))));
179 // If solving for a 0x0 matrix, nothing to do, simply return.
180 if (derived().cols() == 0)
181 return;
182
183 enum { copy = (internal::traits<OtherDerived>::Flags & RowMajorBit) && OtherDerived::IsVectorAtCompileTime && OtherDerived::SizeAtCompileTime!=1};
184 typedef std::conditional_t<copy,
185 typename internal::plain_matrix_type_column_major<OtherDerived>::type, OtherDerived&> OtherCopy;
186 OtherCopy otherCopy(other);
187
188 internal::triangular_solver_selector<MatrixType, std::remove_reference_t<OtherCopy>,
189 Side, Mode>::run(derived().nestedExpression(), otherCopy);
190
191 if (copy)
192 other = otherCopy;
193}
194
195template<typename Derived, unsigned int Mode>
196template<int Side, typename Other>

Callers 1

_solve_implFunction · 0.45

Calls 4

runFunction · 0.85
nestedExpressionMethod · 0.80
colsMethod · 0.45
rowsMethod · 0.45

Tested by

no test coverage detected