This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Binding Eigin in Felix

Tags: None
(comma "," separated)
Yttrill
Registered Member
Posts
1
Karma
0

Binding Eigin in Felix

Mon May 28, 2012 1:08 am
Hi, just thought I'd announce I'm going to try binding Eigen into Felix (http://felix-lang.org).
Anyone interesting in helping would be most welcome!

Gluing appropriate syntax together may be tricky: Eigen relies on expression templates where performance depends on non-semantic structure, for example initialiser lists are much faster then a sequence of initialisations if the latter render the operations (i.e. force the lazy structure to calculate). Perhaps there are some lower level ways to build calculation trees and control when the calculations are actually done?

Also I admit some curiosity regarding sparse matrices. Felix has sparse arrays which are efficient handling insertions and deletions and remain reasonably compact, linear scanning is compromised by lots of changes but can be fixed by a cleanup method.

It's probable my technology can't be used in Eigen since it's a header file only system, Felix uses the fantastic Judy Array technology which requires a runtime library. JudyLArray allows a mapping for a machine word to a machine word which is extremely fast for insertion, deletion, and linear scanning, and scales well. It is a cache tuned digital trie.

Using Judy together with an extensible value array, new entries are appended to the value array, and the indexing is done via a JudySL array (if there's no entry, the default is returned, for algebra this will usually be a zero value). A free list is kept for the value array when items are deleted to try to maintain maximal usage. Occasionally insertions require reallocating the value array and copying all the old entries.

A cleanup routine copies all the values to a new value array in index order. A two level sparse array would provide a matrix implementation. I think transpose could be implemented without touching the value array, then simply run a cleanup to optimise it (not sure though).

This technology is superior to what is provided by Eigen at the moment in that the type of the "easy to insert into" and "fast for computation" forms of the data is the same. Also it seems to be faster because there's no need to perform a linear search for an index: the JudyLArray is much faster (it combines indexing with linear searching in small blocks of cache line size).


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell