gsl_sort__sortvec.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Implement Heap sort -- direct and indirect sorting
  3. * Based on descriptions in Sedgewick "Algorithms in C"
  4. *
  5. * Copyright (C) 1999 Thomas Walter
  6. *
  7. * 18 February 2000: Modified for GSL by Brian Gough
  8. *
  9. * This is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 3, or (at your option) any
  12. * later version.
  13. *
  14. * This source is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  17. * for more details.
  18. */
  19. #include "gsl__config.h"
  20. #include "gsl_errno.h"
  21. #include "gsl_vector.h"
  22. #include "gsl_sort.h"
  23. #include "gsl_sort_vector.h"
  24. #define BASE_LONG_DOUBLE
  25. #include "templates_on.h"
  26. #include "gsl_sort__sortvec_source.c"
  27. #include "templates_off.h"
  28. #undef BASE_LONG_DOUBLE
  29. #define BASE_DOUBLE
  30. #include "templates_on.h"
  31. #include "gsl_sort__sortvec_source.c"
  32. #include "templates_off.h"
  33. #undef BASE_DOUBLE
  34. #define BASE_FLOAT
  35. #include "templates_on.h"
  36. #include "gsl_sort__sortvec_source.c"
  37. #include "templates_off.h"
  38. #undef BASE_FLOAT
  39. #define BASE_ULONG
  40. #include "templates_on.h"
  41. #include "gsl_sort__sortvec_source.c"
  42. #include "templates_off.h"
  43. #undef BASE_ULONG
  44. #define BASE_LONG
  45. #include "templates_on.h"
  46. #include "gsl_sort__sortvec_source.c"
  47. #include "templates_off.h"
  48. #undef BASE_LONG
  49. #define BASE_UINT
  50. #include "templates_on.h"
  51. #include "gsl_sort__sortvec_source.c"
  52. #include "templates_off.h"
  53. #undef BASE_UINT
  54. #define BASE_INT
  55. #include "templates_on.h"
  56. #include "gsl_sort__sortvec_source.c"
  57. #include "templates_off.h"
  58. #undef BASE_INT
  59. #define BASE_USHORT
  60. #include "templates_on.h"
  61. #include "gsl_sort__sortvec_source.c"
  62. #include "templates_off.h"
  63. #undef BASE_USHORT
  64. #define BASE_SHORT
  65. #include "templates_on.h"
  66. #include "gsl_sort__sortvec_source.c"
  67. #include "templates_off.h"
  68. #undef BASE_SHORT
  69. #define BASE_UCHAR
  70. #include "templates_on.h"
  71. #include "gsl_sort__sortvec_source.c"
  72. #include "templates_off.h"
  73. #undef BASE_UCHAR
  74. #define BASE_CHAR
  75. #include "templates_on.h"
  76. #include "gsl_sort__sortvec_source.c"
  77. #include "templates_off.h"
  78. #undef BASE_CHAR