Registered Member
|
I have been handed some IDL code to port to C++ for a project (http://dream3d.bluequartz.net). In this code the curvature of a patch of triangles is being calculated by fitting a polynomial to the set of points where each point is the centroid of a triangle. The equation is of the form:
z=A * 0.5*x^2 + B*x*y + C*0.5*y^2. The system is over constrained as I have lots and lots of triangles (at least 70 in most cases) and I need to be able to solve for A, B and C. Using LAPACK/BLAS I can use the "dgels" function to get A, B, and C. What function/template am I looking for in Eigen? Also after I solve for A,B and C I need to solve the Eigen value problem for the matrix [AB][BC] along with the accompanying Eigen Vectors. We think the equivalent BLAS/LAPCK function is "DSPEV". What function would I be looking for in the Eigen library? Thank for any help or pointers to the docs (which I am starting to read through). --- Mike Jackson Principal Software Engineer - BlueQuartz Software (www.bluequartz.net) I would like to use Eigen instead of BLAS/LAPACK as we are trying to use purely Open Source libraries where we can and attempting to actually get a usable BLAS/LAPACK on Windows with MSVC is basically a non-starter (at least it was for me). I could go a "paid" route and use the Intel MKL for example but I would really rather NOT have to do that. |
Moderator
|
Hi,
your first problem is a standard least squares problem that you can solve using either the normal equation and the LLT method, or using a QR factorization or even a SVD. See this page: http://eigen.tuxfamily.org/dox/Tutorial ... gebra.html For the eigenvalue problem, you can use: Matrix2d M; M << A, B, B, C; SelfAdjointEigenSolver<Matrix2d> eig(M); eig.eigenvalues(); eig.eigenvectors(); See this section: http://eigen.tuxfamily.org/dox/Tutorial ... gensolving |
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot]