NYUGP17 / Assignment_2

2 stars 1 forks source link

Am I using the wrong solver from Eigen? #1

Closed GromitC closed 7 years ago

GromitC commented 7 years ago

Hi,

Below is the way I solve the system of equations in the MLS: MatrixXd AB=AB; //LHS VectorXd BC= Bimplicit_functionVector; //RHS VectorXd x; x= AB.householderQr().solve(BC);

It works correctly (from the images I saw) but it is very slow. Is there a better way to do that? Thanks!

jpanetta commented 7 years ago

Are you sure the householderQr call is the bottleneck? What is the size of AB? For degree 1, e.g., this should be a 1x1 linear system which is trivial to solve.

It's most likely that your matrix construction is slow. Perhaps you're considering constraint points outside the Wendland radius ball around the eval pt when building the matrix? (Those constraints have zero weight and should be ignored.) Or maybe your Wendland radius is too large?

GromitC commented 7 years ago

Oh yes the reason is very silly actually.. I did too many Eigen resizes (i.e. resize() method) that makes the stuff slow. Problem solved :)) 👍