/* File: benchmarksmodule.c
 * This file is auto-generated with f2py (version:2).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: Thu Feb  2 10:15:23 2023
 * Do not edit this file directly unless you know what you are doing!!!
 */

#ifdef __cplusplus
extern "C" {
#endif

/*********************** See f2py2e/cfuncs.py: includes ***********************/
#include "Python.h"
#include <stdarg.h>
#include "fortranobject.h"
#include <string.h>
#include <math.h>

/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
static PyObject *benchmarks_error;
static PyObject *benchmarks_module;

/*********************** See f2py2e/cfuncs.py: typedefs ***********************/
typedef char * string;

/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/
/*need_typedefs_generated*/

/********************** See f2py2e/cfuncs.py: cppmacros **********************/
\
#define FAILNULL(p) do {                                            \
    if ((p) == NULL) {                                              \
        PyErr_SetString(PyExc_MemoryError, "NULL pointer found");   \
        goto capi_fail;                                             \
    }                                                               \
} while (0)

#define STRINGMALLOC(str,len)\
    if ((str = (string)malloc(sizeof(char)*(len+1))) == NULL) {\
        PyErr_SetString(PyExc_MemoryError, "out of memory");\
        goto capi_fail;\
    } else {\
        (str)[len] = '\0';\
    }


#if defined(PREPEND_FORTRAN)
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F
#else
#define F_FUNC(f,F) _##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) _##F##_
#else
#define F_FUNC(f,F) _##f##_
#endif
#endif
#else
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F
#else
#define F_FUNC(f,F) f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_FUNC(f,F) F##_
#else
#define F_FUNC(f,F) f##_
#endif
#endif
#endif
#if defined(UNDERSCORE_G77)
#define F_FUNC_US(f,F) F_FUNC(f##_,F##_)
#else
#define F_FUNC_US(f,F) F_FUNC(f,F)
#endif

#define rank(var) var ## _Rank
#define shape(var,dim) var ## _Dims[dim]
#define old_rank(var) (PyArray_NDIM((PyArrayObject *)(capi_ ## var ## _tmp)))
#define old_shape(var,dim) PyArray_DIM(((PyArrayObject *)(capi_ ## var ## _tmp)),dim)
#define fshape(var,dim) shape(var,rank(var)-dim-1)
#define len(var) shape(var,0)
#define flen(var) fshape(var,0)
#define old_size(var) PyArray_SIZE((PyArrayObject *)(capi_ ## var ## _tmp))
/* #define index(i) capi_i ## i */
#define slen(var) capi_ ## var ## _len
#define size(var, ...) f2py_size((PyArrayObject *)(capi_ ## var ## _tmp), ## __VA_ARGS__, -1)

#define STRINGFREE(str) do {if (!(str == NULL)) free(str);} while (0)

#define CHECKSCALAR(check,tcheck,name,show,var)\
    if (!(check)) {\
        char errstring[256];\
        sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\
        PyErr_SetString(benchmarks_error,errstring);\
        /*goto capi_fail;*/\
    } else
#ifdef DEBUGCFUNCS
#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess);
#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \
    PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\
    fprintf(stderr,"\n");
#else
#define CFUNCSMESS(mess)
#define CFUNCSMESSPY(mess,obj)
#endif

#ifndef max
#define max(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) ((a < b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a > b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a < b) ? (a) : (b))
#endif

#define STRINGCOPYN(to,from,buf_size)                           \
    do {                                                        \
        int _m = (buf_size);                                    \
        char *_to = (to);                                       \
        char *_from = (from);                                   \
        FAILNULL(_to); FAILNULL(_from);                         \
        (void)strncpy(_to, _from, sizeof(char)*_m);             \
        _to[_m-1] = '\0';                                      \
        /* Padding with spaces instead of nulls */              \
        for (_m -= 2; _m >= 0 && _to[_m] == '\0'; _m--) {      \
            _to[_m] = ' ';                                      \
        }                                                       \
    } while (0)


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
#if 0
     // Unused
static int f2py_size(PyArrayObject* var, ...)
{
  npy_int sz = 0;
  npy_int dim;
  npy_int rank;
  va_list argp;
  va_start(argp, var);
  dim = va_arg(argp, npy_int);
  if (dim==-1)
    {
      sz = PyArray_SIZE(var);
    }
  else
    {
      rank = PyArray_NDIM(var);
      if (dim>=1 && dim<=rank)
        sz = PyArray_DIM(var, dim-1);
      else
        fprintf(stderr, "f2py_size: 2nd argument value=%d fails to satisfy 1<=value<=%d. Result will be 0.\n", dim, rank);
    }
  va_end(argp);
  return sz;
}
#endif

static int int_from_pyobj(int* v,PyObject *obj,const char *errmess) {
    PyObject* tmp = NULL;
    if (PyInt_Check(obj)) {
        *v = (int)PyInt_AS_LONG(obj);
        return 1;
    }
    tmp = PyNumber_Int(obj);
    if (tmp) {
        *v = PyInt_AS_LONG(tmp);
        Py_DECREF(tmp);
        return 1;
    }
    if (PyComplex_Check(obj))
        tmp = PyObject_GetAttrString(obj,"real");
    else if (PyString_Check(obj) || PyUnicode_Check(obj))
        /*pass*/;
    else if (PySequence_Check(obj))
        tmp = PySequence_GetItem(obj,0);
    if (tmp) {
        PyErr_Clear();
        if (int_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;}
        Py_DECREF(tmp);
    }
    {
        PyObject* err = PyErr_Occurred();
        if (err==NULL) err = benchmarks_error;
        PyErr_SetString(err,errmess);
    }
    return 0;
}

