00001 00006 // Written by Curtis Olson, started September 1997. 00007 // 00008 // Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Library General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Library General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with this program; if not, write to the Free Software 00022 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00023 // 00024 // $Id: leastsqs_8hxx_source.html,v 1.3 2010/02/23 22:10:14 curt Exp $ 00025 00026 00027 #ifndef _LEASTSQS_H 00028 #define _LEASTSQS_H 00029 00030 00031 #ifndef __cplusplus 00032 # error This library requires C++ 00033 #endif 00034 00035 00052 void least_squares(double *x, double *y, int n, double *m, double *b); 00053 00054 00058 void least_squares_update(double x, double y, double *m, double *b); 00059 00060 00068 double least_squares_error(double *x, double *y, int n, double m, double b); 00069 00070 00078 double least_squares_max_error(double *x, double *y, int n, double m, double b); 00079 00080 00081 #endif // _LEASTSQS_H 00082 00083