Re: [eigen] news on the refactoring of the expression template mechanism |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] news on the refactoring of the expression template mechanism
- From: Jitse Niesen <jitseniesen@xxxxxxxxx>
- Date: Sat, 12 Apr 2014 13:07:00 +0100 (BST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=gcom1024; t=1397304425; bh=ZywnxTzO3MMC6hyY8HqDJjGHr1oGDmWzMxZVj1cqKg0=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:X-X-Sender:To:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type; b=jzqRueXmRw+Y5+sY+Ces8SKae1ySNNJKiCiTyn1oX3CpPd5HOjV2lu8HahsCyoFPOFUlYqo5JqW8/FTNCmAku2CuwfBf05tohNvcW9PFn3RSi59pu/M9omMCSG941aG4A+ybKecB7rIQAmPNJvn514ECPuREERnyeqaLHyzxtwI=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1397304425; bh=ZywnxTzO3MMC6hyY8HqDJjGHr1oGDmWzMxZVj1cqKg0=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:X-X-Sender:To:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type; b=HvlHuUHd65TFMdk180wWXBu5hnopEYJBB2UEUIIXCNF18IAYqSr/lNjZW5Q9B0ACWGeVpYnfaiTb5uCfTRKwP5h+USzDeYa3JfeQDHxON87OtkSlV8DxT/2uox7qyVjjxiWfx+ofweGv4YylOjGj4ZVDt9gwqx2sc0sdI+ABUG4=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=gcom1024; d=yahoo.com; b=HqXN//RqwghrGhadgMCNUoioyeuuZLlUdKs/P+rz6+Ky80PcOgq0K8u8IXuKoWGQJ9kNn0hBc+ufD4hgm6c2T8otobH9V2UFHt5lkgvbWD6gvD4mKkO/w7FASnfzUuPCWBJQfxsjqeQi1B356HzzNHCamwV7szSrF6zuG6UkM+0=;
On Fri, 21 Feb 2014, Gael Guennebaud wrote:
As most of you probably know, since the releases of Eigen 3.0 we
started a significant refactoring of the expression template mechanism
under the code name "evaluators" aka "bug99" [1].
[...]
This refactoring is much more work than what I expected, but I've
reached a state where I think that the rest of the refactoring should be
quite mechanical. So I think it's time to describe the new design and to
discuss it before going too far.
I had a good look and it seems to work. With products you managed to do
the most difficult part. The next question for me is whether it works with
sparse matrices; but since you managed to do diagonal matrices we can have
some confidence.
It's a bit hard to tell though because there is still quite some
evaluation logic in the expression objects, so it's quite possible that
there are still gaps in the evaluators even in the parts of the Core and
LU modules that appear at first sight to be done.
To this end I prepared a pdf [3] that summarize the new concepts and
their true implementation inside Eigen. [...]
The main purpose here is to start discussions and get some early feedbacks.
The pdf all seems right to me, but I realize it's the details that are
important here and only actually programming it will make clear whether
the design is okay or not.
- Currently, the two mechanisms co-exist via conditional compilations
(EIGEN_ENABLE_EVALUATORS and EIGEN_TEST_EVALUATORS). This means the
code is a bit messy. Maybe it's OK to already do a big cleaning pass
since we have a separate branch anyway?
Indeed, how to continue this? I can see two possibilities:
1. To make sure we get the design right, we can continue in the evaluator
branch with the Core and LU modules, make sure that everything works, get
rid of the conditional compilations, remove the dead code from the
expression objects (e.g., implement expr.coeff() in terms of evaluators),
refactor, etc. Once we are confident with the design we can continue with
the other modules.
2. The alternative would be to get all (supported?) modules in working
order with EIGEN_TEST_EVALUATORS, at least in that the tests pass, and
then merge the branches. At that point we will probably see a lot of
issues when people start to use evaluators because our tests are not
comrehensive.
The problem with 1 is the code duplication due to the two separate
branches (conditional compilation in the same branch has more or less the
same issue). It will be difficult to merge the two branches and make sure
that all bug fixes from one branch are ported to the other branch , and
the further the branches diverge the more difficult it will be.
Approach 2 avoids this issue, but has the problem that when we want to
change the design for evaluators, we have to change it in all modules (not
just Core and LU), which will be much more work.
Of course there are more possibilities, but I feel this is the main choice
to make. What do you guys think?
Jits