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