System.out.println("LMA: iter="+iter+", full RMS="+last_rms[0]+" ("+initial_rms[0]+"), pure RMS="+last_rms[1]+" ("+initial_rms[1]+") + lambda="+lambda);
}
}
}
if((debug_level>-2)&&!rslt[0]){// failed
if((debug_level>1)||(iter==1)||last_run){
System.out.println("LMA failed on iteration = "+iter);
}
System.out.println();
}
returnrslt[0]?iter:-1;
}
privateboolean[]lmaStep(
doublelambda,
doublerms_diff,
intdebug_level){
boolean[]rslt={false,false};
// maybe the following if() branch is not needed - already done in prepareLMA !
if(this.last_rms==null){//first time, need to calculate all (vector is valid)
last_rms=newdouble[2];
if(debug_level>1){
System.out.println("lmaStep(): first step");
}
double[]fx=getFxDerivs(
parameters_vector,// double [] vector,
last_jt,// final double [][] jt, // should be null or initialized with [vector.length][]
debug_level);// final int debug_level)
last_ymfx=getYminusFxWeighted(
fx,// final double [] fx,
last_rms);// final double [] rms_fp // null or [2]
this.initial_rms=this.last_rms.clone();
this.good_or_bad_rms=this.last_rms.clone();
if(debug_level>-1){// temporary
/*
dbgYminusFxWeight(
this.last_ymfx,
this.weights,
"Initial_y-fX_after_moving_objects");
*/
}
if(last_ymfx==null){
returnnull;// need to re-init/restart LMA
}
// TODO: Restore/implement
if(debug_level>3){
doubledelta=this.delta;
doubledelta_err=compareJT(
parameters_vector,// double [] vector,
delta,// double delta,
last3only);// boolean last3only); // do not process samples - they are tested before