gsl_fit.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* fit/gsl_fit.h
  2. *
  3. * Copyright (C) 2000, 2007 Brian Gough
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GSL_FIT_H__
  20. #define __GSL_FIT_H__
  21. #include <stdlib.h>
  22. #include "gsl_math.h"
  23. #undef __BEGIN_DECLS
  24. #undef __END_DECLS
  25. #ifdef __cplusplus
  26. # define __BEGIN_DECLS extern "C" {
  27. # define __END_DECLS }
  28. #else
  29. # define __BEGIN_DECLS /* empty */
  30. # define __END_DECLS /* empty */
  31. #endif
  32. __BEGIN_DECLS
  33. int gsl_fit_linear (const double * x, const size_t xstride,
  34. const double * y, const size_t ystride,
  35. const size_t n,
  36. double * c0, double * c1,
  37. double * cov00, double * cov01, double * cov11,
  38. double * sumsq);
  39. int gsl_fit_wlinear (const double * x, const size_t xstride,
  40. const double * w, const size_t wstride,
  41. const double * y, const size_t ystride,
  42. const size_t n,
  43. double * c0, double * c1,
  44. double * cov00, double * cov01, double * cov11,
  45. double * chisq);
  46. int
  47. gsl_fit_linear_est (const double x,
  48. const double c0, const double c1,
  49. const double cov00, const double cov01, const double cov11,
  50. double *y, double *y_err);
  51. int gsl_fit_mul (const double * x, const size_t xstride,
  52. const double * y, const size_t ystride,
  53. const size_t n,
  54. double * c1,
  55. double * cov11,
  56. double * sumsq);
  57. int gsl_fit_wmul (const double * x, const size_t xstride,
  58. const double * w, const size_t wstride,
  59. const double * y, const size_t ystride,
  60. const size_t n,
  61. double * c1,
  62. double * cov11,
  63. double * sumsq);
  64. int
  65. gsl_fit_mul_est (const double x,
  66. const double c1,
  67. const double cov11,
  68. double *y, double *y_err);
  69. __END_DECLS
  70. #endif /* __GSL_FIT_H__ */