Commit 3357ad5b authored by Andrey Filippov's avatar Andrey Filippov

Another bug - new centered targets inherited fail==0, not NaN for

non-centered
parent 5fed114d
......@@ -299,14 +299,15 @@ public class CuasMotionLMA {
public void setResult(double [] rslt) {
rslt[RSLT_X] = getCenter()[0];
rslt[RSLT_Y] = getCenter()[1];
rslt[RSLT_A] = getA();
// rslt[RSLT_A] = getA();
rslt[RSLT_A] = getMaxFx(); // maximum of fx, getA() may be much larger!
rslt[RSLT_R0] = getR0();
rslt[RSLT_R1] = getR0() / ((getK()>1) ? getK() : 1.0);
rslt[RSLT_K] = getK();
rslt[RSLT_C] = getC();
rslt[RSLT_RMS] = getRMS();
rslt[RSLT_RMS_A] = getRMS()/getA();
rslt[RSLT_MAX2A] = max_val/getA(); // ratio of maximal value to LMA amplitude
rslt[RSLT_RMS_A] = getRMS()/rslt[RSLT_A]; // getA();
rslt[RSLT_MAX2A] = max_val/rslt[RSLT_A]; // getA(); // ratio of maximal value to LMA amplitude
rslt[RSLT_ITERS] = getIters();
return;
}
......@@ -750,6 +751,7 @@ public class CuasMotionLMA {
return err;
}
private double [][] getFxDerivsDelta(
double [] vector,
final double delta,
......@@ -774,7 +776,29 @@ public class CuasMotionLMA {
return jt;
}
public double getMaxFx() {
double [] fx = getFx();
double mfx = Double.NaN;
for (double d:fx) {
if (!(d <= mfx)) {
mfx = d;
}
}
return mfx;
}
public double [] getFx() {
return getFxDerivs(
full_vector, // final double [] vector,
null, // final double [][] jt, // should be null or initialized with [vector.length][]
-10); // final int debug_level)
}
public double [] getLastYMinusFx() {
return last_ymfx;
}
public double [] getWeights() {
return weights;
}
private double [] getFxDerivs(
final double [] vector,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment