/* File: lapackmodule.c
 * This file is auto-generated with f2py (version:1.23.2).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: Fri Nov  7 10:34:14 2025
 * Do not edit this file directly unless you know what you are doing!!!
 */

#ifdef __cplusplus
extern "C" {
#endif

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */

/* Unconditionally included */
#include <Python.h>
#include <numpy/npy_os.h>

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

/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
static PyObject *lapack_error;
static PyObject *lapack_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(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)

/*
STRINGPADN replaces null values with padding values from the right.

`to` must have size of at least N bytes.

If the `to[N-1]` has null value, then replace it and all the
preceding, nulls with the given padding.

STRINGPADN(to, N, PADDING, NULLVALUE) is an inverse operation.
*/
#define STRINGPADN(to, N, NULLVALUE, PADDING)                   \
    do {                                                        \
        int _m = (N);                                           \
        char *_to = (to);                                       \
        for (_m -= 1; _m >= 0 && _to[_m] == NULLVALUE; _m--) {  \
             _to[_m] = PADDING;                                 \
        }                                                       \
    } 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(lapack_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

/*
STRINGCOPYN copies N bytes.

`to` and `from` buffers must have sizes of at least N bytes.
*/
#define STRINGCOPYN(to,from,N)                                  \
    do {                                                        \
        int _m = (N);                                           \
        char *_to = (to);                                       \
        char *_from = (from);                                   \
        FAILNULL(_to); FAILNULL(_from);                         \
        (void)strncpy(_to, _from, _m);             \
    } while (0)


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
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;
}

/*
  Create a new string buffer `str` of at most length `len` from a
  Python string-like object `obj`.

  The string buffer has given size (len) or the size of inistr when len==-1.

  The string buffer is padded with blanks: in Fortran, trailing blanks
  are insignificant contrary to C nulls.
 */
static int
string_from_pyobj(string *str, int *len, const string inistr, PyObject *obj,
                  const char *errmess)
{
    PyObject *tmp = NULL;
    string buf = NULL;
    npy_intp n = -1;
#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) {
        n = strlen(inistr);
        buf = inistr;
    }
    else if (PyArray_Check(obj)) {
        PyArrayObject *arr = (PyArrayObject *)obj;
        if (!ISCONTIGUOUS(arr)) {
            PyErr_SetString(PyExc_ValueError,
                            "array object is non-contiguous.");
            goto capi_fail;
        }
        n = PyArray_NBYTES(arr);
        buf = PyArray_DATA(arr);
        n = strnlen(buf, n);
    }
    else {
        if (PyBytes_Check(obj)) {
            tmp = obj;
            Py_INCREF(tmp);
        }
        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;
            }
        }
        if (tmp == NULL) goto capi_fail;
        n = PyBytes_GET_SIZE(tmp);
        buf = PyBytes_AS_STRING(tmp);
    }
    if (*len == -1) {
        /* TODO: change the type of `len` so that we can remove this */
        if (n > NPY_MAX_INT) {
            PyErr_SetString(PyExc_OverflowError,
                            "object too large for a 32-bit int");
            goto capi_fail;
        }
        *len = n;
    }
    else if (*len < n) {
        /* discard the last (len-n) bytes of input buf */
        n = *len;
    }
    if (n < 0 || *len < 0 || buf == NULL) {
        goto capi_fail;
    }
    STRINGMALLOC(*str, *len);  // *str is allocated with size (*len + 1)
    if (n < *len) {
        /*
          Pad fixed-width string with nulls. The caller will replace
          nulls with blanks when the corresponding argument is not
          intent(c).
        */
        memset(*str + n, '\0', *len - n);
    }
    STRINGCOPYN(*str, buf, n);
    Py_XDECREF(tmp);
    return 1;
capi_fail:
    Py_XDECREF(tmp);
    {
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = lapack_error;
        }
        PyErr_SetString(err, errmess);
    }
    return 0;
}

