|[eigen] Unifying decomposition interfaces|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Unifying decomposition interfaces
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Wed, 20 May 2009 13:29:51 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=GE/lUPZOBxSNMEaQSIXwjiXwz7yyTu3z4cMM8oeSJi0=; b=t9wPjn8wN1zAxHAE5EntgOj+6KxDKbpUp6SJNUaFJdT8YWLx4lOvKGnqFYSALRxkxf E/5nQ53xnicNiE+kMCk1NnpIY9oc4CzVf9N+mSRiJuF5ftAyJvMVeJsPsuhBGogTAGBg sEvc13bi4bm6KdwMJSdyuikNO5kmxjKtg780c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=SpWI5AZjnD7h5JtjAsaFfEIAEkmTs+AQM1i3BLYNqmeyaQirYs4m5o+YWA6ehkr3zY VFBdPyIxYSCtzxNMLPoF+FHieo7wvLiF6YBR0G7LBPKQtAVIYt1w2rh4EYGsyKM/f/H1 56N6C/KMUdY7aOZC+kN003VmKhTSsNHNUUnvw=
I recognized that some of Eigen's decompositions offer a public method
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/