[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] DenseCoeffsBase
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Sat, 8 May 2010 16:08:18 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=vQ5V4figmc9HNC3ls3pEqQpciLTeBsH9rbpGKiyHb2U=; b=WDAXVdyYSTpblrtWbxfiASTjD0Vl1OSs33NQvlqqvpnrfQhxDZX5fCmk9Li/6t9hhU kCXVV8pb2NaMhc13ry6dDbX/Rf7Yz60kkdZg008gejhBLuFne8gAtKtSJGK5HAfLaF6f dnoW3KHbN46D2kRHTYdwjmjEj2nrY+LcWkiZY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Nc7AyhziGhj8jcupLtK3aLp1SV9pDmoKERX7AVWY+DtOPoPdYDXXlIxIb0zTaJJ8eD tc7YO/sSdYZ1R6GY6tgC8edmbFCpLL4d1PZsiKBYHOiNxchbk6iZb9d1lnaBbf4WkICN GjMNpxuvaU+HztgeLziIUOUEk2fM+2ijQMS2k=
This is to explain the group of commits that I just made in the dev branch.
maybe you remember, not long ago, i was playing with the idea of
adding a DenseDirectAccessBase class, then gave up... well the idea is
back and this time I believe it's correctly implemented. See class
Here's a quick rationalization:
We used to have a lot of methods in DenseBase that only made sense in
the DirectAccess case. Like coeffRef(), writePacket(), copyCoeff(),
all the strides API...
That was bad of course (not to mention dangerous as they were trying
to call a method with same name in the derived class).
The "obvious" fix was to use enable_if on these methods, however
- that would have been fiddling with their prototypes: better avoid
that if we can
- a lot of methods were concerned, not just 1 or 2 methods.
The alternative of using a static assert was not very good here,
because e.g. operator() was overloaded with one variant using direct
access and not the other, so we'd be having issues with overload
So instead, the idea is to introduce a new base class DenseCoeffsBase
in the hierarchy, implementing a "group enable_if". The methods
prototypes stay the same, they just move to the new base class.
Tell me if you have an objection against that.