gsl_err__strerror.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* err/strerror.c
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, 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. #include "gsl__config.h"
  20. #include "gsl_errno.h"
  21. const char *
  22. gsl_strerror (const int gsl_errno)
  23. {
  24. switch (gsl_errno)
  25. {
  26. case GSL_SUCCESS:
  27. return "success" ;
  28. case GSL_FAILURE:
  29. return "failure" ;
  30. case GSL_CONTINUE:
  31. return "the iteration has not converged yet";
  32. case GSL_EDOM:
  33. return "input domain error" ;
  34. case GSL_ERANGE:
  35. return "output range error" ;
  36. case GSL_EFAULT:
  37. return "invalid pointer" ;
  38. case GSL_EINVAL:
  39. return "invalid argument supplied by user" ;
  40. case GSL_EFAILED:
  41. return "generic failure" ;
  42. case GSL_EFACTOR:
  43. return "factorization failed" ;
  44. case GSL_ESANITY:
  45. return "sanity check failed - shouldn't happen" ;
  46. case GSL_ENOMEM:
  47. return "malloc failed" ;
  48. case GSL_EBADFUNC:
  49. return "problem with user-supplied function";
  50. case GSL_ERUNAWAY:
  51. return "iterative process is out of control";
  52. case GSL_EMAXITER:
  53. return "exceeded max number of iterations" ;
  54. case GSL_EZERODIV:
  55. return "tried to divide by zero" ;
  56. case GSL_EBADTOL:
  57. return "specified tolerance is invalid or theoretically unattainable" ;
  58. case GSL_ETOL:
  59. return "failed to reach the specified tolerance" ;
  60. case GSL_EUNDRFLW:
  61. return "underflow" ;
  62. case GSL_EOVRFLW:
  63. return "overflow" ;
  64. case GSL_ELOSS:
  65. return "loss of accuracy" ;
  66. case GSL_EROUND:
  67. return "roundoff error" ;
  68. case GSL_EBADLEN:
  69. return "matrix/vector sizes are not conformant" ;
  70. case GSL_ENOTSQR:
  71. return "matrix not square" ;
  72. case GSL_ESING:
  73. return "singularity or extremely bad function behavior detected" ;
  74. case GSL_EDIVERGE:
  75. return "integral or series is divergent" ;
  76. case GSL_EUNSUP:
  77. return "the required feature is not supported by this hardware platform";
  78. case GSL_EUNIMPL:
  79. return "the requested feature is not (yet) implemented";
  80. case GSL_ECACHE:
  81. return "cache limit exceeded";
  82. case GSL_ETABLE:
  83. return "table limit exceeded";
  84. case GSL_ENOPROG:
  85. return "iteration is not making progress towards solution";
  86. case GSL_ENOPROGJ:
  87. return "jacobian evaluations are not improving the solution";
  88. case GSL_ETOLF:
  89. return "cannot reach the specified tolerance in F";
  90. case GSL_ETOLX:
  91. return "cannot reach the specified tolerance in X";
  92. case GSL_ETOLG:
  93. return "cannot reach the specified tolerance in gradient";
  94. case GSL_EOF:
  95. return "end of file";
  96. default:
  97. return "unknown error code" ;
  98. }
  99. }