SimpleVector.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SimpleVector.cpp
  2. *
  3. * Copyright (C) 1994-2012, 2015-2017 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 20020812 GPL header
  20. djmw 20071012 Added: oo_CAN_WRITE_AS_ENCODING.h
  21. */
  22. #include "SimpleVector.h"
  23. #include "oo_DESTROY.h"
  24. #include "SimpleVector_def.h"
  25. #include "oo_COPY.h"
  26. #include "SimpleVector_def.h"
  27. #include "oo_EQUAL.h"
  28. #include "SimpleVector_def.h"
  29. #include "oo_CAN_WRITE_AS_ENCODING.h"
  30. #include "SimpleVector_def.h"
  31. #include "oo_WRITE_TEXT.h"
  32. #include "SimpleVector_def.h"
  33. #include "oo_WRITE_BINARY.h"
  34. #include "SimpleVector_def.h"
  35. #include "oo_READ_TEXT.h"
  36. #include "SimpleVector_def.h"
  37. #include "oo_READ_BINARY.h"
  38. #include "SimpleVector_def.h"
  39. #include "oo_DESCRIPTION.h"
  40. #include "SimpleVector_def.h"
  41. Thing_implement (DoubleVector, Daata, 0);
  42. void DoubleVector_init (DoubleVector me, integer min, integer max) {
  43. my min = min;
  44. my max = max;
  45. my v = NUMvector<double> (min, max);
  46. }
  47. autoDoubleVector DoubleVector_create (integer min, integer max) {
  48. try {
  49. autoDoubleVector me = Thing_new (DoubleVector);
  50. DoubleVector_init (me.get(), min, max);
  51. return me;
  52. } catch (MelderError) {
  53. Melder_throw (U"DoubleVector not created.");
  54. }
  55. }
  56. Thing_implement (ComplexVector, Daata, 0);
  57. void ComplexVector_init (ComplexVector me, integer min, integer max) {
  58. my min = min;
  59. my max = max;
  60. my v = NUMvector<dcomplex> (min, max);
  61. }
  62. autoComplexVector ComplexVector_create (integer min, integer max) {
  63. try {
  64. autoComplexVector me = Thing_new (ComplexVector);
  65. ComplexVector_init (me.get(), min, max);
  66. return me;
  67. } catch (MelderError) {
  68. Melder_throw (U"ComplexVector not created.");
  69. }
  70. }
  71. /* End of file SimpleVector.cpp */