## lssol_avd..txt

 1 ``` ``` ```if (pgm.i4[I_ALG] == 0) sts = alg_lssol(); /* straight LSSOL */ ``` ``` else if (pgm.i4[I_ALG] == 1) sts = alg_svd_lssol(0); /* SVD */ ``` ``` else if (pgm.i4[I_ALG] == 2) sts = alg_svd_lssol(1); /* SVD + LSSOL */ ``` ``` else if (pgm.i4[I_ALG] == 3) sts = alg_3bump1(); /* 3bump for BPMs ``` ``` not matched to CEDs*/ ``` ```int alg_lssol(void) /* LSSOL */ ``` ```-> sorbit_ls_lssol ``` ``` - does the LSSOL least squares constrained fit to get the ``` ``` new corrector delta angles and the new predicted orbit ``` ```int alg_svd_lssol(int opt) ``` ``` - smooth orbit least squares algorithm using SVD algorithm to identify ``` ``` singularities so that the problem can be reformulated without ``` ``` the singularities so that LSSOL can be called to solve the ``` ``` problem with constraints on the correctors. One may also ``` ``` obtain the standard SVD solution ``` ```-> ``` ``` if (opt == 0) { /* SVD */ ``` ``` sts = sorbit_ls_compute_svd(pl,nced,nbpm,cor->stepcut,dx1,dthet,dx2); ``` ``` } ``` ``` else { /* SVD + LSSOL */ ``` ``` sts = sorbit_ls_compute_lssol(pl,nced,nbpm,cor->stepcut,dx1,lb,ub, ``` ``` dthet,dx2,&lserr); ``` ``` if (lserr >= 0 && lserr <=6 )error_message_c(mes[lserr],0,GREEN,TRUE); ``` ``` } ``` ```int alg_3bump(void) ``` ```-> sorbit_3bump /* 3bump requiring bpm matched ceds one-to-one */ ``` ```- sorbit_ls_lssol is in module sorbitlssol.cpp ``` ```- sorbit_ls_compute_svd and sorbit_ls_compute_lssol are in module sorbitls.cpp ``` ```- sorbit_3bump is in module sorbit3bump.cpp ```