src/polyfit.h

changeset 508
7f2ec2bc9d2e
equal deleted inserted replaced
507:fa07b6c6238a 508:7f2ec2bc9d2e
1 /**
2 * @brief Header file for MLS polynomial fitting.
3 * @file polyfit.h
4 * @author Henry Forson, Melbourne, FL
5 */
6
7
8 //------------------------------------------------------------------------------------
9 // MIT License
10 //
11 // Copyright (c) 2020 Henry M. Forson
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a copy
14 // of this software and associated documentation files (the "Software"), to deal
15 // in the Software without restriction, including without limitation the rights
16 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 // copies of the Software, and to permit persons to whom the Software is
18 // furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included in all
21 // copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 // SOFTWARE.
30 //------------------------------------------------------------------------------------
31
32
33 #ifndef POLYFIT_H
34 #define POLYFIT_H
35
36 #include <QString>
37
38
39
40 /**
41 * @namespace Polyfit
42 *
43 * @brief Global math functions.
44 */
45 namespace Polyfit {
46 /**
47 * @brief Computes polynomial coefficients that best fit a set of input points.
48 * @param pointCount Number of points
49 * @param xValues Array of double values.
50 * @param yValues Array of double values.
51 * @param coefficientCount Number of coefficients in results.
52 * @param coefficientResults Array of coefficientCount double results.
53 * @return Error result, 0 is Ok.
54 */
55 int polyfit( int pointCount, double *xValues, double *yValues, int coefficientCount, double *coefficientResults );
56 }
57
58 #endif // POLYFIT_H

mercurial