static int
int_from_pyobj(int* v, PyObject *obj, const char *errmess)
{
    PyObject* tmp = NULL;

    if (PyLong_Check(obj)) {
        *v = Npy__PyLong_AsInt(obj);
        return !(*v == -1 && PyErr_Occurred());
    }

    tmp = PyNumber_Long(obj);
    if (tmp) {
        *v = Npy__PyLong_AsInt(tmp);
        Py_DECREF(tmp);
        return !(*v == -1 && PyErr_Occurred());
    }

    if (PyComplex_Check(obj)) {
        PyErr_Clear();
        tmp = PyObject_GetAttrString(obj,"real");
    }
    else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) {
        /*pass*/;
    }
    else if (PySequence_Check(obj)) {
        PyErr_Clear();
        tmp = PySequence_GetItem(obj, 0);
    }

    if (tmp) {
        if (int_from_pyobj(v, tmp, errmess)) {
            Py_DECREF(tmp);
            return 1;
        }
        Py_DECREF(tmp);
    }

    {
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = lapack_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 F_FUNC(dggbal,DGGBAL)(string,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*,size_t);
extern void F_FUNC(sggbal,SGGBAL)(string,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*,size_t);
extern void F_FUNC(dgghrd,DGGHRD)(string,string,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*,size_t,size_t);
extern void F_FUNC(sgghrd,SGGHRD)(string,string,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*,size_t,size_t);
extern void F_FUNC(dorgqr,DORGQR)(int*,int*,int*,double*,int*,double*,double*,int*,int*);
extern void F_FUNC(sorgqr,SORGQR)(int*,int*,int*,float*,int*,float*,float*,int*,int*);
extern void F_FUNC(dormqr,DORMQR)(string,string,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*,size_t,size_t);
extern void F_FUNC(sormqr,SORMQR)(string,string,int*,int*,int*,float*,int*,float*,float*,int*,float*,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 ***********************/

/*********************************** dggbal ***********************************/
static char doc_f2py_rout_lapack_dggbal[] = "\
a,b,ilo,ihi,info = dggbal(job,n,a,b,lscale,rscale,work,[lda,ldb,overwrite_a,overwrite_b])\n\nWrapper for ``dggbal``.\
\n\nParameters\n----------\n"
"job : input string(len=1)\n"
"n : input int\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"lscale : input rank-1 array('d') with bounds (*)\n"
"rscale : input rank-1 array('d') with bounds (*)\n"
"work : input rank-1 array('d') with bounds (*)\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_b : input int, optional\n    Default: 0\n"
"ldb : input int, optional\n    Default: shape(b, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"b : rank-2 array('d') with bounds (ldb,*)\n"
"ilo : int\n"
"ihi : int\n"
"info : int";
/* extern void F_FUNC(dggbal,DGGBAL)(string,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*,size_t); */
static PyObject *f2py_rout_lapack_dggbal(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string job = NULL;
    int slen(job);
    PyObject *job_capi = Py_None;
    int n = 0;
    PyObject *n_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 *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_tmp = NULL;
    int capi_b_intent = 0;
    int capi_overwrite_b = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    int ilo = 0;
    int ihi = 0;
    double *lscale = NULL;
    npy_intp lscale_Dims[1] = {-1};
    const int lscale_Rank = 1;
    PyArrayObject *capi_lscale_tmp = NULL;
    int capi_lscale_intent = 0;
    PyObject *lscale_capi = Py_None;
    double *rscale = NULL;
    npy_intp rscale_Dims[1] = {-1};
    const int rscale_Rank = 1;
    PyArrayObject *capi_rscale_tmp = NULL;
    int capi_rscale_intent = 0;
    PyObject *rscale_capi = Py_None;
    double *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"job","n","a","b","lscale","rscale","work","lda","ldb","overwrite_a","overwrite_b",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|OOii:lapack.dggbal",\
        capi_kwlist,&job_capi,&n_capi,&a_capi,&b_capi,&lscale_capi,&rscale_capi,&work_capi,&lda_capi,&ldb_capi,&capi_overwrite_a,&capi_overwrite_b))
        return NULL;
/*frompyobj*/
    /* Processing variable job */
    slen(job) = 1;
    f2py_success = string_from_pyobj(&job,&slen(job),"",job_capi,"string_from_pyobj failed in converting 1st argument`job' of lapack.dggbal to C string");
    if (f2py_success) {
        STRINGPADN(job, slen(job), '\0', ' ');
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.dggbal() 2nd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 3rd argument `a' of lapack.dggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (double *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_b_tmp = array_from_pyobj(NPY_DOUBLE,b_Dims,b_Rank,capi_b_intent,b_capi);
    if (capi_b_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 4th argument `b' of lapack.dggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        b = (double *)(PyArray_DATA(capi_b_tmp));

    /* Processing variable ilo */
    /* Processing variable ihi */
    /* Processing variable lscale */
    ;
    capi_lscale_intent |= F2PY_INTENT_IN;
    capi_lscale_tmp = array_from_pyobj(NPY_DOUBLE,lscale_Dims,lscale_Rank,capi_lscale_intent,lscale_capi);
    if (capi_lscale_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 5th argument `lscale' of lapack.dggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        lscale = (double *)(PyArray_DATA(capi_lscale_tmp));

    /* Processing variable rscale */
    ;
    capi_rscale_intent |= F2PY_INTENT_IN;
    capi_rscale_tmp = array_from_pyobj(NPY_DOUBLE,rscale_Dims,rscale_Rank,capi_rscale_intent,rscale_capi);
    if (capi_rscale_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `rscale' of lapack.dggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        rscale = (double *)(PyArray_DATA(capi_rscale_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_DOUBLE,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `work' of lapack.dggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (double *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.dggbal() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","dggbal:lda=%d",lda) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b, 0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"lapack.dggbal() 2nd keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b, 0) == ldb,"shape(b, 0) == ldb","2nd keyword ldb","dggbal:ldb=%d",ldb) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(job,&n,a,&lda,b,&ldb,&ilo,&ihi,lscale,rscale,work,&info,slen(job));
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("NNiii",capi_a_tmp,capi_b_tmp,ilo,ihi,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(b, 0) == ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    if((PyObject *)capi_rscale_tmp!=rscale_capi) {
        Py_XDECREF(capi_rscale_tmp); }
    }  /*if (capi_rscale_tmp == NULL) ... else of rscale*/
    /* End of cleaning variable rscale */
    if((PyObject *)capi_lscale_tmp!=lscale_capi) {
        Py_XDECREF(capi_lscale_tmp); }
    }  /*if (capi_lscale_tmp == NULL) ... else of lscale*/
    /* End of cleaning variable lscale */
    /* End of cleaning variable ihi */
    /* End of cleaning variable ilo */
    }  /*if (capi_b_tmp == NULL) ... else of b*/
    /* End of cleaning variable b */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
        STRINGFREE(job);
    }  /*if (f2py_success) of job*/
    /* End of cleaning variable job */
/*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 dggbal *******************************/

/*********************************** sggbal ***********************************/
static char doc_f2py_rout_lapack_sggbal[] = "\
a,b,ilo,ihi,info = sggbal(job,n,a,b,lscale,rscale,work,[lda,ldb,overwrite_a,overwrite_b])\n\nWrapper for ``sggbal``.\
\n\nParameters\n----------\n"
"job : input string(len=1)\n"
"n : input int\n"
"a : input rank-2 array('f') with bounds (lda,*)\n"
"b : input rank-2 array('f') with bounds (ldb,*)\n"
"lscale : input rank-1 array('f') with bounds (*)\n"
"rscale : input rank-1 array('f') with bounds (*)\n"
"work : input rank-1 array('f') with bounds (*)\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_b : input int, optional\n    Default: 0\n"
"ldb : input int, optional\n    Default: shape(b, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('f') with bounds (lda,*)\n"
"b : rank-2 array('f') with bounds (ldb,*)\n"
"ilo : int\n"
"ihi : int\n"
"info : int";
/* extern void F_FUNC(sggbal,SGGBAL)(string,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*,size_t); */
static PyObject *f2py_rout_lapack_sggbal(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string job = NULL;
    int slen(job);
    PyObject *job_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    float *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;
    float *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_tmp = NULL;
    int capi_b_intent = 0;
    int capi_overwrite_b = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    int ilo = 0;
    int ihi = 0;
    float *lscale = NULL;
    npy_intp lscale_Dims[1] = {-1};
    const int lscale_Rank = 1;
    PyArrayObject *capi_lscale_tmp = NULL;
    int capi_lscale_intent = 0;
    PyObject *lscale_capi = Py_None;
    float *rscale = NULL;
    npy_intp rscale_Dims[1] = {-1};
    const int rscale_Rank = 1;
    PyArrayObject *capi_rscale_tmp = NULL;
    int capi_rscale_intent = 0;
    PyObject *rscale_capi = Py_None;
    float *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"job","n","a","b","lscale","rscale","work","lda","ldb","overwrite_a","overwrite_b",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|OOii:lapack.sggbal",\
        capi_kwlist,&job_capi,&n_capi,&a_capi,&b_capi,&lscale_capi,&rscale_capi,&work_capi,&lda_capi,&ldb_capi,&capi_overwrite_a,&capi_overwrite_b))
        return NULL;
/*frompyobj*/
    /* Processing variable job */
    slen(job) = 1;
    f2py_success = string_from_pyobj(&job,&slen(job),"",job_capi,"string_from_pyobj failed in converting 1st argument`job' of lapack.sggbal to C string");
    if (f2py_success) {
        STRINGPADN(job, slen(job), '\0', ' ');
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.sggbal() 2nd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_FLOAT,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 3rd argument `a' of lapack.sggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (float *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_b_tmp = array_from_pyobj(NPY_FLOAT,b_Dims,b_Rank,capi_b_intent,b_capi);
    if (capi_b_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 4th argument `b' of lapack.sggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        b = (float *)(PyArray_DATA(capi_b_tmp));

    /* Processing variable ilo */
    /* Processing variable ihi */
    /* Processing variable lscale */
    ;
    capi_lscale_intent |= F2PY_INTENT_IN;
    capi_lscale_tmp = array_from_pyobj(NPY_FLOAT,lscale_Dims,lscale_Rank,capi_lscale_intent,lscale_capi);
    if (capi_lscale_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 5th argument `lscale' of lapack.sggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        lscale = (float *)(PyArray_DATA(capi_lscale_tmp));

    /* Processing variable rscale */
    ;
    capi_rscale_intent |= F2PY_INTENT_IN;
    capi_rscale_tmp = array_from_pyobj(NPY_FLOAT,rscale_Dims,rscale_Rank,capi_rscale_intent,rscale_capi);
    if (capi_rscale_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `rscale' of lapack.sggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        rscale = (float *)(PyArray_DATA(capi_rscale_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_FLOAT,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `work' of lapack.sggbal to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (float *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.sggbal() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","sggbal:lda=%d",lda) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b, 0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"lapack.sggbal() 2nd keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b, 0) == ldb,"shape(b, 0) == ldb","2nd keyword ldb","sggbal:ldb=%d",ldb) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(job,&n,a,&lda,b,&ldb,&ilo,&ihi,lscale,rscale,work,&info,slen(job));
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("NNiii",capi_a_tmp,capi_b_tmp,ilo,ihi,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(b, 0) == ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    if((PyObject *)capi_rscale_tmp!=rscale_capi) {
        Py_XDECREF(capi_rscale_tmp); }
    }  /*if (capi_rscale_tmp == NULL) ... else of rscale*/
    /* End of cleaning variable rscale */
    if((PyObject *)capi_lscale_tmp!=lscale_capi) {
        Py_XDECREF(capi_lscale_tmp); }
    }  /*if (capi_lscale_tmp == NULL) ... else of lscale*/
    /* End of cleaning variable lscale */
    /* End of cleaning variable ihi */
    /* End of cleaning variable ilo */
    }  /*if (capi_b_tmp == NULL) ... else of b*/
    /* End of cleaning variable b */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
        STRINGFREE(job);
    }  /*if (f2py_success) of job*/
    /* End of cleaning variable job */