static int string_from_pyobj(string *str,int *len,const string inistr,PyObject *obj,const char *errmess) {
    PyArrayObject *arr = NULL;
    PyObject *tmp = NULL;
#ifdef DEBUGCFUNCS
fprintf(stderr,"string_from_pyobj(str='%s',len=%d,inistr='%s',obj=%p)\n",(char*)str,*len,(char *)inistr,obj);
#endif
    if (obj == Py_None) {
        if (*len == -1)
            *len = strlen(inistr); /* Will this cause problems? */
        STRINGMALLOC(*str,*len);
        STRINGCOPYN(*str,inistr,*len+1);
        return 1;
    }
    if (PyArray_Check(obj)) {
        if ((arr = (PyArrayObject *)obj) == NULL)
            goto capi_fail;
        if (!ISCONTIGUOUS(arr)) {
            PyErr_SetString(PyExc_ValueError,"array object is non-contiguous.");
            goto capi_fail;
        }
        if (*len == -1)
            *len = (PyArray_ITEMSIZE(arr))*PyArray_SIZE(arr);
        STRINGMALLOC(*str,*len);
        STRINGCOPYN(*str,PyArray_DATA(arr),*len+1);
        return 1;
    }
    if (PyString_Check(obj)) {
        tmp = obj;
        Py_INCREF(tmp);
    }
#if PY_VERSION_HEX >= 0x03000000
    else if (PyUnicode_Check(obj)) {
        tmp = PyUnicode_AsASCIIString(obj);
    }
    else {
        PyObject *tmp2;
        tmp2 = PyObject_Str(obj);
        if (tmp2) {
            tmp = PyUnicode_AsASCIIString(tmp2);
            Py_DECREF(tmp2);
        }
        else {
            tmp = NULL;
        }
    }
#else
    else {
        tmp = PyObject_Str(obj);
    }
#endif
    if (tmp == NULL) goto capi_fail;
    if (*len == -1)
        *len = PyString_GET_SIZE(tmp);
    STRINGMALLOC(*str,*len);
    STRINGCOPYN(*str,PyString_AS_STRING(tmp),*len+1);
    Py_DECREF(tmp);
    return 1;
capi_fail:
    Py_XDECREF(tmp);
    {
        PyObject* err = PyErr_Occurred();
        if (err==NULL) err = benchmarks_error;
        PyErr_SetString(err,errmess);
    }
    return 0;
}


/********************* See f2py2e/cfuncs.py: userincludes *********************/
/*need_userincludes*/

/********************* See f2py2e/capi_rules.py: usercode *********************/


/* See f2py2e/rules.py */
extern void bb03ad_(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t);
extern void bb04ad_(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t);
/*eof externroutines*/

/******************** See f2py2e/capi_rules.py: usercode1 ********************/


/******************* See f2py2e/cb_rules.py: buildcallback *******************/
/*need_callbacks*/

/*********************** See f2py2e/rules.py: buildapi ***********************/

