Re: [eigen] Proposal: documentation for Eigen3

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hello,

I've just recently started using eigen2 (and I've been lurking on this
list for a while), so I can't add much in the way of documentation
suggestions for eigen3, but thought I'd add a bit of what I've found
missing in the eigen2 documentation.

There isn't any discussion of how to create one's own classes.   In
particular, I'd like to create a class that inherits from MatrixBase
(or whatever is necessary) such that I can do arithmetic on this
class.  It's mostly going to be a large array, but will also contain a
bit of metadata.  I could, of course, include the array as a data
member, but then I wouldn't be able to do vector arithmetic on the
objects directly, which would uglify the code.

I also wonder if there is a way to create classes such as subclasses
of Vector3d, which retain their distinct identity, so you couldn't add
together two different such classes.  In particular, I'd like to be
able to distinguish between real-space and reciprocal-space vectors,
and I'd also like to distinguish Cartesian vectors from those which
are relative to lattice vectors (which won't be orthogonal in the
general case, so dot products shouldn't be used.  It'd be nice to have
this feature, but if it doesn't really work (e.g. because the sum of
two vectors loses its type, or because I lose the ability to take
advantage of template expressions), then I'd want to just use plain
old Vector3ds, possibly with a few typedefs with which to document
which sort of vector a particular object actually is.

Anyhow, it'd be nice to have some general discussion of what can and
cannot be done in terms of subclassing and extending, suitable for
persons who aren't template gurus.  Or a discussion of why this sort
of thing is a bad idea, if it is.

David Roundy

(for my current code, see http://github.com/droundy/dafty)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/