Benoît Jacob ([info]bjacob) wrote,
@ 2008-01-07 11:13:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:eigen eigen2 4.1 step krita

Eigen 2.0-alpha2; help wanted!
Now that KDE 4.0.0 is tagged I guess it's OK to divert developers attention to KDE 4.1 stuff :)

So I just released Eigen 2.0-alpha2. Source tarball, Browse SVN.

Besides a ton of improvements over alpha1, the main novelty is that there is now quite complete API documentation.

New features since alpha1 include: ICC compiler support thanks to Gael Guennebaud, full enforcement of constness, support for row-major matrix storage (column-major remains default), and tons of API improvements and new methods.

Now's the time where you can really start using Eigen2 in your own project, if the current feature set is enough for you. I'm very happy with the architecture, and benchmarks show that it's very fast. According to sloccount there are 2,234 lines of code. Which is very, very little for what it does.

In fact, there are not so many expression-templates-enabled libraries out there:
- Blitz++ is of course great but is not a linear algebra library, so Eigen2 does not compete with it. Blitz++ is a general array library, and focuses on dynamic size while I want fixed size to be treated on an equal footing.
- TVMET only does fixed-size, does not allow expressions to be lvalues, etc., while having 5x more lines of code than Eigen2 (granted, it has some functionality not yet present in eigen2 such as applying a function to each coefficient). That said I have a huge respect for TVMET as it is by reading its source code that I learnt expression templates.
- Boost::uBLAS does not fully take advantage of expression templates. It treats them as a mere optimization that can be enabled/disabled at compilation. While expression templates are a great optimization, I believe that the most interesting thing about them is what they allow in terms of API design. Operating on the rows of a matrix should be as simple as

matrix.row(i) += factor * matrix.row(j);
This is what Eigen2 allows. This way one can write C++ code that really looks like pseudocode, and at the same time that's optimized. This is the real beauty of expression templates, and I regret that Boost::uBLAS doesn't take advantage of it. Another thing is that, like any BLAS, Boost::uBLAS only provides very basic functionality and one then needs to use another library for more functionality (such as inverting a matrix). By contrast, Eigen aims to be self-contained to cover all the usual needs of applications.

Update:I just found this: apparently fixed-size matrices and vectors are slow in uBLAS and for fixed-size they recommend to use TVMET instead! It's a small world.

I hope to have convinced you that by contributing to Eigen, you would be contributing to a very exciting project! For this is the motivation of this post: I need help!

While the Core module is quite complete, there are at least 6 more modules that we want to have for Eigen 2.0. I don't have time to write them all! So here is a TODO.

I would like very much to find volunteers quickly as the KDE 4.1 feature freeze is probably not too far away (though at least 3 monthes away) and if Eigen2 is good enough soon enough, it might be useful for several very exciting things in KDE 4.1, such as Step.

Then, a major user of Eigen2 will quite probably be KOffice 2.1, but this leaves us more time. Interestingly, the most advanced feature that KOffice/Krita requires, namely sparse matrix support, is also what Step requires. So, to any potential volunteer: by doing that, you will be a hero to both KOffice and KDE-Edu!


(Post a new comment)

Why not use LGPL?
(Anonymous)
2008-01-07 04:44 pm UTC (link)
Seem like the exception you have added changes the GPL to be like the LGPL license. Except the fact the GNU strictly warns from modifying the GPL, why not just use LGPL?

(Reply to this)(Thread)

Re: Why not use LGPL?
[info]bjacob
2008-01-07 07:50 pm UTC (link)
Sigh, half of the times I blog about Eigen, someone has to ask the same question...

From the eigen front page:

http://eigen.tuxfamily.org/#license

"The reason why we don't use the LGPL is that it doesn't make sense for a pure template library like Eigen, where all the code is in headers."

And if you are interested in the specifics:

http://osdir.com/ml/org.fsf.europe.discussion/2006-10/msg00091.html

(Reply to this)(Parent)

Another expression template library
(Anonymous)
2008-01-07 05:55 pm UTC (link)
My college next door wrote LTL:

http://www.mpe.mpg.de/~drory/ltl/index.html

I've never used it but 'expression template lib' in your blog rang a bell in the back of my head.

Achim

(Reply to this)(Thread)

Re: Another expression template library
[info]bjacob
2008-01-07 07:53 pm UTC (link)
Thanks for the link, this library looks very interesting. Unfortunately the online API docs are broken, for instance section 5 is empty, so I can't say much more.

(Reply to this)(Parent)

another Expression template Math Package ?
(Anonymous)
2008-01-07 11:32 pm UTC (link)
Did you have try FLENS. It's lloks like an expression template library for linear algebra.

(Reply to this)(Thread)

Re: another Expression template Math Package ?
[info]bjacob
2008-01-08 09:29 am UTC (link)
Thanks for the pointer, I didn't try it. It looks interesting indeed. But I don't see them mentioning fixed-size matrices; actually it looks like FLENS doesn't support that. It looks more like a general scientific package. I might be wrong though, too bad they don't seem to provide a doxygen-generated class reference. Their PDF documentation is hard to browse.

(Reply to this)(Parent)

Better Syntax AND Performance
(Anonymous)
2008-03-19 03:53 pm UTC (link)
I don't think many people understand the benefit to Eigen2. Perhaps I should point to it from a scientific forum.

Benoît mentioned some of the C/C++ libraries that handle linear algebra. One of the big competitors is BLAS/LAPACK (e.g. ATLAS). These libraries are originally Fortran and require strange syntax. Certainly they are highly tuned and vectorized. But Eigen2 is providing competitive performance and beautiful, clean code.

What more can you want? You can now write scientific code in a clean way and have outstanding performance.

(Reply to this)(Thread)

Re: Better Syntax AND Performance
[info]bjacob
2008-03-19 04:04 pm UTC (link)
Exactly, dear anonymous, I couldn't have stated it better :)

(Reply to this)(Parent)

Quick 'thank you'!
(Anonymous)
2008-03-29 09:27 pm UTC (link)
Hi!

No real relation to the post, just wanted to thank you for the work you are doing on Eigen. I was looking for library to use for demo scene productions, and this fits the task exactly :) I'll try to remember sending you a link so you can check out the finished product when it is released.

(Reply to this)(Thread)

Re: Quick 'thank you'!
[info]bjacob
2008-03-30 03:01 pm UTC (link)
You're welcome, and please do send me a link once it's done, I'm always interested. You might want to consider subscribing to Eigen's mailing list so you'll be informed of the upcoming 2.0 release.

(Reply to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…