/*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 sggbal *******************************/

/*********************************** dgghrd ***********************************/
static char doc_f2py_rout_lapack_dgghrd[] = "\
a,b,q,z,info = dgghrd(compq,compz,n,ilo,ihi,a,b,q,z,[lda,ldb,ldq,ldz,overwrite_a,overwrite_b,overwrite_q,overwrite_z])\n\nWrapper for ``dgghrd``.\
\n\nParameters\n----------\n"
"compq : input string(len=1)\n"
"compz : input string(len=1)\n"
"n : input int\n"
"ilo : input int\n"
"ihi : input int\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"b : input rank-2 array('d') with bounds (ldb,*)\n"
"q : input rank-2 array('d') with bounds (ldq,*)\n"
"z : input rank-2 array('d') with bounds (ldz,*)\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_b : input int, optional\n    Default: 0\n"
"ldb : input int, optional\n    Default: shape(b, 0)\n"
"overwrite_q : input int, optional\n    Default: 0\n"
"ldq : input int, optional\n    Default: shape(q, 0)\n"
"overwrite_z : input int, optional\n    Default: 0\n"
"ldz : input int, optional\n    Default: shape(z, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"b : rank-2 array('d') with bounds (ldb,*)\n"
"q : rank-2 array('d') with bounds (ldq,*)\n"
"z : rank-2 array('d') with bounds (ldz,*)\n"
"info : int";
/* extern void F_FUNC(dgghrd,DGGHRD)(string,string,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_lapack_dgghrd(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,string,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*,size_t,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string compq = NULL;
    int slen(compq);
    PyObject *compq_capi = Py_None;
    string compz = NULL;
    int slen(compz);
    PyObject *compz_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int ilo = 0;
    PyObject *ilo_capi = Py_None;
    int ihi = 0;
    PyObject *ihi_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 *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_tmp = NULL;
    int capi_b_intent = 0;
    int capi_overwrite_b = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    double *q = NULL;
    npy_intp q_Dims[2] = {-1, -1};
    const int q_Rank = 2;
    PyArrayObject *capi_q_tmp = NULL;
    int capi_q_intent = 0;
    int capi_overwrite_q = 0;
    PyObject *q_capi = Py_None;
    int ldq = 0;
    PyObject *ldq_capi = Py_None;
    double *z = NULL;
    npy_intp z_Dims[2] = {-1, -1};
    const int z_Rank = 2;
    PyArrayObject *capi_z_tmp = NULL;
    int capi_z_intent = 0;
    int capi_overwrite_z = 0;
    PyObject *z_capi = Py_None;
    int ldz = 0;
    PyObject *ldz_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"compq","compz","n","ilo","ihi","a","b","q","z","lda","ldb","ldq","ldz","overwrite_a","overwrite_b","overwrite_q","overwrite_z",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOO|OOOOiiii:lapack.dgghrd",\
        capi_kwlist,&compq_capi,&compz_capi,&n_capi,&ilo_capi,&ihi_capi,&a_capi,&b_capi,&q_capi,&z_capi,&lda_capi,&ldb_capi,&ldq_capi,&ldz_capi,&capi_overwrite_a,&capi_overwrite_b,&capi_overwrite_q,&capi_overwrite_z))
        return NULL;
/*frompyobj*/
    /* Processing variable compq */
    slen(compq) = 1;
    f2py_success = string_from_pyobj(&compq,&slen(compq),"",compq_capi,"string_from_pyobj failed in converting 1st argument`compq' of lapack.dgghrd to C string");
    if (f2py_success) {
        STRINGPADN(compq, slen(compq), '\0', ' ');
    /* Processing variable compz */
    slen(compz) = 1;
    f2py_success = string_from_pyobj(&compz,&slen(compz),"",compz_capi,"string_from_pyobj failed in converting 2nd argument`compz' of lapack.dgghrd to C string");
    if (f2py_success) {
        STRINGPADN(compz, slen(compz), '\0', ' ');
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.dgghrd() 3rd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable ilo */
        f2py_success = int_from_pyobj(&ilo,ilo_capi,"lapack.dgghrd() 4th argument (ilo) can't be converted to int");
    if (f2py_success) {
    /* Processing variable ihi */
        f2py_success = int_from_pyobj(&ihi,ihi_capi,"lapack.dgghrd() 5th argument (ihi) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `a' of lapack.dgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (double *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_b_tmp = array_from_pyobj(NPY_DOUBLE,b_Dims,b_Rank,capi_b_intent,b_capi);
    if (capi_b_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `b' of lapack.dgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        b = (double *)(PyArray_DATA(capi_b_tmp));

    /* Processing variable q */
    capi_q_intent |= (capi_overwrite_q?0:F2PY_INTENT_COPY);
    ;
    capi_q_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_q_tmp = array_from_pyobj(NPY_DOUBLE,q_Dims,q_Rank,capi_q_intent,q_capi);
    if (capi_q_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 8th argument `q' of lapack.dgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        q = (double *)(PyArray_DATA(capi_q_tmp));

    /* Processing variable z */
    capi_z_intent |= (capi_overwrite_z?0:F2PY_INTENT_COPY);
    ;
    capi_z_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_z_tmp = array_from_pyobj(NPY_DOUBLE,z_Dims,z_Rank,capi_z_intent,z_capi);
    if (capi_z_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 9th argument `z' of lapack.dgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        z = (double *)(PyArray_DATA(capi_z_tmp));

    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.dgghrd() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","dgghrd:lda=%d",lda) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b, 0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"lapack.dgghrd() 2nd keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b, 0) == ldb,"shape(b, 0) == ldb","2nd keyword ldb","dgghrd:ldb=%d",ldb) {
    /* Processing variable ldq */
    if (ldq_capi == Py_None) ldq = shape(q, 0); else
        f2py_success = int_from_pyobj(&ldq,ldq_capi,"lapack.dgghrd() 3rd keyword (ldq) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(q, 0) == ldq,"shape(q, 0) == ldq","3rd keyword ldq","dgghrd:ldq=%d",ldq) {
    /* Processing variable ldz */
    if (ldz_capi == Py_None) ldz = shape(z, 0); else
        f2py_success = int_from_pyobj(&ldz,ldz_capi,"lapack.dgghrd() 4th keyword (ldz) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(z, 0) == ldz,"shape(z, 0) == ldz","4th keyword ldz","dgghrd:ldz=%d",ldz) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(compq,compz,&n,&ilo,&ihi,a,&lda,b,&ldb,q,&ldq,z,&ldz,&info,slen(compq),slen(compz));
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("NNNNi",capi_a_tmp,capi_b_tmp,capi_q_tmp,capi_z_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(z, 0) == ldz)*/
    } /*if (f2py_success) of ldz*/
    /* End of cleaning variable ldz */
    } /*CHECKSCALAR(shape(q, 0) == ldq)*/
    } /*if (f2py_success) of ldq*/
    /* End of cleaning variable ldq */
    } /*CHECKSCALAR(shape(b, 0) == ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    }  /*if (capi_z_tmp == NULL) ... else of z*/
    /* End of cleaning variable z */
    }  /*if (capi_q_tmp == NULL) ... else of q*/
    /* End of cleaning variable q */
    }  /*if (capi_b_tmp == NULL) ... else of b*/
    /* End of cleaning variable b */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of ihi*/
    /* End of cleaning variable ihi */
    } /*if (f2py_success) of ilo*/
    /* End of cleaning variable ilo */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
        STRINGFREE(compz);
    }  /*if (f2py_success) of compz*/
    /* End of cleaning variable compz */
        STRINGFREE(compq);
    }  /*if (f2py_success) of compq*/
    /* End of cleaning variable compq */
/*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 dgghrd *******************************/

/*********************************** sgghrd ***********************************/
static char doc_f2py_rout_lapack_sgghrd[] = "\
a,b,q,z,info = sgghrd(compq,compz,n,ilo,ihi,a,b,q,z,[lda,ldb,ldq,ldz,overwrite_a,overwrite_b,overwrite_q,overwrite_z])\n\nWrapper for ``sgghrd``.\
\n\nParameters\n----------\n"
"compq : input string(len=1)\n"
"compz : input string(len=1)\n"
"n : input int\n"
"ilo : input int\n"
"ihi : input int\n"
"a : input rank-2 array('f') with bounds (lda,*)\n"
"b : input rank-2 array('f') with bounds (ldb,*)\n"
"q : input rank-2 array('f') with bounds (ldq,*)\n"
"z : input rank-2 array('f') with bounds (ldz,*)\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_b : input int, optional\n    Default: 0\n"
"ldb : input int, optional\n    Default: shape(b, 0)\n"
"overwrite_q : input int, optional\n    Default: 0\n"
"ldq : input int, optional\n    Default: shape(q, 0)\n"
"overwrite_z : input int, optional\n    Default: 0\n"
"ldz : input int, optional\n    Default: shape(z, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('f') with bounds (lda,*)\n"
"b : rank-2 array('f') with bounds (ldb,*)\n"
"q : rank-2 array('f') with bounds (ldq,*)\n"
"z : rank-2 array('f') with bounds (ldz,*)\n"
"info : int";
/* extern void F_FUNC(sgghrd,SGGHRD)(string,string,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_lapack_sgghrd(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,string,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*,size_t,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string compq = NULL;
    int slen(compq);
    PyObject *compq_capi = Py_None;
    string compz = NULL;
    int slen(compz);
    PyObject *compz_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int ilo = 0;
    PyObject *ilo_capi = Py_None;
    int ihi = 0;
    PyObject *ihi_capi = Py_None;
    float *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;
    float *b = NULL;
    npy_intp b_Dims[2] = {-1, -1};
    const int b_Rank = 2;
    PyArrayObject *capi_b_tmp = NULL;
    int capi_b_intent = 0;
    int capi_overwrite_b = 0;
    PyObject *b_capi = Py_None;
    int ldb = 0;
    PyObject *ldb_capi = Py_None;
    float *q = NULL;
    npy_intp q_Dims[2] = {-1, -1};
    const int q_Rank = 2;
    PyArrayObject *capi_q_tmp = NULL;
    int capi_q_intent = 0;
    int capi_overwrite_q = 0;
    PyObject *q_capi = Py_None;
    int ldq = 0;
    PyObject *ldq_capi = Py_None;
    float *z = NULL;
    npy_intp z_Dims[2] = {-1, -1};
    const int z_Rank = 2;
    PyArrayObject *capi_z_tmp = NULL;
    int capi_z_intent = 0;
    int capi_overwrite_z = 0;
    PyObject *z_capi = Py_None;
    int ldz = 0;
    PyObject *ldz_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"compq","compz","n","ilo","ihi","a","b","q","z","lda","ldb","ldq","ldz","overwrite_a","overwrite_b","overwrite_q","overwrite_z",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOO|OOOOiiii:lapack.sgghrd",\
        capi_kwlist,&compq_capi,&compz_capi,&n_capi,&ilo_capi,&ihi_capi,&a_capi,&b_capi,&q_capi,&z_capi,&lda_capi,&ldb_capi,&ldq_capi,&ldz_capi,&capi_overwrite_a,&capi_overwrite_b,&capi_overwrite_q,&capi_overwrite_z))
        return NULL;
/*frompyobj*/
    /* Processing variable compq */
    slen(compq) = 1;
    f2py_success = string_from_pyobj(&compq,&slen(compq),"",compq_capi,"string_from_pyobj failed in converting 1st argument`compq' of lapack.sgghrd to C string");
    if (f2py_success) {
        STRINGPADN(compq, slen(compq), '\0', ' ');
    /* Processing variable compz */
    slen(compz) = 1;
    f2py_success = string_from_pyobj(&compz,&slen(compz),"",compz_capi,"string_from_pyobj failed in converting 2nd argument`compz' of lapack.sgghrd to C string");
    if (f2py_success) {
        STRINGPADN(compz, slen(compz), '\0', ' ');
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.sgghrd() 3rd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable ilo */
        f2py_success = int_from_pyobj(&ilo,ilo_capi,"lapack.sgghrd() 4th argument (ilo) can't be converted to int");
    if (f2py_success) {
    /* Processing variable ihi */
        f2py_success = int_from_pyobj(&ihi,ihi_capi,"lapack.sgghrd() 5th argument (ihi) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_FLOAT,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `a' of lapack.sgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (float *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_b_tmp = array_from_pyobj(NPY_FLOAT,b_Dims,b_Rank,capi_b_intent,b_capi);
    if (capi_b_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `b' of lapack.sgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        b = (float *)(PyArray_DATA(capi_b_tmp));

    /* Processing variable q */
    capi_q_intent |= (capi_overwrite_q?0:F2PY_INTENT_COPY);
    ;
    capi_q_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_q_tmp = array_from_pyobj(NPY_FLOAT,q_Dims,q_Rank,capi_q_intent,q_capi);
    if (capi_q_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 8th argument `q' of lapack.sgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        q = (float *)(PyArray_DATA(capi_q_tmp));

    /* Processing variable z */
    capi_z_intent |= (capi_overwrite_z?0:F2PY_INTENT_COPY);
    ;
    capi_z_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_z_tmp = array_from_pyobj(NPY_FLOAT,z_Dims,z_Rank,capi_z_intent,z_capi);
    if (capi_z_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 9th argument `z' of lapack.sgghrd to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        z = (float *)(PyArray_DATA(capi_z_tmp));

    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.sgghrd() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","sgghrd:lda=%d",lda) {
    /* Processing variable ldb */
    if (ldb_capi == Py_None) ldb = shape(b, 0); else
        f2py_success = int_from_pyobj(&ldb,ldb_capi,"lapack.sgghrd() 2nd keyword (ldb) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(b, 0) == ldb,"shape(b, 0) == ldb","2nd keyword ldb","sgghrd:ldb=%d",ldb) {
    /* Processing variable ldq */
    if (ldq_capi == Py_None) ldq = shape(q, 0); else
        f2py_success = int_from_pyobj(&ldq,ldq_capi,"lapack.sgghrd() 3rd keyword (ldq) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(q, 0) == ldq,"shape(q, 0) == ldq","3rd keyword ldq","sgghrd:ldq=%d",ldq) {
    /* Processing variable ldz */
    if (ldz_capi == Py_None) ldz = shape(z, 0); else
        f2py_success = int_from_pyobj(&ldz,ldz_capi,"lapack.sgghrd() 4th keyword (ldz) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(z, 0) == ldz,"shape(z, 0) == ldz","4th keyword ldz","sgghrd:ldz=%d",ldz) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(compq,compz,&n,&ilo,&ihi,a,&lda,b,&ldb,q,&ldq,z,&ldz,&info,slen(compq),slen(compz));
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("NNNNi",capi_a_tmp,capi_b_tmp,capi_q_tmp,capi_z_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(z, 0) == ldz)*/
    } /*if (f2py_success) of ldz*/
    /* End of cleaning variable ldz */
    } /*CHECKSCALAR(shape(q, 0) == ldq)*/
    } /*if (f2py_success) of ldq*/
    /* End of cleaning variable ldq */
    } /*CHECKSCALAR(shape(b, 0) == ldb)*/
    } /*if (f2py_success) of ldb*/
    /* End of cleaning variable ldb */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    }  /*if (capi_z_tmp == NULL) ... else of z*/
    /* End of cleaning variable z */
    }  /*if (capi_q_tmp == NULL) ... else of q*/
    /* End of cleaning variable q */
    }  /*if (capi_b_tmp == NULL) ... else of b*/
    /* End of cleaning variable b */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of ihi*/
    /* End of cleaning variable ihi */
    } /*if (f2py_success) of ilo*/
    /* End of cleaning variable ilo */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
        STRINGFREE(compz);
    }  /*if (f2py_success) of compz*/
    /* End of cleaning variable compz */
        STRINGFREE(compq);
    }  /*if (f2py_success) of compq*/
    /* End of cleaning variable compq */
/*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 sgghrd *******************************/

/*********************************** dorgqr ***********************************/
static char doc_f2py_rout_lapack_dorgqr[] = "\
a,info = dorgqr(m,n,k,a,tau,work,lwork,[lda,overwrite_a])\n\nWrapper for ``dorgqr``.\
\n\nParameters\n----------\n"
"m : input int\n"
"n : input int\n"
"k : input int\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"tau : input rank-1 array('d') with bounds (*)\n"
"work : input rank-1 array('d') with bounds (*)\n"
"lwork : input int\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('d') with bounds (lda,*)\n"
"info : int";
/* extern void F_FUNC(dorgqr,DORGQR)(int*,int*,int*,double*,int*,double*,double*,int*,int*); */
static PyObject *f2py_rout_lapack_dorgqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,int*,int*,double*,int*,double*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    int m = 0;
    PyObject *m_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int k = 0;
    PyObject *k_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 *tau = NULL;
    npy_intp tau_Dims[1] = {-1};
    const int tau_Rank = 1;
    PyArrayObject *capi_tau_tmp = NULL;
    int capi_tau_intent = 0;
    PyObject *tau_capi = Py_None;
    double *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int lwork = 0;
    PyObject *lwork_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"m","n","k","a","tau","work","lwork","lda","overwrite_a",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|Oi:lapack.dorgqr",\
        capi_kwlist,&m_capi,&n_capi,&k_capi,&a_capi,&tau_capi,&work_capi,&lwork_capi,&lda_capi,&capi_overwrite_a))
        return NULL;
/*frompyobj*/
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"lapack.dorgqr() 1st argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.dorgqr() 2nd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable k */
        f2py_success = int_from_pyobj(&k,k_capi,"lapack.dorgqr() 3rd argument (k) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 4th argument `a' of lapack.dorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (double *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    capi_tau_tmp = array_from_pyobj(NPY_DOUBLE,tau_Dims,tau_Rank,capi_tau_intent,tau_capi);
    if (capi_tau_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 5th argument `tau' of lapack.dorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        tau = (double *)(PyArray_DATA(capi_tau_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_DOUBLE,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `work' of lapack.dorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (double *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable lwork */
        f2py_success = int_from_pyobj(&lwork,lwork_capi,"lapack.dorgqr() 7th argument (lwork) can't be converted to int");
    if (f2py_success) {
    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.dorgqr() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","dorgqr:lda=%d",lda) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(&m,&n,&k,a,&lda,tau,work,&lwork,&info);
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("Ni",capi_a_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    } /*if (f2py_success) of lwork*/
    /* End of cleaning variable lwork */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    if((PyObject *)capi_tau_tmp!=tau_capi) {
        Py_XDECREF(capi_tau_tmp); }
    }  /*if (capi_tau_tmp == NULL) ... else of tau*/
    /* End of cleaning variable tau */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of k*/
    /* End of cleaning variable k */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
/*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 dorgqr *******************************/

/*********************************** sorgqr ***********************************/
static char doc_f2py_rout_lapack_sorgqr[] = "\
a,info = sorgqr(m,n,k,a,tau,work,lwork,[lda,overwrite_a])\n\nWrapper for ``sorgqr``.\
\n\nParameters\n----------\n"
"m : input int\n"
"n : input int\n"
"k : input int\n"
"a : input rank-2 array('f') with bounds (lda,*)\n"
"tau : input rank-1 array('f') with bounds (*)\n"
"work : input rank-1 array('f') with bounds (*)\n"
"lwork : input int\n"
"\nOther Parameters\n----------------\n"
"overwrite_a : input int, optional\n    Default: 0\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"\nReturns\n-------\n"
"a : rank-2 array('f') with bounds (lda,*)\n"
"info : int";
/* extern void F_FUNC(sorgqr,SORGQR)(int*,int*,int*,float*,int*,float*,float*,int*,int*); */
static PyObject *f2py_rout_lapack_sorgqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(int*,int*,int*,float*,int*,float*,float*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    int m = 0;
    PyObject *m_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int k = 0;
    PyObject *k_capi = Py_None;
    float *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;
    float *tau = NULL;
    npy_intp tau_Dims[1] = {-1};
    const int tau_Rank = 1;
    PyArrayObject *capi_tau_tmp = NULL;
    int capi_tau_intent = 0;
    PyObject *tau_capi = Py_None;
    float *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int lwork = 0;
    PyObject *lwork_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"m","n","k","a","tau","work","lwork","lda","overwrite_a",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|Oi:lapack.sorgqr",\
        capi_kwlist,&m_capi,&n_capi,&k_capi,&a_capi,&tau_capi,&work_capi,&lwork_capi,&lda_capi,&capi_overwrite_a))
        return NULL;
/*frompyobj*/
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"lapack.sorgqr() 1st argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.sorgqr() 2nd argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable k */
        f2py_success = int_from_pyobj(&k,k_capi,"lapack.sorgqr() 3rd argument (k) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    capi_a_intent |= (capi_overwrite_a?0:F2PY_INTENT_COPY);
    ;
    capi_a_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_a_tmp = array_from_pyobj(NPY_FLOAT,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 4th argument `a' of lapack.sorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (float *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    capi_tau_tmp = array_from_pyobj(NPY_FLOAT,tau_Dims,tau_Rank,capi_tau_intent,tau_capi);
    if (capi_tau_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 5th argument `tau' of lapack.sorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        tau = (float *)(PyArray_DATA(capi_tau_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_FLOAT,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `work' of lapack.sorgqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (float *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable lwork */
        f2py_success = int_from_pyobj(&lwork,lwork_capi,"lapack.sorgqr() 7th argument (lwork) can't be converted to int");
    if (f2py_success) {
    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.sorgqr() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","sorgqr:lda=%d",lda) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(&m,&n,&k,a,&lda,tau,work,&lwork,&info);
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("Ni",capi_a_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    } /*if (f2py_success) of lwork*/
    /* End of cleaning variable lwork */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    if((PyObject *)capi_tau_tmp!=tau_capi) {
        Py_XDECREF(capi_tau_tmp); }
    }  /*if (capi_tau_tmp == NULL) ... else of tau*/
    /* End of cleaning variable tau */
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of k*/
    /* End of cleaning variable k */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
/*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 sorgqr *******************************/

/*********************************** dormqr ***********************************/
static char doc_f2py_rout_lapack_dormqr[] = "\
c,info = dormqr(side,trans,m,n,k,a,tau,c,work,lwork,[lda,ldc,overwrite_c])\n\nWrapper for ``dormqr``.\
\n\nParameters\n----------\n"
"side : input string(len=1)\n"
"trans : input string(len=1)\n"
"m : input int\n"
"n : input int\n"
"k : input int\n"
"a : input rank-2 array('d') with bounds (lda,*)\n"
"tau : input rank-1 array('d') with bounds (*)\n"
"c : input rank-2 array('d') with bounds (ldc,*)\n"
"work : input rank-1 array('d') with bounds (*)\n"
"lwork : input int\n"
"\nOther Parameters\n----------------\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_c : input int, optional\n    Default: 0\n"
"ldc : input int, optional\n    Default: shape(c, 0)\n"
"\nReturns\n-------\n"
"c : rank-2 array('d') with bounds (ldc,*)\n"
"info : int";
/* extern void F_FUNC(dormqr,DORMQR)(string,string,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_lapack_dormqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,string,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*,size_t,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string side = NULL;
    int slen(side);
    PyObject *side_capi = Py_None;
    string trans = NULL;
    int slen(trans);
    PyObject *trans_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int k = 0;
    PyObject *k_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;
    PyObject *a_capi = Py_None;
    int lda = 0;
    PyObject *lda_capi = Py_None;
    double *tau = NULL;
    npy_intp tau_Dims[1] = {-1};
    const int tau_Rank = 1;
    PyArrayObject *capi_tau_tmp = NULL;
    int capi_tau_intent = 0;
    PyObject *tau_capi = Py_None;
    double *c = NULL;
    npy_intp c_Dims[2] = {-1, -1};
    const int c_Rank = 2;
    PyArrayObject *capi_c_tmp = NULL;
    int capi_c_intent = 0;
    int capi_overwrite_c = 0;
    PyObject *c_capi = Py_None;
    int ldc = 0;
    PyObject *ldc_capi = Py_None;
    double *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int lwork = 0;
    PyObject *lwork_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"side","trans","m","n","k","a","tau","c","work","lwork","lda","ldc","overwrite_c",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOOO|OOi:lapack.dormqr",\
        capi_kwlist,&side_capi,&trans_capi,&m_capi,&n_capi,&k_capi,&a_capi,&tau_capi,&c_capi,&work_capi,&lwork_capi,&lda_capi,&ldc_capi,&capi_overwrite_c))
        return NULL;
/*frompyobj*/
    /* Processing variable side */
    slen(side) = 1;
    f2py_success = string_from_pyobj(&side,&slen(side),"",side_capi,"string_from_pyobj failed in converting 1st argument`side' of lapack.dormqr to C string");
    if (f2py_success) {
        STRINGPADN(side, slen(side), '\0', ' ');
    /* Processing variable trans */
    slen(trans) = 1;
    f2py_success = string_from_pyobj(&trans,&slen(trans),"",trans_capi,"string_from_pyobj failed in converting 2nd argument`trans' of lapack.dormqr to C string");
    if (f2py_success) {
        STRINGPADN(trans, slen(trans), '\0', ' ');
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"lapack.dormqr() 3rd argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.dormqr() 4th argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable k */
        f2py_success = int_from_pyobj(&k,k_capi,"lapack.dormqr() 5th argument (k) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    ;
    capi_a_intent |= 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) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `a' of lapack.dormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (double *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    capi_tau_tmp = array_from_pyobj(NPY_DOUBLE,tau_Dims,tau_Rank,capi_tau_intent,tau_capi);
    if (capi_tau_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `tau' of lapack.dormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        tau = (double *)(PyArray_DATA(capi_tau_tmp));

    /* Processing variable c */
    capi_c_intent |= (capi_overwrite_c?0:F2PY_INTENT_COPY);
    ;
    capi_c_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_c_tmp = array_from_pyobj(NPY_DOUBLE,c_Dims,c_Rank,capi_c_intent,c_capi);
    if (capi_c_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 8th argument `c' of lapack.dormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        c = (double *)(PyArray_DATA(capi_c_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_DOUBLE,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 9th argument `work' of lapack.dormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (double *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable lwork */
        f2py_success = int_from_pyobj(&lwork,lwork_capi,"lapack.dormqr() 10th argument (lwork) can't be converted to int");
    if (f2py_success) {
    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.dormqr() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","dormqr:lda=%d",lda) {
    /* Processing variable ldc */
    if (ldc_capi == Py_None) ldc = shape(c, 0); else
        f2py_success = int_from_pyobj(&ldc,ldc_capi,"lapack.dormqr() 2nd keyword (ldc) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(c, 0) == ldc,"shape(c, 0) == ldc","2nd keyword ldc","dormqr:ldc=%d",ldc) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(side,trans,&m,&n,&k,a,&lda,tau,c,&ldc,work,&lwork,&info,slen(side),slen(trans));
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("Ni",capi_c_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(c, 0) == ldc)*/
    } /*if (f2py_success) of ldc*/
    /* End of cleaning variable ldc */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    } /*if (f2py_success) of lwork*/
    /* End of cleaning variable lwork */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    }  /*if (capi_c_tmp == NULL) ... else of c*/
    /* End of cleaning variable c */
    if((PyObject *)capi_tau_tmp!=tau_capi) {
        Py_XDECREF(capi_tau_tmp); }
    }  /*if (capi_tau_tmp == NULL) ... else of tau*/
    /* End of cleaning variable tau */
    if((PyObject *)capi_a_tmp!=a_capi) {
        Py_XDECREF(capi_a_tmp); }
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of k*/
    /* End of cleaning variable k */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
        STRINGFREE(trans);
    }  /*if (f2py_success) of trans*/
    /* End of cleaning variable trans */
        STRINGFREE(side);
    }  /*if (f2py_success) of side*/
    /* End of cleaning variable side */
/*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 dormqr *******************************/

/*********************************** sormqr ***********************************/
static char doc_f2py_rout_lapack_sormqr[] = "\
c,info = sormqr(side,trans,m,n,k,a,tau,c,work,lwork,[lda,ldc,overwrite_c])\n\nWrapper for ``sormqr``.\
\n\nParameters\n----------\n"
"side : input string(len=1)\n"
"trans : input string(len=1)\n"
"m : input int\n"
"n : input int\n"
"k : input int\n"
"a : input rank-2 array('f') with bounds (lda,*)\n"
"tau : input rank-1 array('f') with bounds (*)\n"
"c : input rank-2 array('f') with bounds (ldc,*)\n"
"work : input rank-1 array('f') with bounds (*)\n"
"lwork : input int\n"
"\nOther Parameters\n----------------\n"
"lda : input int, optional\n    Default: shape(a, 0)\n"
"overwrite_c : input int, optional\n    Default: 0\n"
"ldc : input int, optional\n    Default: shape(c, 0)\n"
"\nReturns\n-------\n"
"c : rank-2 array('f') with bounds (ldc,*)\n"
"info : int";
/* extern void F_FUNC(sormqr,SORMQR)(string,string,int*,int*,int*,float*,int*,float*,float*,int*,float*,int*,int*,size_t,size_t); */
static PyObject *f2py_rout_lapack_sormqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(string,string,int*,int*,int*,float*,int*,float*,float*,int*,float*,int*,int*,size_t,size_t)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    string side = NULL;
    int slen(side);
    PyObject *side_capi = Py_None;
    string trans = NULL;
    int slen(trans);
    PyObject *trans_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int k = 0;
    PyObject *k_capi = Py_None;
    float *a = NULL;
    npy_intp a_Dims[2] = {-1, -1};
    const int a_Rank = 2;
    PyArrayObject *capi_a_tmp = NULL;
    int capi_a_intent = 0;
    PyObject *a_capi = Py_None;
    int lda = 0;
    PyObject *lda_capi = Py_None;
    float *tau = NULL;
    npy_intp tau_Dims[1] = {-1};
    const int tau_Rank = 1;
    PyArrayObject *capi_tau_tmp = NULL;
    int capi_tau_intent = 0;
    PyObject *tau_capi = Py_None;
    float *c = NULL;
    npy_intp c_Dims[2] = {-1, -1};
    const int c_Rank = 2;
    PyArrayObject *capi_c_tmp = NULL;
    int capi_c_intent = 0;
    int capi_overwrite_c = 0;
    PyObject *c_capi = Py_None;
    int ldc = 0;
    PyObject *ldc_capi = Py_None;
    float *work = NULL;
    npy_intp work_Dims[1] = {-1};
    const int work_Rank = 1;
    PyArrayObject *capi_work_tmp = NULL;
    int capi_work_intent = 0;
    PyObject *work_capi = Py_None;
    int lwork = 0;
    PyObject *lwork_capi = Py_None;
    int info = 0;
    static char *capi_kwlist[] = {"side","trans","m","n","k","a","tau","c","work","lwork","lda","ldc","overwrite_c",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOOOOO|OOi:lapack.sormqr",\
        capi_kwlist,&side_capi,&trans_capi,&m_capi,&n_capi,&k_capi,&a_capi,&tau_capi,&c_capi,&work_capi,&lwork_capi,&lda_capi,&ldc_capi,&capi_overwrite_c))
        return NULL;
/*frompyobj*/
    /* Processing variable side */
    slen(side) = 1;
    f2py_success = string_from_pyobj(&side,&slen(side),"",side_capi,"string_from_pyobj failed in converting 1st argument`side' of lapack.sormqr to C string");
    if (f2py_success) {
        STRINGPADN(side, slen(side), '\0', ' ');
    /* Processing variable trans */
    slen(trans) = 1;
    f2py_success = string_from_pyobj(&trans,&slen(trans),"",trans_capi,"string_from_pyobj failed in converting 2nd argument`trans' of lapack.sormqr to C string");
    if (f2py_success) {
        STRINGPADN(trans, slen(trans), '\0', ' ');
    /* Processing variable m */
        f2py_success = int_from_pyobj(&m,m_capi,"lapack.sormqr() 3rd argument (m) can't be converted to int");
    if (f2py_success) {
    /* Processing variable n */
        f2py_success = int_from_pyobj(&n,n_capi,"lapack.sormqr() 4th argument (n) can't be converted to int");
    if (f2py_success) {
    /* Processing variable k */
        f2py_success = int_from_pyobj(&k,k_capi,"lapack.sormqr() 5th argument (k) can't be converted to int");
    if (f2py_success) {
    /* Processing variable a */
    ;
    capi_a_intent |= F2PY_INTENT_IN;
    capi_a_tmp = array_from_pyobj(NPY_FLOAT,a_Dims,a_Rank,capi_a_intent,a_capi);
    if (capi_a_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 6th argument `a' of lapack.sormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        a = (float *)(PyArray_DATA(capi_a_tmp));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    capi_tau_tmp = array_from_pyobj(NPY_FLOAT,tau_Dims,tau_Rank,capi_tau_intent,tau_capi);
    if (capi_tau_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 7th argument `tau' of lapack.sormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        tau = (float *)(PyArray_DATA(capi_tau_tmp));

    /* Processing variable c */
    capi_c_intent |= (capi_overwrite_c?0:F2PY_INTENT_COPY);
    ;
    capi_c_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    capi_c_tmp = array_from_pyobj(NPY_FLOAT,c_Dims,c_Rank,capi_c_intent,c_capi);
    if (capi_c_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 8th argument `c' of lapack.sormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        c = (float *)(PyArray_DATA(capi_c_tmp));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    capi_work_tmp = array_from_pyobj(NPY_FLOAT,work_Dims,work_Rank,capi_work_intent,work_capi);
    if (capi_work_tmp == NULL) {
        PyObject *exc, *val, *tb;
        PyErr_Fetch(&exc, &val, &tb);
        PyErr_SetString(exc ? exc : lapack_error,"failed in converting 9th argument `work' of lapack.sormqr to C/Fortran array" );
        npy_PyErr_ChainExceptionsCause(exc, val, tb);
    } else {
        work = (float *)(PyArray_DATA(capi_work_tmp));

    /* Processing variable lwork */
        f2py_success = int_from_pyobj(&lwork,lwork_capi,"lapack.sormqr() 10th argument (lwork) can't be converted to int");
    if (f2py_success) {
    /* Processing variable info */
    /* Processing variable lda */
    if (lda_capi == Py_None) lda = shape(a, 0); else
        f2py_success = int_from_pyobj(&lda,lda_capi,"lapack.sormqr() 1st keyword (lda) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(a, 0) == lda,"shape(a, 0) == lda","1st keyword lda","sormqr:lda=%d",lda) {
    /* Processing variable ldc */
    if (ldc_capi == Py_None) ldc = shape(c, 0); else
        f2py_success = int_from_pyobj(&ldc,ldc_capi,"lapack.sormqr() 2nd keyword (ldc) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(shape(c, 0) == ldc,"shape(c, 0) == ldc","2nd keyword ldc","sormqr:ldc=%d",ldc) {
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(side,trans,&m,&n,&k,a,&lda,tau,c,&ldc,work,&lwork,&info,slen(side),slen(trans));
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("Ni",capi_c_tmp,info);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    } /*CHECKSCALAR(shape(c, 0) == ldc)*/
    } /*if (f2py_success) of ldc*/
    /* End of cleaning variable ldc */
    } /*CHECKSCALAR(shape(a, 0) == lda)*/
    } /*if (f2py_success) of lda*/
    /* End of cleaning variable lda */
    /* End of cleaning variable info */
    } /*if (f2py_success) of lwork*/
    /* End of cleaning variable lwork */
    if((PyObject *)capi_work_tmp!=work_capi) {
        Py_XDECREF(capi_work_tmp); }
    }  /*if (capi_work_tmp == NULL) ... else of work*/
    /* End of cleaning variable work */
    }  /*if (capi_c_tmp == NULL) ... else of c*/
    /* End of cleaning variable c */
    if((PyObject *)capi_tau_tmp!=tau_capi) {
        Py_XDECREF(capi_tau_tmp); }
    }  /*if (capi_tau_tmp == NULL) ... else of tau*/
    /* End of cleaning variable tau */
    if((PyObject *)capi_a_tmp!=a_capi) {
        Py_XDECREF(capi_a_tmp); }
    }  /*if (capi_a_tmp == NULL) ... else of a*/
    /* End of cleaning variable a */
    } /*if (f2py_success) of k*/
    /* End of cleaning variable k */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
        STRINGFREE(trans);
    }  /*if (f2py_success) of trans*/
    /* End of cleaning variable trans */
        STRINGFREE(side);
    }  /*if (f2py_success) of side*/
    /* End of cleaning variable side */
/*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 sormqr *******************************/
/*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[] = {
    {"dggbal",-1,{{-1}},0,(char *)F_FUNC(dggbal,DGGBAL),(f2py_init_func)f2py_rout_lapack_dggbal,doc_f2py_rout_lapack_dggbal},
    {"sggbal",-1,{{-1}},0,(char *)F_FUNC(sggbal,SGGBAL),(f2py_init_func)f2py_rout_lapack_sggbal,doc_f2py_rout_lapack_sggbal},
    {"dgghrd",-1,{{-1}},0,(char *)F_FUNC(dgghrd,DGGHRD),(f2py_init_func)f2py_rout_lapack_dgghrd,doc_f2py_rout_lapack_dgghrd},
    {"sgghrd",-1,{{-1}},0,(char *)F_FUNC(sgghrd,SGGHRD),(f2py_init_func)f2py_rout_lapack_sgghrd,doc_f2py_rout_lapack_sgghrd},
    {"dorgqr",-1,{{-1}},0,(char *)F_FUNC(dorgqr,DORGQR),(f2py_init_func)f2py_rout_lapack_dorgqr,doc_f2py_rout_lapack_dorgqr},
    {"sorgqr",-1,{{-1}},0,(char *)F_FUNC(sorgqr,SORGQR),(f2py_init_func)f2py_rout_lapack_sorgqr,doc_f2py_rout_lapack_sorgqr},
    {"dormqr",-1,{{-1}},0,(char *)F_FUNC(dormqr,DORMQR),(f2py_init_func)f2py_rout_lapack_dormqr,doc_f2py_rout_lapack_dormqr},
    {"sormqr",-1,{{-1}},0,(char *)F_FUNC(sormqr,SORMQR),(f2py_init_func)f2py_rout_lapack_sormqr,doc_f2py_rout_lapack_sormqr},

/*eof routine_defs*/
    {NULL}
};

static PyMethodDef f2py_module_methods[] = {

    {NULL,NULL}
};

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "lapack",
    NULL,
    -1,
    f2py_module_methods,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit_lapack(void) {
    int i;
    PyObject *m,*d, *s, *tmp;
    m = lapack_module = PyModule_Create(&moduledef);
    Py_SET_TYPE(&PyFortran_Type, &PyType_Type);
    import_array();
    if (PyErr_Occurred())
        {PyErr_SetString(PyExc_ImportError, "can't initialize module lapack (failed to import numpy)"); return m;}
    d = PyModule_GetDict(m);
    s = PyUnicode_FromString("1.23.2");
    PyDict_SetItemString(d, "__version__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString(
        "This module 'lapack' is auto-generated with f2py (version:1.23.2).\nFunctions:\n"
"    a,b,ilo,ihi,info = dggbal(job,n,a,b,lscale,rscale,work,lda=shape(a, 0),ldb=shape(b, 0),overwrite_a=0,overwrite_b=0)\n"
"    a,b,ilo,ihi,info = sggbal(job,n,a,b,lscale,rscale,work,lda=shape(a, 0),ldb=shape(b, 0),overwrite_a=0,overwrite_b=0)\n"
"    a,b,q,z,info = dgghrd(compq,compz,n,ilo,ihi,a,b,q,z,lda=shape(a, 0),ldb=shape(b, 0),ldq=shape(q, 0),ldz=shape(z, 0),overwrite_a=0,overwrite_b=0,overwrite_q=0,overwrite_z=0)\n"
"    a,b,q,z,info = sgghrd(compq,compz,n,ilo,ihi,a,b,q,z,lda=shape(a, 0),ldb=shape(b, 0),ldq=shape(q, 0),ldz=shape(z, 0),overwrite_a=0,overwrite_b=0,overwrite_q=0,overwrite_z=0)\n"
"    a,info = dorgqr(m,n,k,a,tau,work,lwork,lda=shape(a, 0),overwrite_a=0)\n"
"    a,info = sorgqr(m,n,k,a,tau,work,lwork,lda=shape(a, 0),overwrite_a=0)\n"
"    c,info = dormqr(side,trans,m,n,k,a,tau,c,work,lwork,lda=shape(a, 0),ldc=shape(c, 0),overwrite_c=0)\n"
"    c,info = sormqr(side,trans,m,n,k,a,tau,c,work,lwork,lda=shape(a, 0),ldc=shape(c, 0),overwrite_c=0)\n"
".");
    PyDict_SetItemString(d, "__doc__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString("1.23.2");
    PyDict_SetItemString(d, "__f2py_numpy_version__", s);
    Py_DECREF(s);
    lapack_error = PyErr_NewException ("lapack.error", NULL, NULL);
    /*
     * Store the error object inside the dict, so that it could get deallocated.
     * (in practice, this is a module, so it likely will not and cannot.)
     */
    PyDict_SetItemString(d, "_lapack_error", lapack_error);
    Py_DECREF(lapack_error);
    for(i=0;f2py_routine_defs[i].name!=NULL;i++) {
        tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]);
        PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp);
        Py_DECREF(tmp);
    }








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

/*eof initcommonhooks*/


#ifdef F2PY_REPORT_ATEXIT
    if (! PyErr_Occurred())
        on_exit(f2py_report_on_exit,(void*)"lapack");
#endif
    return m;
}
#ifdef __cplusplus
}
#endif
