[eigen] Serious conflict between Dynamic and -1 in Diagonal<> |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] Serious conflict between Dynamic and -1 in Diagonal<>
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 10 Jul 2012 10:34:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=0TYNR0oLcS1UgBX1gLkcaal4qWsNtfPhxMboWsI92mo=; b=xtDe+X7ROlIE+R36RLgQe4VsTv33TlLBf2kztwjCvrFkQcATMvlyLktm1nmw66w6ul 4oTMLDUTnZTBYP8t5/fMMxqwF1wN5rWuGTPDVf8iGJJFmY/wMA1QN3Ski6IgcP+q/DRO dm3qbuKEs0ydWGdiQ330iJraAfTPF4T/XfJM8NFX/CqA55L9j6TlUGC2hArUNGjGKqke 207u/K6J7OycjpxIgJY5Tl3mAVslFEQYKGs4HW+ZmiLiLX3pwXdxZDnGZJytgUh/1CGx cS1z6qbGHjBf16Rt07YYURwrucOQpdDmYvDZs1uuFpcb789pk1Gu21ibJKjyMgdVKJCY uFWg==
Hi,
as pointed out in this thread:
http://forum.kde.org/viewtopic.php?f=74&t=106803
there is a serious issue in the Diagonal<Expression, DiagIndex> class.
Recall that Diagonal<> represents an expression of the diagonal
(DiagIndex==0), a super-diagonal (DiagIndex>0) or a sub-diagonal
(DiagIndex<0).
Of course, one can also set DiagIndex to Dynamic to pick a given
super/sub diagonal at runtime. The problem is that since Dynamic==-1,
we cannot distinguish between the first sub-diagonal (DiagIndex==-1)
and a runtime selected diagonal.
Since changing the value of Dynamic is not an option, I propose to add
a special enum for this use case, like RuntimeDiagIndex or
DynamicDiagIndex that would be set to a very big value.
Opinion? better solution?
thanks,
Gael