Polynomial_def.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Polynomial_def.h
  2. *
  3. * Copyright (C) 1993-2018 David Weenink
  4. *
  5. * This code 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 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code 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 work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. djmw 1999
  20. djmw 20020813 GPL header
  21. */
  22. #define ooSTRUCT FunctionTerms
  23. oo_DEFINE_CLASS (FunctionTerms, Function)
  24. oo_INTEGER (numberOfCoefficients)
  25. oo_DOUBLE_VECTOR (coefficients, numberOfCoefficients)
  26. #if ! oo_READING && ! oo_WRITING
  27. oo_INTEGER (_capacity)
  28. #endif
  29. #if oo_READING
  30. _capacity = numberOfCoefficients;
  31. #endif
  32. #if oo_DECLARING
  33. virtual double v_evaluate (double x);
  34. virtual dcomplex v_evaluate_z (dcomplex z);
  35. virtual void v_evaluateTerms (double x, double terms[]);
  36. virtual void v_getExtrema (double x1, double x2, double *xmin, double *ymin, double *xmax, double *ymax);
  37. virtual integer v_getDegree ();
  38. #endif
  39. oo_END_CLASS (FunctionTerms)
  40. #undef ooSTRUCT
  41. #define ooSTRUCT Spline
  42. oo_DEFINE_CLASS (Spline, FunctionTerms)
  43. oo_INTEGER (degree)
  44. oo_INTEGER (numberOfKnots)
  45. oo_VEC (knots, numberOfKnots)
  46. #if oo_DECLARING
  47. double v_evaluate (double x)
  48. override;
  49. integer v_getDegree ()
  50. override;
  51. virtual integer v_getOrder ();
  52. #endif
  53. oo_END_CLASS (Spline)
  54. #undef ooSTRUCT
  55. /* End of file Polynomial_def.h */