[eigen] Unifying decomposition interfaces

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

Hi there,

I recognized that some of Eigen's decompositions offer a public method

  void compute(MatrixType&)

while others do not. IMHO, a public compute method is useful - it
allows the user to reuse decomposition objects without the need to
allocate the required intermediate members on and on. A particular use
case in which I need this is for the Eigenvalue decomposition.
Consider the case in which you want to compute the Eigenvalue
decompositions of the Hessian (just a 2x2 matrix in this case) of each
pixel in an image. Recreating the decomposition object in this case is
unnecessary and actually costs a lot of time.

I tried to unify the decomposition interfaces (PartialLU, LU, QR, SVD,
Cholesky, Eigensolver) in the following way:

1) if not already existing, add a public method 'void compute(MatrixType&)'
2) add a default ctor to all decompositions

The second step is required in order to spare the user from the need
of creating decomposition objects with a dummy matrix in cases they
actually intend to use them via compute(...).

I created a fork with the required changes and would like to hear your
opinions about them and the idea in general.

The fork can be found here: http://bitbucket.org/hauke/eigen2/overview/


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