Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Obsolete methods

I upgraded to Measurement Studio 8.0.1 this morning and when I compile my code I receive the following warnings:
 
Warning 1 'NationalInstruments.Analysis.Math.CurveFit.LinearFit(double[], double[], out double, out double, out double)' is obsolete: 'Use an overload of this method that accepts a FitMethod argument to achieve the same functionality.' 
 
Warning 2 'NationalInstruments.Analysis.Math.CurveFit.PolynomialFit(double[], double[], int, out double[], out double)' is obsolete: 'Use an overload of this method that accepts a PolynomialFitAlgorithm argument to achieve the same functionality.'
 
How do I know which FitMethod and PolynomialFitAlgorithm to use now? Is there a correlation between the obsolete methods and the new algorithms?
0 Kudos
Message 1 of 2
(2,786 Views)
Hi ppodlevs,

These methods have been obsoleted for quite a while, and eventually they will be removed all together. Furthermore, for new users and/or new projects, these methods do not show up under the intellisense menu, so using them has be intentional. I understand that in your case you are upgrading and trying to bring your program up to speed, and you are right to do so.

In general, most programmers have a requirement to use a specific algorithm, and the newer functions now give them that option. If you don't know which method you need to use, or if you don't care, you could just choose the first option in the enum. If you just want it to perform like before, you could also try each option and compare the results with the old functions.

In the case of LinearFit, the old functions used the least square fit method by default, so you can draw a 1-to-1 correlation between calling the old functions and calling the new functions with FitMethod.LeastSquare.

Regards,
0 Kudos
Message 2 of 2
(2,737 Views)