fixParameters method
Fixes any parameters if they are going out of bounds
Generallly: Listentry1, entry2, ...
.
with: entry = "parname fixed/free limit1 limit2"
Example:
parInfo = "name1 fixed 0.5 1.0", "name2 free null null", ...
Implementation
List<double> fixParameters(List<double> pars) {
//print("jsfit 2000=$pars");
//print("jsfit 2001=${fitterOptions.runtimeType}");
//print("jsfit 2002=${fitterOptions}");
List<String> parInfo = fitterOptions["parInfo"];
//print("jsfit 2003=${parInfo}");
if (parInfo != null) {
for (int k = 0; k < pars.length; k++) {
//set the limits, if they exist in the parInfo array
String entry = parInfo[k];
if(entry==null)continue;
List<String> entryItems = entry.split(" ");
if (entryItems[2] != "null" && entryItems[3] != "null") {
double limit1 = double.parse(entryItems[2]);
double limit2 = double.parse(entryItems[3]);
if (pars[k] < limit1) {
pars[k] = limit1;
}
if (pars[k] > limit2) {
pars[k] = limit2;
}
}
//reset the fixed params to the initial values
if (entryItems[1] == "fixed") {
pars[k] = initialParams[k];
}
}
}
return pars;
}