Blame err/strerror.c

Packit 67cb25
/* err/strerror.c
Packit 67cb25
 * 
Packit 67cb25
 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
Packit 67cb25
 * 
Packit 67cb25
 * This program is free software; you can redistribute it and/or modify
Packit 67cb25
 * it under the terms of the GNU General Public License as published by
Packit 67cb25
 * the Free Software Foundation; either version 3 of the License, or (at
Packit 67cb25
 * your option) any later version.
Packit 67cb25
 * 
Packit 67cb25
 * This program is distributed in the hope that it will be useful, but
Packit 67cb25
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 67cb25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 67cb25
 * General Public License for more details.
Packit 67cb25
 * 
Packit 67cb25
 * You should have received a copy of the GNU General Public License
Packit 67cb25
 * along with this program; if not, write to the Free Software
Packit 67cb25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
#include <config.h>
Packit 67cb25
#include <gsl/gsl_errno.h>
Packit 67cb25
Packit 67cb25
const char *
Packit 67cb25
gsl_strerror (const int gsl_errno)
Packit 67cb25
{
Packit 67cb25
  switch (gsl_errno)
Packit 67cb25
    {
Packit 67cb25
    case GSL_SUCCESS:
Packit 67cb25
      return "success" ;
Packit 67cb25
    case GSL_FAILURE:
Packit 67cb25
      return "failure" ;
Packit 67cb25
    case GSL_CONTINUE:
Packit 67cb25
      return "the iteration has not converged yet";
Packit 67cb25
    case GSL_EDOM:
Packit 67cb25
      return "input domain error" ;
Packit 67cb25
    case GSL_ERANGE:
Packit 67cb25
      return "output range error" ;
Packit 67cb25
    case GSL_EFAULT:
Packit 67cb25
      return "invalid pointer" ;
Packit 67cb25
    case GSL_EINVAL:
Packit 67cb25
      return "invalid argument supplied by user" ;
Packit 67cb25
    case GSL_EFAILED:
Packit 67cb25
      return "generic failure" ;
Packit 67cb25
    case GSL_EFACTOR:
Packit 67cb25
      return "factorization failed" ;
Packit 67cb25
    case GSL_ESANITY:
Packit 67cb25
      return "sanity check failed - shouldn't happen" ;
Packit 67cb25
    case GSL_ENOMEM:
Packit 67cb25
      return "malloc failed" ;
Packit 67cb25
    case GSL_EBADFUNC:
Packit 67cb25
      return "problem with user-supplied function";
Packit 67cb25
    case GSL_ERUNAWAY:
Packit 67cb25
      return "iterative process is out of control";
Packit 67cb25
    case GSL_EMAXITER:
Packit 67cb25
      return "exceeded max number of iterations" ;
Packit 67cb25
    case GSL_EZERODIV:
Packit 67cb25
      return "tried to divide by zero" ;
Packit 67cb25
    case GSL_EBADTOL:
Packit 67cb25
      return "specified tolerance is invalid or theoretically unattainable" ;
Packit 67cb25
    case GSL_ETOL:
Packit 67cb25
      return "failed to reach the specified tolerance" ;
Packit 67cb25
    case GSL_EUNDRFLW:
Packit 67cb25
      return "underflow" ;
Packit 67cb25
    case GSL_EOVRFLW:
Packit 67cb25
      return "overflow" ;
Packit 67cb25
    case GSL_ELOSS:
Packit 67cb25
      return "loss of accuracy" ;
Packit 67cb25
    case GSL_EROUND:
Packit 67cb25
      return "roundoff error" ;
Packit 67cb25
    case GSL_EBADLEN:
Packit 67cb25
      return "matrix/vector sizes are not conformant" ;
Packit 67cb25
    case GSL_ENOTSQR:
Packit 67cb25
      return "matrix not square" ;
Packit 67cb25
    case GSL_ESING:
Packit 67cb25
      return "singularity or extremely bad function behavior detected" ;
Packit 67cb25
    case GSL_EDIVERGE:
Packit 67cb25
      return "integral or series is divergent" ;
Packit 67cb25
    case GSL_EUNSUP:
Packit 67cb25
      return "the required feature is not supported by this hardware platform";
Packit 67cb25
    case GSL_EUNIMPL:
Packit 67cb25
      return "the requested feature is not (yet) implemented";
Packit 67cb25
    case GSL_ECACHE:
Packit 67cb25
      return "cache limit exceeded";
Packit 67cb25
    case GSL_ETABLE:
Packit 67cb25
      return "table limit exceeded";
Packit 67cb25
    case GSL_ENOPROG:
Packit 67cb25
      return "iteration is not making progress towards solution";
Packit 67cb25
    case GSL_ENOPROGJ:
Packit 67cb25
      return "jacobian evaluations are not improving the solution";
Packit 67cb25
    case GSL_ETOLF:
Packit 67cb25
      return "cannot reach the specified tolerance in F";
Packit 67cb25
    case GSL_ETOLX:
Packit 67cb25
      return "cannot reach the specified tolerance in X";
Packit 67cb25
    case GSL_ETOLG:
Packit 67cb25
      return "cannot reach the specified tolerance in gradient";
Packit 67cb25
    case GSL_EOF:
Packit 67cb25
      return "end of file";
Packit 67cb25
    default:
Packit 67cb25
      return "unknown error code" ;
Packit 67cb25
    }
Packit 67cb25
}