Chinese forum

Moderator: paullee

Forum rules

_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am

PlaneGCS中有四种求解算法：DogLeg、LM、BFGS和SQP，在求解过程中是依次调用的（第一种不行就用第二种），我发现Sketch.cpp中四种算法的调用顺序是DogLeg、LM、BFGS、SQP。请问这样安排算法顺序的原则是什么？是否是排在前面的算法效率更高且适用范围更大呢？

_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am

paullee
Posts: 3347
Joined: Wed May 04, 2016 3:58 pm

_Nemo wrote:
Fri Apr 02, 2021 6:44 am
PlaneGCS中有四种求解算法：DogLeg、LM、BFGS和SQP ...

_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am

paullee wrote:
Fri Apr 02, 2021 11:32 am
_Nemo wrote:
Fri Apr 02, 2021 6:44 am
PlaneGCS中有四种求解算法：DogLeg、LM、BFGS和SQP ...

paullee
Posts: 3347
Joined: Wed May 04, 2016 3:58 pm

_Nemo wrote:
Sat Apr 03, 2021 10:50 am

realthunder wrote: ping
_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am

paullee wrote:
Sat Apr 03, 2021 11:37 am

realthunder wrote: ping

realthunder
Posts: 1953
Joined: Tue Jan 03, 2017 10:55 am

Screenshot from 2021-04-04 18-17-08.png (80.3 KiB) Viewed 297 times
Screenshot from 2021-04-04 18-29-54.png (53.92 KiB) Viewed 297 times
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am

realthunder wrote:
Sun Apr 04, 2021 10:31 am

Screenshot from 2021-04-04 18-17-08.png
Screenshot from 2021-04-04 18-29-54.png

Code: Select all

if(!valid_solution && !isInitMove) { // Fall back to other solvers
for (int soltype=0; soltype < 4; soltype++) {

if(soltype==defaultsoltype){
continue; // skip default solver
}

switch (soltype) {
case 0:
solvername = "DogLeg";
ret = GCSsys.solve(isFine, GCS::DogLeg);
break;
case 1: // solving with the LevenbergMarquardt solver
solvername = "LevenbergMarquardt";
ret = GCSsys.solve(isFine, GCS::LevenbergMarquardt);
break;
case 2: // solving with the BFGS solver
solvername = "BFGS";
ret = GCSsys.solve(isFine, GCS::BFGS);
break;
case 3: // last resort: augment the system with a second subsystem and use the SQP solver
solvername = "SQP(augmented system)";
InitParameters.resize(Parameters.size());
int i=0;
for (std::vector<double*>::iterator it = Parameters.begin(); it != Parameters.end(); ++it, i++) {
InitParameters[i] = **it;
}
GCSsys.initSolution();
ret = GCSsys.solve(isFine);
break;
}
paullee
Posts: 3347
Joined: Wed May 04, 2016 3:58 pm

_Nemo wrote:
Tue Apr 06, 2021 2:30 am

_Nemo
Posts: 6
Joined: Sat Feb 06, 2021 8:25 am