/*********************************** bb03ad ***********************************/
static char doc_f2py_rout_benchmarks_bb03ad[] = "\
e,a,y,x = bb03ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,[lde,lda,ldy,ldb,ldx,ldu,note,ldwork,info,overwrite_e,overwrite_a,overwrite_y,overwrite_x])\n\nWrapper for ``bb03ad``.\
\n\nParameters\n----------\n"
"def : input string(len=1)\n"
"nr : input rank-1 array('i') with bounds (*)\n"
"dpar : input rank-1 array('d') with bounds (*)\n"
"ipar : input rank-1 array('i') with bounds (*)\n"
"vec : input rank-1 array('i') with bounds (8)\n"
"n : input int\n"
"m : input int\n"
"e : input rank-2 array('d') with bounds (lde,*)\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"y : input rank-2 array('d') with bounds (ldy,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"x : input rank-2 array('d') with bounds (ldx,*)\n"
"u : input rank-2 array('d') with bounds (ldu,*)\n"
"dwork : input rank-1 array('d') with bounds (ldwork)\n"
"\nOther Parameters\n----------------\n"
"overwrite_e : input int, optional\n    Default: 0\n"
"lde : input int, optional\n    Default: shape(e,0)\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a,0)\n"
"overwrite_y : input int, optional\n    Default: 0\n"
"ldy : input int, optional\n    Default: shape(y,0)\n"
"ldb : input int, optional\n    Default: shape(b,0)\n"
"overwrite_x : input int, optional\n    Default: 0\n"
"ldx : input int, optional\n    Default: shape(x,0)\n"
"ldu : input int, optional\n    Default: shape(u,0)\n"
"note : input string(len=70)\n"
"ldwork : input int, optional\n    Default: len(dwork)\n"
"info : input int\n"
"\nReturns\n-------\n"
"e : rank-2 array('d') with bounds (lde,*)\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"y : rank-2 array('d') with bounds (ldy,*)\n"
"x : rank-2 array('d') with bounds (ldx,*)";
/* extern void F_FUNC(bb03ad,BB03AD)(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_benchmarks_bb03ad(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  string def = NULL;
  int slen(def);
  PyObject *def_capi = Py_None;
  int *nr = NULL;
  npy_intp nr_Dims[1] = {-1};
  const int nr_Rank = 1;
  PyArrayObject *capi_nr_tmp = NULL;
  int capi_nr_intent = 0;
  PyObject *nr_capi = Py_None;
  double *dpar = NULL;
  npy_intp dpar_Dims[1] = {-1};
  const int dpar_Rank = 1;
  PyArrayObject *capi_dpar_tmp = NULL;
  int capi_dpar_intent = 0;
  PyObject *dpar_capi = Py_None;
  int *ipar = NULL;
  npy_intp ipar_Dims[1] = {-1};
  const int ipar_Rank = 1;
  PyArrayObject *capi_ipar_tmp = NULL;
  int capi_ipar_intent = 0;
  PyObject *ipar_capi = Py_None;
  int *vec = NULL;
  npy_intp vec_Dims[1] = {-1};
  const int vec_Rank = 1;
  PyArrayObject *capi_vec_tmp = NULL;
  int capi_vec_intent = 0;
  PyObject *vec_capi = Py_None;
  int n = 0;
  PyObject *n_capi = Py_None;
  int m = 0;
  PyObject *m_capi = Py_None;
  double *e = NULL;
  npy_intp e_Dims[2] = {-1, -1};
  const int e_Rank = 2;
  PyArrayObject *capi_e_tmp = NULL;
  int capi_e_intent = 0;
  int capi_overwrite_e = 0;
  PyObject *e_capi = Py_None;
  int lde = 0;
  PyObject *lde_capi = Py_None;
  double *a = NULL;
  npy_intp a_Dims[2] = {-1, -1};
  const int a_Rank = 2;
  PyArrayObject *capi_a_tmp = NULL;
  int capi_a_intent = 0;
  int capi_overwrite_a = 0;
  PyObject *a_capi = Py_None;
  int lda = 0;
  PyObject *lda_capi = Py_None;
  double *y = NULL;
  npy_intp y_Dims[2] = {-1, -1};
  const int y_Rank = 2;
  PyArrayObject *capi_y_tmp = NULL;
  int capi_y_intent = 0;
  int capi_overwrite_y = 0;
  PyObject *y_capi = Py_None;
  int ldy = 0;
  PyObject *ldy_capi = Py_None;
  double *b = NULL;
  npy_intp b_Dims[2] = {-1, -1};
  const int b_Rank = 2;
  PyArrayObject *capi_b_tmp = NULL;
  int capi_b_intent = 0;
  PyObject *b_capi = Py_None;
  int ldb = 0;
  PyObject *ldb_capi = Py_None;
  double *x = NULL;
  npy_intp x_Dims[2] = {-1, -1};
  const int x_Rank = 2;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  int capi_overwrite_x = 0;
  PyObject *x_capi = Py_None;
  int ldx = 0;
  PyObject *ldx_capi = Py_None;
  double *u = NULL;
  npy_intp u_Dims[2] = {-1, -1};
  const int u_Rank = 2;
  PyArrayObject *capi_u_tmp = NULL;
  int capi_u_intent = 0;
  PyObject *u_capi = Py_None;
  int ldu = 0;
  PyObject *ldu_capi = Py_None;
  string note = NULL;
  int slen(note);
  PyObject *note_capi = Py_None;
  double *dwork = NULL;
  npy_intp dwork_Dims[1] = {-1};
  const int dwork_Rank = 1;
  PyArrayObject *capi_dwork_tmp = NULL;
  int capi_dwork_intent = 0;
  PyObject *dwork_capi = Py_None;
  int ldwork = 0;
  PyObject *ldwork_capi = Py_None;
  int info = 0;
  PyObject *info_capi = Py_None;
  static char *capi_kwlist[] = {"def","nr","dpar","ipar","vec","n","m","e","a","y","b","x","u","dwork","lde","lda","ldy","ldb","ldx","ldu","note","ldwork","info","overwrite_e","overwrite_a","overwrite_y","overwrite_x",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOOOOOO|OOOOOOOOOiiii:benchmarks.bb03ad",\
    capi_kwlist,&def_capi,&nr_capi,&dpar_capi,&ipar_capi,&vec_capi,&n_capi,&m_capi,&e_capi,&a_capi,&y_capi,&b_capi,&x_capi,&u_capi,&dwork_capi,&lde_capi,&lda_capi,&ldy_capi,&ldb_capi,&ldx_capi,&ldu_capi,&note_capi,&ldwork_capi,&info_capi,&capi_overwrite_e,&capi_overwrite_a,&capi_overwrite_y,&capi_overwrite_x))
    return NULL;
/*frompyobj*/
  /* Processing variable ipar */
  ;
  capi_ipar_intent |= F2PY_INTENT_IN;
  capi_ipar_tmp = array_from_pyobj(NPY_INT,ipar_Dims,ipar_Rank,capi_ipar_intent,ipar_capi);
  if (capi_ipar_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 4th argument `ipar' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    ipar = (int *)(PyArray_DATA(capi_ipar_tmp));

  /* Processing variable a */
  capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
  ;
  capi_a_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
  if (capi_a_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 9th argument `a' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    a = (double *)(PyArray_DATA(capi_a_tmp));

  /* Processing variable info */
  if (info_capi != Py_None)
    f2py_success = int_from_pyobj(&info,info_capi,"benchmarks.bb03ad() 9th keyword (info) can't be converted to int");
  if (f2py_success) {
  /* Processing variable b */
  ;
  capi_b_intent |= F2PY_INTENT_IN;
  capi_b_tmp = array_from_pyobj(NPY_DOUBLE,b_Dims,b_Rank,capi_b_intent,b_capi);
  if (capi_b_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 11st argument `b' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    b = (double *)(PyArray_DATA(capi_b_tmp));

  /* Processing variable e */
  capi_e_intent |= (capi_overwrite_e?0:F2PY_INTENT_COPY);
  ;
  capi_e_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_e_tmp = array_from_pyobj(NPY_DOUBLE,e_Dims,e_Rank,capi_e_intent,e_capi);
  if (capi_e_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 8th argument `e' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    e = (double *)(PyArray_DATA(capi_e_tmp));

  /* Processing variable dpar */
  ;
  capi_dpar_intent |= F2PY_INTENT_IN;
  capi_dpar_tmp = array_from_pyobj(NPY_DOUBLE,dpar_Dims,dpar_Rank,capi_dpar_intent,dpar_capi);
  if (capi_dpar_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 3rd argument `dpar' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    dpar = (double *)(PyArray_DATA(capi_dpar_tmp));

  /* Processing variable m */
    f2py_success = int_from_pyobj(&m,m_capi,"benchmarks.bb03ad() 7th argument (m) can't be converted to int");
  if (f2py_success) {
  /* Processing variable n */
    f2py_success = int_from_pyobj(&n,n_capi,"benchmarks.bb03ad() 6th argument (n) can't be converted to int");
  if (f2py_success) {
  /* Processing variable note */
  slen(note) = 70;
  f2py_success = string_from_pyobj(&note,&slen(note),"",note_capi,"string_from_pyobj failed in converting 7th keyword `note' of benchmarks.bb03ad to C string");
  if (f2py_success) {
  /* Processing variable u */
  ;
  capi_u_intent |= F2PY_INTENT_IN;
  capi_u_tmp = array_from_pyobj(NPY_DOUBLE,u_Dims,u_Rank,capi_u_intent,u_capi);
  if (capi_u_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 13rd argument `u' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    u = (double *)(PyArray_DATA(capi_u_tmp));

  /* Processing variable vec */
  vec_Dims[0]=8;
  capi_vec_intent |= F2PY_INTENT_IN;
  capi_vec_tmp = array_from_pyobj(NPY_INT,vec_Dims,vec_Rank,capi_vec_intent,vec_capi);
  if (capi_vec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 5th argument `vec' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    vec = (int *)(PyArray_DATA(capi_vec_tmp));

  /* Processing variable dwork */
  ;
  capi_dwork_intent |= F2PY_INTENT_IN;
  capi_dwork_tmp = array_from_pyobj(NPY_DOUBLE,dwork_Dims,dwork_Rank,capi_dwork_intent,dwork_capi);
  if (capi_dwork_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 14th argument `dwork' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    dwork = (double *)(PyArray_DATA(capi_dwork_tmp));

  /* Processing variable y */
  capi_y_intent |= (capi_overwrite_y?0:F2PY_INTENT_COPY);
  ;
  capi_y_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_DOUBLE,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 10th argument `y' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    y = (double *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable x */
  capi_x_intent |= (capi_overwrite_x?0:F2PY_INTENT_COPY);
  ;
  capi_x_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_DOUBLE,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 12nd argument `x' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    x = (double *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable nr */
  ;
  capi_nr_intent |= F2PY_INTENT_IN;
  capi_nr_tmp = array_from_pyobj(NPY_INT,nr_Dims,nr_Rank,capi_nr_intent,nr_capi);
  if (capi_nr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 2nd argument `nr' of benchmarks.bb03ad to C/Fortran array" );
  } else {
    nr = (int *)(PyArray_DATA(capi_nr_tmp));

  /* Processing variable def */
  slen(def) = 1;
  f2py_success = string_from_pyobj(&def,&slen(def),"",def_capi,"string_from_pyobj failed in converting 1st argument `def' of benchmarks.bb03ad to C string");
  if (f2py_success) {
  /* Processing variable ldb */
  if (ldb_capi == Py_None) ldb = shape(b,0); else
    f2py_success = int_from_pyobj(&ldb,ldb_capi,"benchmarks.bb03ad() 4th keyword (ldb) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(b,0)==ldb,"shape(b,0)==ldb","4th keyword ldb","bb03ad:ldb=%d",ldb) {
  /* Processing variable lda */
  if (lda_capi == Py_None) lda = shape(a,0); else
    f2py_success = int_from_pyobj(&lda,lda_capi,"benchmarks.bb03ad() 2nd keyword (lda) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(a,0)==lda,"shape(a,0)==lda","2nd keyword lda","bb03ad:lda=%d",lda) {
  /* Processing variable lde */
  if (lde_capi == Py_None) lde = shape(e,0); else
    f2py_success = int_from_pyobj(&lde,lde_capi,"benchmarks.bb03ad() 1st keyword (lde) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(e,0)==lde,"shape(e,0)==lde","1st keyword lde","bb03ad:lde=%d",lde) {
  /* Processing variable ldwork */
  if (ldwork_capi == Py_None) ldwork = len(dwork); else
    f2py_success = int_from_pyobj(&ldwork,ldwork_capi,"benchmarks.bb03ad() 8th keyword (ldwork) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(len(dwork)>=ldwork,"len(dwork)>=ldwork","8th keyword ldwork","bb03ad:ldwork=%d",ldwork) {
  /* Processing variable ldu */
  if (ldu_capi == Py_None) ldu = shape(u,0); else
    f2py_success = int_from_pyobj(&ldu,ldu_capi,"benchmarks.bb03ad() 6th keyword (ldu) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(u,0)==ldu,"shape(u,0)==ldu","6th keyword ldu","bb03ad:ldu=%d",ldu) {
  /* Processing variable ldy */
  if (ldy_capi == Py_None) ldy = shape(y,0); else
    f2py_success = int_from_pyobj(&ldy,ldy_capi,"benchmarks.bb03ad() 3rd keyword (ldy) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(y,0)==ldy,"shape(y,0)==ldy","3rd keyword ldy","bb03ad:ldy=%d",ldy) {
  /* Processing variable ldx */
  if (ldx_capi == Py_None) ldx = shape(x,0); else
    f2py_success = int_from_pyobj(&ldx,ldx_capi,"benchmarks.bb03ad() 5th keyword (ldx) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(x,0)==ldx,"shape(x,0)==ldx","5th keyword ldx","bb03ad:ldx=%d",ldx) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(def,nr,dpar,ipar,vec,&n,&m,e,&lde,a,&lda,y,&ldy,b,&ldb,x,&ldx,u,&ldu,note,dwork,&ldwork,&info,slen(def),slen(note));
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NNNN",capi_e_tmp,capi_a_tmp,capi_y_tmp,capi_x_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  } /*CHECKSCALAR(shape(x,0)==ldx)*/
  } /*if (f2py_success) of ldx*/
  /* End of cleaning variable ldx */
  } /*CHECKSCALAR(shape(y,0)==ldy)*/
  } /*if (f2py_success) of ldy*/
  /* End of cleaning variable ldy */
  } /*CHECKSCALAR(shape(u,0)==ldu)*/
  } /*if (f2py_success) of ldu*/
  /* End of cleaning variable ldu */
  } /*CHECKSCALAR(len(dwork)>=ldwork)*/
  } /*if (f2py_success) of ldwork*/
  /* End of cleaning variable ldwork */
  } /*CHECKSCALAR(shape(e,0)==lde)*/
  } /*if (f2py_success) of lde*/
  /* End of cleaning variable lde */
  } /*CHECKSCALAR(shape(a,0)==lda)*/
  } /*if (f2py_success) of lda*/
  /* End of cleaning variable lda */
  } /*CHECKSCALAR(shape(b,0)==ldb)*/
  } /*if (f2py_success) of ldb*/
  /* End of cleaning variable ldb */
    STRINGFREE(def);
  }  /*if (f2py_success) of def*/
  /* End of cleaning variable def */
  if((PyObject *)capi_nr_tmp!=nr_capi) {
    Py_XDECREF(capi_nr_tmp); }
  }  /*if (capi_nr_tmp == NULL) ... else of nr*/
  /* End of cleaning variable nr */
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
  }  /*if (capi_y_tmp == NULL) ... else of y*/
  /* End of cleaning variable y */
  if((PyObject *)capi_dwork_tmp!=dwork_capi) {
    Py_XDECREF(capi_dwork_tmp); }
  }  /*if (capi_dwork_tmp == NULL) ... else of dwork*/
  /* End of cleaning variable dwork */
  if((PyObject *)capi_vec_tmp!=vec_capi) {
    Py_XDECREF(capi_vec_tmp); }
  }  /*if (capi_vec_tmp == NULL) ... else of vec*/
  /* End of cleaning variable vec */
  if((PyObject *)capi_u_tmp!=u_capi) {
    Py_XDECREF(capi_u_tmp); }
  }  /*if (capi_u_tmp == NULL) ... else of u*/
  /* End of cleaning variable u */
    STRINGFREE(note);
  }  /*if (f2py_success) of note*/
  /* End of cleaning variable note */
  } /*if (f2py_success) of n*/
  /* End of cleaning variable n */
  } /*if (f2py_success) of m*/
  /* End of cleaning variable m */
  if((PyObject *)capi_dpar_tmp!=dpar_capi) {
    Py_XDECREF(capi_dpar_tmp); }
  }  /*if (capi_dpar_tmp == NULL) ... else of dpar*/
  /* End of cleaning variable dpar */
  }  /*if (capi_e_tmp == NULL) ... else of e*/
  /* End of cleaning variable e */
  if((PyObject *)capi_b_tmp!=b_capi) {
    Py_XDECREF(capi_b_tmp); }
  }  /*if (capi_b_tmp == NULL) ... else of b*/
  /* End of cleaning variable b */
  } /*if (f2py_success) of info*/
  /* End of cleaning variable info */
  }  /*if (capi_a_tmp == NULL) ... else of a*/
  /* End of cleaning variable a */
  if((PyObject *)capi_ipar_tmp!=ipar_capi) {
    Py_XDECREF(capi_ipar_tmp); }
  }  /*if (capi_ipar_tmp == NULL) ... else of ipar*/
  /* End of cleaning variable ipar */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/******************************* end of bb03ad *******************************/

/*********************************** bb04ad ***********************************/
static char doc_f2py_rout_benchmarks_bb04ad[] = "\
e,a,y,x = bb04ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,[lde,lda,ldy,ldb,ldx,ldu,note,ldwork,info,overwrite_e,overwrite_a,overwrite_y,overwrite_x])\n\nWrapper for ``bb04ad``.\
\n\nParameters\n----------\n"
"def : input string(len=1)\n"
"nr : input rank-1 array('i') with bounds (*)\n"
"dpar : input rank-1 array('d') with bounds (*)\n"
"ipar : input rank-1 array('i') with bounds (*)\n"
"vec : input rank-1 array('i') with bounds (8)\n"
"n : input int\n"
"m : input int\n"
"e : input rank-2 array('d') with bounds (lde,*)\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"y : input rank-2 array('d') with bounds (ldy,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"x : input rank-2 array('d') with bounds (ldx,*)\n"
"u : input rank-2 array('d') with bounds (ldu,*)\n"
"dwork : input rank-1 array('d') with bounds (ldwork)\n"
"\nOther Parameters\n----------------\n"
"overwrite_e : input int, optional\n    Default: 0\n"
"lde : input int, optional\n    Default: shape(e,0)\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a,0)\n"
"overwrite_y : input int, optional\n    Default: 0\n"
"ldy : input int, optional\n    Default: shape(y,0)\n"
"ldb : input int, optional\n    Default: shape(b,0)\n"
"overwrite_x : input int, optional\n    Default: 0\n"
"ldx : input int, optional\n    Default: shape(x,0)\n"
"ldu : input int, optional\n    Default: shape(u,0)\n"
"note : input string(len=70)\n"
"ldwork : input int, optional\n    Default: len(dwork)\n"
"info : input int\n"
"\nReturns\n-------\n"
"e : rank-2 array('d') with bounds (lde,*)\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"y : rank-2 array('d') with bounds (ldy,*)\n"
"x : rank-2 array('d') with bounds (ldx,*)";
/* extern void F_FUNC(bb04ad,BB04AD)(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_benchmarks_bb04ad(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,int*,double*,int*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,double*,int*,string,double*,int*,int*,size_t,size_t)) {
  PyObject * volatile capi_buildvalue = NULL;
  volatile int f2py_success = 1;
/*decl*/

  string def = NULL;
  int slen(def);
  PyObject *def_capi = Py_None;
  int *nr = NULL;
  npy_intp nr_Dims[1] = {-1};
  const int nr_Rank = 1;
  PyArrayObject *capi_nr_tmp = NULL;
  int capi_nr_intent = 0;
  PyObject *nr_capi = Py_None;
  double *dpar = NULL;
  npy_intp dpar_Dims[1] = {-1};
  const int dpar_Rank = 1;
  PyArrayObject *capi_dpar_tmp = NULL;
  int capi_dpar_intent = 0;
  PyObject *dpar_capi = Py_None;
  int *ipar = NULL;
  npy_intp ipar_Dims[1] = {-1};
  const int ipar_Rank = 1;
  PyArrayObject *capi_ipar_tmp = NULL;
  int capi_ipar_intent = 0;
  PyObject *ipar_capi = Py_None;
  int *vec = NULL;
  npy_intp vec_Dims[1] = {-1};
  const int vec_Rank = 1;
  PyArrayObject *capi_vec_tmp = NULL;
  int capi_vec_intent = 0;
  PyObject *vec_capi = Py_None;
  int n = 0;
  PyObject *n_capi = Py_None;
  int m = 0;
  PyObject *m_capi = Py_None;
  double *e = NULL;
  npy_intp e_Dims[2] = {-1, -1};
  const int e_Rank = 2;
  PyArrayObject *capi_e_tmp = NULL;
  int capi_e_intent = 0;
  int capi_overwrite_e = 0;
  PyObject *e_capi = Py_None;
  int lde = 0;
  PyObject *lde_capi = Py_None;
  double *a = NULL;
  npy_intp a_Dims[2] = {-1, -1};
  const int a_Rank = 2;
  PyArrayObject *capi_a_tmp = NULL;
  int capi_a_intent = 0;
  int capi_overwrite_a = 0;
  PyObject *a_capi = Py_None;
  int lda = 0;
  PyObject *lda_capi = Py_None;
  double *y = NULL;
  npy_intp y_Dims[2] = {-1, -1};
  const int y_Rank = 2;
  PyArrayObject *capi_y_tmp = NULL;
  int capi_y_intent = 0;
  int capi_overwrite_y = 0;
  PyObject *y_capi = Py_None;
  int ldy = 0;
  PyObject *ldy_capi = Py_None;
  double *b = NULL;
  npy_intp b_Dims[2] = {-1, -1};
  const int b_Rank = 2;
  PyArrayObject *capi_b_tmp = NULL;
  int capi_b_intent = 0;
  PyObject *b_capi = Py_None;
  int ldb = 0;
  PyObject *ldb_capi = Py_None;
  double *x = NULL;
  npy_intp x_Dims[2] = {-1, -1};
  const int x_Rank = 2;
  PyArrayObject *capi_x_tmp = NULL;
  int capi_x_intent = 0;
  int capi_overwrite_x = 0;
  PyObject *x_capi = Py_None;
  int ldx = 0;
  PyObject *ldx_capi = Py_None;
  double *u = NULL;
  npy_intp u_Dims[2] = {-1, -1};
  const int u_Rank = 2;
  PyArrayObject *capi_u_tmp = NULL;
  int capi_u_intent = 0;
  PyObject *u_capi = Py_None;
  int ldu = 0;
  PyObject *ldu_capi = Py_None;
  string note = NULL;
  int slen(note);
  PyObject *note_capi = Py_None;
  double *dwork = NULL;
  npy_intp dwork_Dims[1] = {-1};
  const int dwork_Rank = 1;
  PyArrayObject *capi_dwork_tmp = NULL;
  int capi_dwork_intent = 0;
  PyObject *dwork_capi = Py_None;
  int ldwork = 0;
  PyObject *ldwork_capi = Py_None;
  int info = 0;
  PyObject *info_capi = Py_None;
  static char *capi_kwlist[] = {"def","nr","dpar","ipar","vec","n","m","e","a","y","b","x","u","dwork","lde","lda","ldy","ldb","ldx","ldu","note","ldwork","info","overwrite_e","overwrite_a","overwrite_y","overwrite_x",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
  if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
    "OOOOOOOOOOOOOO|OOOOOOOOOiiii:benchmarks.bb04ad",\
    capi_kwlist,&def_capi,&nr_capi,&dpar_capi,&ipar_capi,&vec_capi,&n_capi,&m_capi,&e_capi,&a_capi,&y_capi,&b_capi,&x_capi,&u_capi,&dwork_capi,&lde_capi,&lda_capi,&ldy_capi,&ldb_capi,&ldx_capi,&ldu_capi,&note_capi,&ldwork_capi,&info_capi,&capi_overwrite_e,&capi_overwrite_a,&capi_overwrite_y,&capi_overwrite_x))
    return NULL;
/*frompyobj*/
  /* Processing variable ipar */
  ;
  capi_ipar_intent |= F2PY_INTENT_IN;
  capi_ipar_tmp = array_from_pyobj(NPY_INT,ipar_Dims,ipar_Rank,capi_ipar_intent,ipar_capi);
  if (capi_ipar_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 4th argument `ipar' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    ipar = (int *)(PyArray_DATA(capi_ipar_tmp));

  /* Processing variable a */
  capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
  ;
  capi_a_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
  if (capi_a_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 9th argument `a' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    a = (double *)(PyArray_DATA(capi_a_tmp));

  /* Processing variable info */
  if (info_capi != Py_None)
    f2py_success = int_from_pyobj(&info,info_capi,"benchmarks.bb04ad() 9th keyword (info) can't be converted to int");
  if (f2py_success) {
  /* Processing variable b */
  ;
  capi_b_intent |= F2PY_INTENT_IN;
  capi_b_tmp = array_from_pyobj(NPY_DOUBLE,b_Dims,b_Rank,capi_b_intent,b_capi);
  if (capi_b_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 11st argument `b' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    b = (double *)(PyArray_DATA(capi_b_tmp));

  /* Processing variable e */
  capi_e_intent |= (capi_overwrite_e?0:F2PY_INTENT_COPY);
  ;
  capi_e_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_e_tmp = array_from_pyobj(NPY_DOUBLE,e_Dims,e_Rank,capi_e_intent,e_capi);
  if (capi_e_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 8th argument `e' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    e = (double *)(PyArray_DATA(capi_e_tmp));

  /* Processing variable dpar */
  ;
  capi_dpar_intent |= F2PY_INTENT_IN;
  capi_dpar_tmp = array_from_pyobj(NPY_DOUBLE,dpar_Dims,dpar_Rank,capi_dpar_intent,dpar_capi);
  if (capi_dpar_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 3rd argument `dpar' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    dpar = (double *)(PyArray_DATA(capi_dpar_tmp));

  /* Processing variable m */
    f2py_success = int_from_pyobj(&m,m_capi,"benchmarks.bb04ad() 7th argument (m) can't be converted to int");
  if (f2py_success) {
  /* Processing variable n */
    f2py_success = int_from_pyobj(&n,n_capi,"benchmarks.bb04ad() 6th argument (n) can't be converted to int");
  if (f2py_success) {
  /* Processing variable note */
  slen(note) = 70;
  f2py_success = string_from_pyobj(&note,&slen(note),"",note_capi,"string_from_pyobj failed in converting 7th keyword `note' of benchmarks.bb04ad to C string");
  if (f2py_success) {
  /* Processing variable u */
  ;
  capi_u_intent |= F2PY_INTENT_IN;
  capi_u_tmp = array_from_pyobj(NPY_DOUBLE,u_Dims,u_Rank,capi_u_intent,u_capi);
  if (capi_u_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 13rd argument `u' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    u = (double *)(PyArray_DATA(capi_u_tmp));

  /* Processing variable vec */
  vec_Dims[0]=8;
  capi_vec_intent |= F2PY_INTENT_IN;
  capi_vec_tmp = array_from_pyobj(NPY_INT,vec_Dims,vec_Rank,capi_vec_intent,vec_capi);
  if (capi_vec_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 5th argument `vec' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    vec = (int *)(PyArray_DATA(capi_vec_tmp));

  /* Processing variable dwork */
  ;
  capi_dwork_intent |= F2PY_INTENT_IN;
  capi_dwork_tmp = array_from_pyobj(NPY_DOUBLE,dwork_Dims,dwork_Rank,capi_dwork_intent,dwork_capi);
  if (capi_dwork_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 14th argument `dwork' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    dwork = (double *)(PyArray_DATA(capi_dwork_tmp));

  /* Processing variable y */
  capi_y_intent |= (capi_overwrite_y?0:F2PY_INTENT_COPY);
  ;
  capi_y_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_y_tmp = array_from_pyobj(NPY_DOUBLE,y_Dims,y_Rank,capi_y_intent,y_capi);
  if (capi_y_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 10th argument `y' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    y = (double *)(PyArray_DATA(capi_y_tmp));

  /* Processing variable x */
  capi_x_intent |= (capi_overwrite_x?0:F2PY_INTENT_COPY);
  ;
  capi_x_intent |= F2PY_INTENT_OUT|F2PY_INTENT_IN;
  capi_x_tmp = array_from_pyobj(NPY_DOUBLE,x_Dims,x_Rank,capi_x_intent,x_capi);
  if (capi_x_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 12nd argument `x' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    x = (double *)(PyArray_DATA(capi_x_tmp));

  /* Processing variable nr */
  ;
  capi_nr_intent |= F2PY_INTENT_IN;
  capi_nr_tmp = array_from_pyobj(NPY_INT,nr_Dims,nr_Rank,capi_nr_intent,nr_capi);
  if (capi_nr_tmp == NULL) {
    if (!PyErr_Occurred())
      PyErr_SetString(benchmarks_error,"failed in converting 2nd argument `nr' of benchmarks.bb04ad to C/Fortran array" );
  } else {
    nr = (int *)(PyArray_DATA(capi_nr_tmp));

  /* Processing variable def */
  slen(def) = 1;
  f2py_success = string_from_pyobj(&def,&slen(def),"",def_capi,"string_from_pyobj failed in converting 1st argument `def' of benchmarks.bb04ad to C string");
  if (f2py_success) {
  /* Processing variable ldb */
  if (ldb_capi == Py_None) ldb = shape(b,0); else
    f2py_success = int_from_pyobj(&ldb,ldb_capi,"benchmarks.bb04ad() 4th keyword (ldb) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(b,0)==ldb,"shape(b,0)==ldb","4th keyword ldb","bb04ad:ldb=%d",ldb) {
  /* Processing variable lda */
  if (lda_capi == Py_None) lda = shape(a,0); else
    f2py_success = int_from_pyobj(&lda,lda_capi,"benchmarks.bb04ad() 2nd keyword (lda) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(a,0)==lda,"shape(a,0)==lda","2nd keyword lda","bb04ad:lda=%d",lda) {
  /* Processing variable lde */
  if (lde_capi == Py_None) lde = shape(e,0); else
    f2py_success = int_from_pyobj(&lde,lde_capi,"benchmarks.bb04ad() 1st keyword (lde) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(e,0)==lde,"shape(e,0)==lde","1st keyword lde","bb04ad:lde=%d",lde) {
  /* Processing variable ldwork */
  if (ldwork_capi == Py_None) ldwork = len(dwork); else
    f2py_success = int_from_pyobj(&ldwork,ldwork_capi,"benchmarks.bb04ad() 8th keyword (ldwork) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(len(dwork)>=ldwork,"len(dwork)>=ldwork","8th keyword ldwork","bb04ad:ldwork=%d",ldwork) {
  /* Processing variable ldu */
  if (ldu_capi == Py_None) ldu = shape(u,0); else
    f2py_success = int_from_pyobj(&ldu,ldu_capi,"benchmarks.bb04ad() 6th keyword (ldu) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(u,0)==ldu,"shape(u,0)==ldu","6th keyword ldu","bb04ad:ldu=%d",ldu) {
  /* Processing variable ldy */
  if (ldy_capi == Py_None) ldy = shape(y,0); else
    f2py_success = int_from_pyobj(&ldy,ldy_capi,"benchmarks.bb04ad() 3rd keyword (ldy) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(y,0)==ldy,"shape(y,0)==ldy","3rd keyword ldy","bb04ad:ldy=%d",ldy) {
  /* Processing variable ldx */
  if (ldx_capi == Py_None) ldx = shape(x,0); else
    f2py_success = int_from_pyobj(&ldx,ldx_capi,"benchmarks.bb04ad() 5th keyword (ldx) can't be converted to int");
  if (f2py_success) {
  CHECKSCALAR(shape(x,0)==ldx,"shape(x,0)==ldx","5th keyword ldx","bb04ad:ldx=%d",ldx) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
        (*f2py_func)(def,nr,dpar,ipar,vec,&n,&m,e,&lde,a,&lda,y,&ldy,b,&ldb,x,&ldx,u,&ldu,note,dwork,&ldwork,&info,slen(def),slen(note));
if (PyErr_Occurred())
  f2py_success = 0;
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_call_clock();
#endif
/*end of callfortranroutine*/
    if (f2py_success) {
/*pyobjfrom*/
/*end of pyobjfrom*/
    CFUNCSMESS("Building return value.\n");
    capi_buildvalue = Py_BuildValue("NNNN",capi_e_tmp,capi_a_tmp,capi_y_tmp,capi_x_tmp);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
    } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
  } /*CHECKSCALAR(shape(x,0)==ldx)*/
  } /*if (f2py_success) of ldx*/
  /* End of cleaning variable ldx */
  } /*CHECKSCALAR(shape(y,0)==ldy)*/
  } /*if (f2py_success) of ldy*/
  /* End of cleaning variable ldy */
  } /*CHECKSCALAR(shape(u,0)==ldu)*/
  } /*if (f2py_success) of ldu*/
  /* End of cleaning variable ldu */
  } /*CHECKSCALAR(len(dwork)>=ldwork)*/
  } /*if (f2py_success) of ldwork*/
  /* End of cleaning variable ldwork */
  } /*CHECKSCALAR(shape(e,0)==lde)*/
  } /*if (f2py_success) of lde*/
  /* End of cleaning variable lde */
  } /*CHECKSCALAR(shape(a,0)==lda)*/
  } /*if (f2py_success) of lda*/
  /* End of cleaning variable lda */
  } /*CHECKSCALAR(shape(b,0)==ldb)*/
  } /*if (f2py_success) of ldb*/
  /* End of cleaning variable ldb */
    STRINGFREE(def);
  }  /*if (f2py_success) of def*/
  /* End of cleaning variable def */
  if((PyObject *)capi_nr_tmp!=nr_capi) {
    Py_XDECREF(capi_nr_tmp); }
  }  /*if (capi_nr_tmp == NULL) ... else of nr*/
  /* End of cleaning variable nr */
  }  /*if (capi_x_tmp == NULL) ... else of x*/
  /* End of cleaning variable x */
  }  /*if (capi_y_tmp == NULL) ... else of y*/
  /* End of cleaning variable y */
  if((PyObject *)capi_dwork_tmp!=dwork_capi) {
    Py_XDECREF(capi_dwork_tmp); }
  }  /*if (capi_dwork_tmp == NULL) ... else of dwork*/
  /* End of cleaning variable dwork */
  if((PyObject *)capi_vec_tmp!=vec_capi) {
    Py_XDECREF(capi_vec_tmp); }
  }  /*if (capi_vec_tmp == NULL) ... else of vec*/
  /* End of cleaning variable vec */
  if((PyObject *)capi_u_tmp!=u_capi) {
    Py_XDECREF(capi_u_tmp); }
  }  /*if (capi_u_tmp == NULL) ... else of u*/
  /* End of cleaning variable u */
    STRINGFREE(note);
  }  /*if (f2py_success) of note*/
  /* End of cleaning variable note */
  } /*if (f2py_success) of n*/
  /* End of cleaning variable n */
  } /*if (f2py_success) of m*/
  /* End of cleaning variable m */
  if((PyObject *)capi_dpar_tmp!=dpar_capi) {
    Py_XDECREF(capi_dpar_tmp); }
  }  /*if (capi_dpar_tmp == NULL) ... else of dpar*/
  /* End of cleaning variable dpar */
  }  /*if (capi_e_tmp == NULL) ... else of e*/
  /* End of cleaning variable e */
  if((PyObject *)capi_b_tmp!=b_capi) {
    Py_XDECREF(capi_b_tmp); }
  }  /*if (capi_b_tmp == NULL) ... else of b*/
  /* End of cleaning variable b */
  } /*if (f2py_success) of info*/
  /* End of cleaning variable info */
  }  /*if (capi_a_tmp == NULL) ... else of a*/
  /* End of cleaning variable a */
  if((PyObject *)capi_ipar_tmp!=ipar_capi) {
    Py_XDECREF(capi_ipar_tmp); }
  }  /*if (capi_ipar_tmp == NULL) ... else of ipar*/
  /* End of cleaning variable ipar */
/*end of cleanupfrompyobj*/
  if (capi_buildvalue == NULL) {
/*routdebugfailure*/
  } else {
/*routdebugleave*/
  }
  CFUNCSMESS("Freeing memory.\n");
/*freemem*/
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
  return capi_buildvalue;
}
/******************************* end of bb04ad *******************************/
/*eof body*/

/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
/*need_f90modhooks*/

/************** See f2py2e/rules.py: module_rules['modulebody'] **************/

/******************* See f2py2e/common_rules.py: buildhooks *******************/

/*need_commonhooks*/

/**************************** See f2py2e/rules.py ****************************/

static FortranDataDef f2py_routine_defs[] = {
  {"bb03ad",-1,{{-1}},0,0, (char *) bb03ad_,(f2py_init_func)f2py_rout_benchmarks_bb03ad,doc_f2py_rout_benchmarks_bb03ad},
  {"bb04ad",-1,{{-1}},0,0, (char *) bb04ad_,(f2py_init_func)f2py_rout_benchmarks_bb04ad,doc_f2py_rout_benchmarks_bb04ad},

/*eof routine_defs*/
  {NULL}
};

static PyMethodDef f2py_module_methods[] = {

  {NULL,NULL}
};

#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef moduledef = {
  PyModuleDef_HEAD_INIT,
  "benchmarks",
  NULL,
  -1,
  f2py_module_methods,
  NULL,
  NULL,
  NULL,
  NULL
};
#endif

