Re: [eigen] RFC - how to avoid (impossible) recursive declarations |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
On 21.09.2012 10:46, Helmut Jarausch wrote:
template <typename Derived, typename OtherDerived> VectorXd Block_Solve(MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& b ) { int N = A.rows(), m = Teil_Dim, mrest= N-m; typedef typename Eigen::Block<Derived,Dynamic,Dynamic> PartialMatrix; typedef typename OtherDerived::SegmentReturnType PartialVector; .... seems to get the compiler into endless recursion since I get endless error messages. It probably tries recursive definitions which have to fail.
That's essentially the same problem Norman Goldstein faces at the moment (see the thread "Recursion and block matrices"). The easiest solution would be to use the Ref-class from the dev-branch (see Gael's mails in that thread), otherwise you need to handcraft some kind of Map object.
The other alternative is to avoid recursion at all. Essentially you can simulate both "walking up" and "walking down" the stack by one for-loop each.
Christoph -- ---------------------------------------------- Dipl.-Inf. Christoph Hertzberg Cartesium 0.049 Universität Bremen Enrique-Schmidt-Straße 5 28359 Bremen Tel: +49 (421) 218-64252 ----------------------------------------------
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |