/* File: lapackmodule.c
 * This file is auto-generated with f2py (version:1.26.1).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: Mon Oct 16 12:34:11 2023
 * 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 "fortranobject.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;
typedef char character;

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

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

/* See fortranobject.h for definitions. The macros here are provided for BC. */
#define rank f2py_rank
#define shape f2py_shape
#define fshape f2py_shape
#define len f2py_len
#define flen f2py_flen
#define slen f2py_slen
#define size f2py_size

#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


/************************ See f2py2e/cfuncs.py: cfuncs ************************/
static int
character_from_pyobj(character* v, PyObject *obj, const char *errmess) {
    if (PyBytes_Check(obj)) {
        /* empty bytes has trailing null, so dereferencing is always safe */
        *v = PyBytes_AS_STRING(obj)[0];
        return 1;
    } else if (PyUnicode_Check(obj)) {
        PyObject* tmp = PyUnicode_AsASCIIString(obj);
        if (tmp != NULL) {
            *v = PyBytes_AS_STRING(tmp)[0];
            Py_DECREF(tmp);
            return 1;
        }
    } else if (PyArray_Check(obj)) {
        PyArrayObject* arr = (PyArrayObject*)obj;
        if (F2PY_ARRAY_IS_CHARACTER_COMPATIBLE(arr)) {
            *v = PyArray_BYTES(arr)[0];
            return 1;
        } else if (F2PY_IS_UNICODE_ARRAY(arr)) {
            // TODO: update when numpy will support 1-byte and
            // 2-byte unicode dtypes
            PyObject* tmp = PyUnicode_FromKindAndData(
                              PyUnicode_4BYTE_KIND,
                              PyArray_BYTES(arr),
                              (PyArray_NBYTES(arr)>0?1:0));
            if (tmp != NULL) {
                if (character_from_pyobj(v, tmp, errmess)) {
                    Py_DECREF(tmp);
                    return 1;
                }
                Py_DECREF(tmp);
            }
        }
    } else if (PySequence_Check(obj)) {
        PyObject* tmp = PySequence_GetItem(obj,0);
        if (tmp != NULL) {
            if (character_from_pyobj(v, tmp, errmess)) {
                Py_DECREF(tmp);
                return 1;
            }
            Py_DECREF(tmp);
        }
    }
    {
        /* TODO: This error (and most other) error handling needs cleaning. */
        char mess[F2PY_MESSAGE_BUFFER_SIZE];
        strcpy(mess, errmess);
        PyObject* err = PyErr_Occurred();
        if (err == NULL) {
            err = PyExc_TypeError;
            Py_INCREF(err);
        }
        else {
            Py_INCREF(err);
            PyErr_Clear();
        }
        sprintf(mess + strlen(mess),
                " -- expected str|bytes|sequence-of-str-or-bytes, got ");
        f2py_describe(obj, mess + strlen(mess));
        PyErr_SetString(err, mess);
        Py_DECREF(err);
    }
    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)(character*,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*);
extern void F_FUNC(sggbal,SGGBAL)(character*,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*);
extern void F_FUNC(dgghrd,DGGHRD)(character*,character*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*);
extern void F_FUNC(sgghrd,SGGHRD)(character*,character*,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*);
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)(character*,character*,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*);
extern void F_FUNC(sormqr,SORMQR)(character*,character*,int*,int*,int*,float*,int*,float*,float*,int*,float*,int*,int*);
/*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 bytes\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)(character*,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*); */
static PyObject *f2py_rout_lapack_dggbal(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,int*,double*,int*,double*,int*,int*,int*,double*,double*,double*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character job = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&job,job_capi,"lapack.dggbal() 1st argument (job) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.dggbal: failed to create array from the 3rd argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.dggbal: failed to create array from the 4th argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (double *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable ilo */
    /* Processing variable ihi */
    /* Processing variable lscale */
    ;
    capi_lscale_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dggbal: failed to create array from the 5th argument `lscale`";
    capi_lscale_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,lscale_Dims,lscale_Rank,  capi_lscale_intent,lscale_capi,capi_errmess);
    if (capi_lscale_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        lscale = (double *)(PyArray_DATA(capi_lscale_as_array));

    /* Processing variable rscale */
    ;
    capi_rscale_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dggbal: failed to create array from the 6th argument `rscale`";
    capi_rscale_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,rscale_Dims,rscale_Rank,  capi_rscale_intent,rscale_capi,capi_errmess);
    if (capi_rscale_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        rscale = (double *)(PyArray_DATA(capi_rscale_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dggbal: failed to create array from the 7th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (double *)(PyArray_DATA(capi_work_as_array));

    /* 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);
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_as_array,capi_b_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    if((PyObject *)capi_rscale_as_array!=rscale_capi) {
        Py_XDECREF(capi_rscale_as_array); }
    }  /* if (capi_rscale_as_array == NULL) ... else of rscale */
    /* End of cleaning variable rscale */
    if((PyObject *)capi_lscale_as_array!=lscale_capi) {
        Py_XDECREF(capi_lscale_as_array); }
    }  /* if (capi_lscale_as_array == NULL) ... else of lscale */
    /* End of cleaning variable lscale */
    /* End of cleaning variable ihi */
    /* End of cleaning variable ilo */
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_a_as_array == NULL) ... else of a */
    /* End of cleaning variable a */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*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 bytes\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)(character*,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*); */
static PyObject *f2py_rout_lapack_sggbal(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,int*,float*,int*,float*,int*,int*,int*,float*,float*,float*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character job = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&job,job_capi,"lapack.sggbal() 1st argument (job) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.sggbal: failed to create array from the 3rd argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (float *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.sggbal: failed to create array from the 4th argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (float *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable ilo */
    /* Processing variable ihi */
    /* Processing variable lscale */
    ;
    capi_lscale_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sggbal: failed to create array from the 5th argument `lscale`";
    capi_lscale_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,lscale_Dims,lscale_Rank,  capi_lscale_intent,lscale_capi,capi_errmess);
    if (capi_lscale_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        lscale = (float *)(PyArray_DATA(capi_lscale_as_array));

    /* Processing variable rscale */
    ;
    capi_rscale_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sggbal: failed to create array from the 6th argument `rscale`";
    capi_rscale_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,rscale_Dims,rscale_Rank,  capi_rscale_intent,rscale_capi,capi_errmess);
    if (capi_rscale_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        rscale = (float *)(PyArray_DATA(capi_rscale_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sggbal: failed to create array from the 7th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (float *)(PyArray_DATA(capi_work_as_array));

    /* 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);
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_as_array,capi_b_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    if((PyObject *)capi_rscale_as_array!=rscale_capi) {
        Py_XDECREF(capi_rscale_as_array); }
    }  /* if (capi_rscale_as_array == NULL) ... else of rscale */
    /* End of cleaning variable rscale */
    if((PyObject *)capi_lscale_as_array!=lscale_capi) {
        Py_XDECREF(capi_lscale_as_array); }
    }  /* if (capi_lscale_as_array == NULL) ... else of lscale */
    /* End of cleaning variable lscale */
    /* End of cleaning variable ihi */
    /* End of cleaning variable ilo */
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_a_as_array == NULL) ... else of a */
    /* End of cleaning variable a */
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    } /*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 bytes\n"
"compz : input bytes\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)(character*,character*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*); */
static PyObject *f2py_rout_lapack_dgghrd(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,character*,int*,int*,int*,double*,int*,double*,int*,double*,int*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character compq = 0;
    PyObject *compq_capi = Py_None;
    character compz = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&compq,compq_capi,"lapack.dgghrd() 1st argument (compq) can't be converted to character");
    if (f2py_success) {
    /* Processing variable compz */
        f2py_success = character_from_pyobj(&compz,compz_capi,"lapack.dgghrd() 2nd argument (compz) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.dgghrd: failed to create array from the 6th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.dgghrd: failed to create array from the 7th argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (double *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable q */
    capi_q_intent |= (capi_overwrite_q?0:F2PY_INTENT_COPY);
    ;
    capi_q_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.dgghrd: failed to create array from the 8th argument `q`";
    capi_q_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,q_Dims,q_Rank,  capi_q_intent,q_capi,capi_errmess);
    if (capi_q_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        q = (double *)(PyArray_DATA(capi_q_as_array));

    /* Processing variable z */
    capi_z_intent |= (capi_overwrite_z?0:F2PY_INTENT_COPY);
    ;
    capi_z_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.dgghrd: failed to create array from the 9th argument `z`";
    capi_z_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,z_Dims,z_Rank,  capi_z_intent,z_capi,capi_errmess);
    if (capi_z_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        z = (double *)(PyArray_DATA(capi_z_as_array));

    /* 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);
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_as_array,capi_b_as_array,capi_q_as_array,capi_z_as_array,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_as_array == NULL) ... else of z */
    /* End of cleaning variable z */
    }  /* if (capi_q_as_array == NULL) ... else of q */
    /* End of cleaning variable q */
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_a_as_array == 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 */
    } /*if (f2py_success) of compz*/
    /* End of cleaning variable compz */
    } /*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 bytes\n"
"compz : input bytes\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)(character*,character*,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*); */
static PyObject *f2py_rout_lapack_sgghrd(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,character*,int*,int*,int*,float*,int*,float*,int*,float*,int*,float*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character compq = 0;
    PyObject *compq_capi = Py_None;
    character compz = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&compq,compq_capi,"lapack.sgghrd() 1st argument (compq) can't be converted to character");
    if (f2py_success) {
    /* Processing variable compz */
        f2py_success = character_from_pyobj(&compz,compz_capi,"lapack.sgghrd() 2nd argument (compz) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.sgghrd: failed to create array from the 6th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (float *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable b */
    capi_b_intent |= (capi_overwrite_b?0:F2PY_INTENT_COPY);
    ;
    capi_b_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.sgghrd: failed to create array from the 7th argument `b`";
    capi_b_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,b_Dims,b_Rank,  capi_b_intent,b_capi,capi_errmess);
    if (capi_b_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        b = (float *)(PyArray_DATA(capi_b_as_array));

    /* Processing variable q */
    capi_q_intent |= (capi_overwrite_q?0:F2PY_INTENT_COPY);
    ;
    capi_q_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.sgghrd: failed to create array from the 8th argument `q`";
    capi_q_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,q_Dims,q_Rank,  capi_q_intent,q_capi,capi_errmess);
    if (capi_q_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        q = (float *)(PyArray_DATA(capi_q_as_array));

    /* Processing variable z */
    capi_z_intent |= (capi_overwrite_z?0:F2PY_INTENT_COPY);
    ;
    capi_z_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.sgghrd: failed to create array from the 9th argument `z`";
    capi_z_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,z_Dims,z_Rank,  capi_z_intent,z_capi,capi_errmess);
    if (capi_z_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        z = (float *)(PyArray_DATA(capi_z_as_array));

    /* 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);
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_as_array,capi_b_as_array,capi_q_as_array,capi_z_as_array,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_as_array == NULL) ... else of z */
    /* End of cleaning variable z */
    }  /* if (capi_q_as_array == NULL) ... else of q */
    /* End of cleaning variable q */
    }  /* if (capi_b_as_array == NULL) ... else of b */
    /* End of cleaning variable b */
    }  /* if (capi_a_as_array == 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 */
    } /*if (f2py_success) of compz*/
    /* End of cleaning variable compz */
    } /*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_as_array = 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_as_array = 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_as_array = 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;
    const char * capi_errmess = "lapack.lapack.dorgqr: failed to create array from the 4th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dorgqr: failed to create array from the 5th argument `tau`";
    capi_tau_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,tau_Dims,tau_Rank,  capi_tau_intent,tau_capi,capi_errmess);
    if (capi_tau_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        tau = (double *)(PyArray_DATA(capi_tau_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dorgqr: failed to create array from the 6th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (double *)(PyArray_DATA(capi_work_as_array));

    /* 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_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    if((PyObject *)capi_tau_as_array!=tau_capi) {
        Py_XDECREF(capi_tau_as_array); }
    }  /* if (capi_tau_as_array == NULL) ... else of tau */
    /* End of cleaning variable tau */
    }  /* if (capi_a_as_array == 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_as_array = 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_as_array = 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_as_array = 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;
    const char * capi_errmess = "lapack.lapack.sorgqr: failed to create array from the 4th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (float *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sorgqr: failed to create array from the 5th argument `tau`";
    capi_tau_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,tau_Dims,tau_Rank,  capi_tau_intent,tau_capi,capi_errmess);
    if (capi_tau_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        tau = (float *)(PyArray_DATA(capi_tau_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sorgqr: failed to create array from the 6th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (float *)(PyArray_DATA(capi_work_as_array));

    /* 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_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    if((PyObject *)capi_tau_as_array!=tau_capi) {
        Py_XDECREF(capi_tau_as_array); }
    }  /* if (capi_tau_as_array == NULL) ... else of tau */
    /* End of cleaning variable tau */
    }  /* if (capi_a_as_array == 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 bytes\n"
"trans : input bytes\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)(character*,character*,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*); */
static PyObject *f2py_rout_lapack_dormqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,character*,int*,int*,int*,double*,int*,double*,double*,int*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character side = 0;
    PyObject *side_capi = Py_None;
    character trans = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&side,side_capi,"lapack.dormqr() 1st argument (side) can't be converted to character");
    if (f2py_success) {
    /* Processing variable trans */
        f2py_success = character_from_pyobj(&trans,trans_capi,"lapack.dormqr() 2nd argument (trans) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.dormqr: failed to create array from the 6th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (double *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dormqr: failed to create array from the 7th argument `tau`";
    capi_tau_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,tau_Dims,tau_Rank,  capi_tau_intent,tau_capi,capi_errmess);
    if (capi_tau_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        tau = (double *)(PyArray_DATA(capi_tau_as_array));

    /* Processing variable c */
    capi_c_intent |= (capi_overwrite_c?0:F2PY_INTENT_COPY);
    ;
    capi_c_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.dormqr: failed to create array from the 8th argument `c`";
    capi_c_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,c_Dims,c_Rank,  capi_c_intent,c_capi,capi_errmess);
    if (capi_c_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        c = (double *)(PyArray_DATA(capi_c_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.dormqr: failed to create array from the 9th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (double *)(PyArray_DATA(capi_work_as_array));

    /* 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);
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_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    }  /* if (capi_c_as_array == NULL) ... else of c */
    /* End of cleaning variable c */
    if((PyObject *)capi_tau_as_array!=tau_capi) {
        Py_XDECREF(capi_tau_as_array); }
    }  /* if (capi_tau_as_array == NULL) ... else of tau */
    /* End of cleaning variable tau */
    if((PyObject *)capi_a_as_array!=a_capi) {
        Py_XDECREF(capi_a_as_array); }
    }  /* if (capi_a_as_array == 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 */
    } /*if (f2py_success) of trans*/
    /* End of cleaning variable trans */
    } /*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 bytes\n"
"trans : input bytes\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)(character*,character*,int*,int*,int*,float*,int*,float*,float*,int*,float*,int*,int*); */
static PyObject *f2py_rout_lapack_sormqr(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(character*,character*,int*,int*,int*,float*,int*,float*,float*,int*,float*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    character side = 0;
    PyObject *side_capi = Py_None;
    character trans = 0;
    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_as_array = 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_as_array = 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_as_array = 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_as_array = 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 */
        f2py_success = character_from_pyobj(&side,side_capi,"lapack.sormqr() 1st argument (side) can't be converted to character");
    if (f2py_success) {
    /* Processing variable trans */
        f2py_success = character_from_pyobj(&trans,trans_capi,"lapack.sormqr() 2nd argument (trans) can't be converted to character");
    if (f2py_success) {
    /* 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;
    const char * capi_errmess = "lapack.lapack.sormqr: failed to create array from the 6th argument `a`";
    capi_a_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,a_Dims,a_Rank,  capi_a_intent,a_capi,capi_errmess);
    if (capi_a_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        a = (float *)(PyArray_DATA(capi_a_as_array));

    /* Processing variable tau */
    ;
    capi_tau_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sormqr: failed to create array from the 7th argument `tau`";
    capi_tau_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,tau_Dims,tau_Rank,  capi_tau_intent,tau_capi,capi_errmess);
    if (capi_tau_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        tau = (float *)(PyArray_DATA(capi_tau_as_array));

    /* Processing variable c */
    capi_c_intent |= (capi_overwrite_c?0:F2PY_INTENT_COPY);
    ;
    capi_c_intent |= F2PY_INTENT_IN|F2PY_INTENT_OUT;
    const char * capi_errmess = "lapack.lapack.sormqr: failed to create array from the 8th argument `c`";
    capi_c_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,c_Dims,c_Rank,  capi_c_intent,c_capi,capi_errmess);
    if (capi_c_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        c = (float *)(PyArray_DATA(capi_c_as_array));

    /* Processing variable work */
    ;
    capi_work_intent |= F2PY_INTENT_IN;
    const char * capi_errmess = "lapack.lapack.sormqr: failed to create array from the 9th argument `work`";
    capi_work_as_array = ndarray_from_pyobj(  NPY_FLOAT,1,work_Dims,work_Rank,  capi_work_intent,work_capi,capi_errmess);
    if (capi_work_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = lapack_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        work = (float *)(PyArray_DATA(capi_work_as_array));

    /* 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);
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_as_array,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_as_array!=work_capi) {
        Py_XDECREF(capi_work_as_array); }
    }  /* if (capi_work_as_array == NULL) ... else of work */
    /* End of cleaning variable work */
    }  /* if (capi_c_as_array == NULL) ... else of c */
    /* End of cleaning variable c */
    if((PyObject *)capi_tau_as_array!=tau_capi) {
        Py_XDECREF(capi_tau_as_array); }
    }  /* if (capi_tau_as_array == NULL) ... else of tau */
    /* End of cleaning variable tau */
    if((PyObject *)capi_a_as_array!=a_capi) {
        Py_XDECREF(capi_a_as_array); }
    }  /* if (capi_a_as_array == 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 */
    } /*if (f2py_success) of trans*/
    /* End of cleaning variable trans */
    } /*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,0,(char *)  F_FUNC(dggbal,DGGBAL),  (f2py_init_func)f2py_rout_lapack_dggbal,doc_f2py_rout_lapack_dggbal},
    {"sggbal",-1,{{-1}},0,0,(char *)  F_FUNC(sggbal,SGGBAL),  (f2py_init_func)f2py_rout_lapack_sggbal,doc_f2py_rout_lapack_sggbal},
    {"dgghrd",-1,{{-1}},0,0,(char *)  F_FUNC(dgghrd,DGGHRD),  (f2py_init_func)f2py_rout_lapack_dgghrd,doc_f2py_rout_lapack_dgghrd},
    {"sgghrd",-1,{{-1}},0,0,(char *)  F_FUNC(sgghrd,SGGHRD),  (f2py_init_func)f2py_rout_lapack_sgghrd,doc_f2py_rout_lapack_sgghrd},
    {"dorgqr",-1,{{-1}},0,0,(char *)  F_FUNC(dorgqr,DORGQR),  (f2py_init_func)f2py_rout_lapack_dorgqr,doc_f2py_rout_lapack_dorgqr},
    {"sorgqr",-1,{{-1}},0,0,(char *)  F_FUNC(sorgqr,SORGQR),  (f2py_init_func)f2py_rout_lapack_sorgqr,doc_f2py_rout_lapack_sorgqr},
    {"dormqr",-1,{{-1}},0,0,(char *)  F_FUNC(dormqr,DORMQR),  (f2py_init_func)f2py_rout_lapack_dormqr,doc_f2py_rout_lapack_dormqr},
    {"sormqr",-1,{{-1}},0,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.26.1");
    PyDict_SetItemString(d, "__version__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString(
        "This module 'lapack' is auto-generated with f2py (version:1.26.1).\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.26.1");
    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