#if PY_VERSION_HEX >= 0x03000000
#define RETVAL m
PyMODINIT_FUNC PyInit_benchmarks(void) {
#else
#define RETVAL
PyMODINIT_FUNC initbenchmarks(void) {
#endif
  int i;
  PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
  m = benchmarks_module = PyModule_Create(&moduledef);
#else
  m = benchmarks_module = Py_InitModule("benchmarks", f2py_module_methods);
#endif
  Py_TYPE(&PyFortran_Type) = &PyType_Type;
  import_array();
  if (PyErr_Occurred())
    {PyErr_SetString(PyExc_ImportError, "can't initialize module benchmarks (failed to import numpy)"); return RETVAL;}
  d = PyModule_GetDict(m);
  s = PyString_FromString("$Revision: $");
  PyDict_SetItemString(d, "__version__", s);
#if PY_VERSION_HEX >= 0x03000000
  s = PyUnicode_FromString(
#else
  s = PyString_FromString(
#endif
    "This module 'benchmarks' is auto-generated with f2py (version:2).\nFunctions:\n"
"  e,a,y,x = bb03ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,lde=shape(e,0),lda=shape(a,0),ldy=shape(y,0),ldb=shape(b,0),ldx=shape(x,0),ldu=shape(u,0),note='',ldwork=len(dwork),info=,overwrite_e=0,overwrite_a=0,overwrite_y=0,overwrite_x=0)\n"
"  e,a,y,x = bb04ad(def,nr,dpar,ipar,vec,n,m,e,a,y,b,x,u,dwork,lde=shape(e,0),lda=shape(a,0),ldy=shape(y,0),ldb=shape(b,0),ldx=shape(x,0),ldu=shape(u,0),note='',ldwork=len(dwork),info=,overwrite_e=0,overwrite_a=0,overwrite_y=0,overwrite_x=0)\n"
".");
  PyDict_SetItemString(d, "__doc__", s);
  benchmarks_error = PyErr_NewException ("benchmarks.error", NULL, NULL);
  Py_DECREF(s);
  for(i=0;f2py_routine_defs[i].name!=NULL;i++)
    PyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));


/*eof initf2pywraphooks*/
/*eof initf90modhooks*/

/*eof initcommonhooks*/


#ifdef F2PY_REPORT_ATEXIT
  if (! PyErr_Occurred())
    on_exit(f2py_report_on_exit,(void*)"benchmarks");
#endif

  return RETVAL;
}
#ifdef __cplusplus
}
#endif
