lemmingapex / trilateration

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer
MIT License
398 stars 106 forks source link

Incompatibles type LevenbergMarquardtOptimizer cannot be converted to LeastSquaresOptimizer NonLinearLeastSquaresSolver #28

Closed benjaminpeere closed 4 years ago

benjaminpeere commented 4 years ago

Hello, I am trying to implement your solution, but I am having a problem, here is the error that I have :

incompatible types: LevenbergMarquardtOptimizer cannot be converted to LeastSquaresOptimizer
    NonLinearLeastSquaresSolver solver = new NonLinearLeastSquaresSolver(new TrilaterationFunction(positions, distances), new LevenbergMarquardtOptimizer());

I really don't know why I am having this error, if I am doing something wrong, or if there is a type problem in the plugin. Let me know if you have any idea.

Thanks for your work, if I can make it work it would be amazing! Best regards.

kburfi commented 4 years ago

I think you may have imported a wrong or deprecated version of LevenbergMarquardtOptimizer. The correct import is: import org.apache.commons.math3.fitting.leastsquares.LevenbergMarquardtOptimizer;

benjaminpeere commented 4 years ago

You're right! I wa susing a the wrong import, thank you so much!