//Constructor /// <summary> /// Creates an initialized instance. /// </summary> /// <param name="cfg">The configuration.</param> public ParamValFinder(ParamValFinderSettings cfg) { if (cfg.NumOfSubIntervals == ParamValFinderSettings.AutoSubIntervalsNum) { if (cfg.Min == cfg.Max) { _numOfIntervalInnerPoints = 0; _testCaseCollection = new TestCase[1]; _testCaseCollection[0] = new TestCase() { ParamValue = cfg.Min, Error = double.NaN }; _currentTestCaseIdx = 0; return; } else { _numOfIntervalInnerPoints = DefaultNumOfIntervalInnerPoints; _testCaseCollection = new TestCase[2 + _numOfIntervalInnerPoints]; } } else { _numOfIntervalInnerPoints = cfg.NumOfSubIntervals; _testCaseCollection = new TestCase[2 + _numOfIntervalInnerPoints]; } for (int i = 0; i < _testCaseCollection.Length; i++) { _testCaseCollection[i] = new TestCase() { ParamValue = double.NaN, Error = double.NaN }; } Replan(cfg.Min, double.NaN, cfg.Max, double.NaN); return; }
/// <summary> /// The copy constructor. /// </summary> /// <param name="source">The source instance.</param> public ParamValFinderSettings(ParamValFinderSettings source) : this(source.Min, source.Max, source.NumOfSubIntervals) { return; }