Updating RelaxISFitResult |
The RelaxISFitResult now contains the new Parameters. property The old properties ParameterValues and ParameterErrors have been made readonly. For compatiblity they still return the parameter values and errors, taken directly from the new parameters list. To facilitate that these properties are not used for write access, their type was changed from a double array to IReadOnlyList<double>.
The old functionality is contained in the new property. If the array returned by the previous properties was used e.g. in other function calls, a conversion back to an array by calling the ToArray() may be required. If data was written to the properties, now the Parameters must be adjusted instead.
No prerequisites for the update are needed.
Indentify where the property value was used.
[...] var parameterValues = fitResult.ParameterValues; return MyFunction(parameterValues);
Call the ToArray() function to convert the readonly-list back to an aray.
[...] var parameterValues = fitResult.ParameterValues.ToArray(); return MyFunction(parameterValues);
Identify where the property values were written to.
// Individual indexed access fitResult.ParameterValues[1] = 123.0; fitResult.ParameterErrors[1] = 0; // Full replacement of an array fitResult.ParameterValues = new double[] { 1.0, 2.0, 3.0 };
Access either the individual items or replace the values via a loop.
// Individual indexed access fitResult.Parameters[1].Value = 123.0; fitResult.Parameters[1].Error = 0; // Full replacement from an array. Length checks may be required. for (var i = 0; i < newArray.Length; i++) { fitResult.Parameters[i].Value = newArray[i]; }