
Xc        -   @` s  d  Z  d d l m Z m Z m Z d d d !Z d d l m Z e j a d d l	 Z	 d d l
 Z
 d d l Z d d	 l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. m/ Z/ m0 Z0 m1 Z1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE mF ZF mG ZG mH ZH mI ZI d d
 l mJ ZJ d d l mK ZK d d l mL ZL d d l mM ZM d d l mN ZN d d l mO ZO i  aP i  ZQ xc d d d d d d d d d d d d d d d d d  d! d" d# d$ d% d& d' d( g D] ZR d) eQ eR <qWi d* e
 jS e
 jT e
 j
     d+ d, d- e d.  d/ e d0  d1 e d2  d3 e d4  d5 e d6  d7 e d8  d9 e d:  d; e d<  d= e d>  d? e d@  dA e dB  dC e dD  dE e dF  dG e dH  dI e dJ  dK dL dM 6i dG d  6dG d! 6dN 6dO dP dQ g d  6dR dS dT dU g d! 6ZU i
 dV dW 6dX d 6dY d# 6dZ d" 6d[ d( 6d\ d$ 6d] d& 6d^ d  6d^ d! 6i d_ e 6d^ eE e  6d` 6g ZV i eQ dN 6da dW 6db d" 6dc d$ 6dd d# 6de df 6dg dh 6di dj 6dk dl dm g dn 6i do e 6d 6dp dq g d  6dr ds dT g d! 6ZW i/ i d) dt 6d) du 6d) d 6d) dv 6d) dw 6dx dy 6d) dz 6d) d{ 6d) d| 6d) d} 6d~ d 6d) d 6d) d 6d) d 6d) d 6d) d 6dN 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d d 6d d 6d^ d 6d^ d 6d^ d 6d^ d 6d dz 6d d{ 6d d| 6d d} 6d d 6d d 6d d 6d d 6d^ d 6d^ d 6d^ d 6d d 6d g d 6d d 6d g d 6d d 6d dv 6d du 6d dw 6d dt 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6d^ d 6i d e 6d^ eE e  6d 6i d d 6d d 6d^ d 6eE e2  d 6i d d 6d d 6d^ d 6e2 d 6i d d 6i d eD eE eF e2 e$   eE e   6d eD eE e2  e$ eE e   6d^ e2 6d^ e 6d 6i d eE eF e2 e$ e   6d eD eE e2  e$ eE e   6d eD eE e2  e  6d 6i d eD eE eF e2 e$   eE e   6dn 6i d g e 6i d e 6i d e< 6i d e 6i d eE eF e e   6i d e< 6i d e 6g dt 6eD e: eE e;   d 6i d d 6i d eE eF e2 e   6d^ e 6d 6i d eE eF e2 e   6d e 6d 6i d eE eF e2 e   6d 6i d d g eE eF e2 e   6dn 6i d g e 6i d e 6i d e< 6i d eE eF e e   6i d e 6i d e< 6i d e 6g dt 6e! d 6i d d 6i d eE eF e2 e   6d^ e 6d 6i d eE eF e2 e   6d e 6d 6i d eE eF e2 e   6d 6i d d g eE eF e2 e   6dn 6i d g e 6i d e 6i d e< 6i d eE eF e e   6i d e 6i d e< 6i d e 6g dt 6e; d 6i d d 6i d eE e'  6d 6d d| 6d i d e 6g d 6i d eD e e9  6i d eD e eE e9   6g dt 6eD e  eE e!   d 6i	 i d eD eE eF e2 e$   eE e   6d eD eE e2  e$ eE e   6d^ e 6d 6i d eD eE eF e2 e$   eE e   6d eD eE e2  e$ eE e   6d e 6d 6i d e 6d eE e  6i d e 6g d 6i d e 6i d e< 6i d e 6i d eE eF e e   6i d e< 6i d e 6i d eD e e  6i d eD e eE e   6g dt 6i d e 6d 6i d eE e  6i d e 6i d e1 6i d e/ 6g dn 6i d eE e'  6d 6i d e 6d eE eF e e'   6d 6eD e  eE e9  eE e!   d 6i
 d d 6i d eE eF e2 e$   6d eD eE e2  e$  6d 6d d g d 6d d 6d d d d d d d d i d e 6i d e< 6d i d e< 6i d e 6i d e 6d g dt 6d d 6d d 6d d 6d d d g dn 6eD e9 eE e!   d 6i d du 6d dv 6d dw 6e d 6g
 ZX i d e0 6d e. 6d e- 6de> 6deB 6de= 6de@ 6de? 6deC 6deA 6d e6 6ZY i eQ dN 6i di de 6g d 6dd 6eY dn 6i dd 6i d	e 6dn 6i d
e 6d 6eD e5 eE e   d 6i dd 6d d| 6dd 6dd 6eD e5 eE e  e*  d 6i dd 6i de 6d 6e d 6i ddg d 6dg dn 6e7 d 6i dddg d 6di de 6i dl e 6g dn 6e d 6i eD e eE e   d 6i eD e eE e  e)  d 6i d dn 6e" d 6d^ d6i d dn 6e? d 6d^ d6i d dn 6eC d 6d^ d6i d dn 6eA d 6d^ d6i d dn 6e d 6d^ d6i i de 6d 6ddn 6e8 d 6g ZZ i eQ dN 6i di de 6g d 6dd 6d^ d6eY dn 6i i deD e3 e)  6d{ 6i deD e4 e)  6dz 6i d e* 6d| 6i di d e 6g eD e3 e)  6d 6i di d e 6g eD e4 e)  6d 6i d i d eD e e'  6deD e e)  6g e* 6d 6d^ d6i dd 6d d 6eD e) eE e3   d 6i dd 6d!d 6d d 6eD e) e3  d 6i dd 6dd 6e* d 6i i d"e) 6d 6i d#e) 6d 6i d$e) 6d{ 6d%d} 6d&d 6i d'e) 6d 6d(d)d*d+i d,eE e%  6g d 6i d-e) 6d 6i d.e4 6d 6i d.e3 6d 6i d/e) 6d 6i d0e4 6d 6i d0e3 6d 6d1d 6d2dy 6i d3eE e%  6d 6d4d5g dn 6e d 6i i d6eE e%  6i d7e% 6d8i d9i d:eE e%  6g e 6d;g d 6d<d 6d=d>g dn 6e d 6d^ d6i dd 6i d?e 6d 6i d e$ 6d@eE e$  6d 6i de* 6d 6eD e5 eE e   d 6i i d	e 6dn 6eD e5 eE e   d 6i	 d(d 6i d.e4 6d 6i d.e3 6d 6i d0e4 6d 6i d0e3 6d 6i dAe( 6d 6i dBe( 6d 6i dCe( 6dn 6eD e5 eE e  e)  d 6i i dDe 6d^ d6i dEeD e3 eE e   6d^ d6i dFeE e,  6i dGe, 6g d 6dHd 6i dIeE e,  6dn 6eD e5 eE e  e)  d 6d^ d6i i d
e 6d 6eY dn 6eD e5 eE e  e'  d 6d^ d6i i d?e 6d 6eD e5 eE e   d 6d^ d6i dd 6i d e$ 6d@eE e$  6d 6i dJe 6d 6i dKe* 6d 6e d 6i	 d(d 6i d.e4 6d 6i d.e3 6d 6i d0e4 6d 6i d0e3 6d 6i dCe( 6dn 6i dLe( 6d 6i dMe( 6d 6eD e e)  d 6i i dNe 6i dEeD e3 eE e   6dFg d 6dOd 6dIg dn 6eD e e)  d 6d^ d6i i d(e* 6d 6eD e e'  d 6i i de 6d 6eD e e'  d 6d^ d6i i dPe* 6d 6d g dn 6e d 6i i dJe 6d 6e d 6d^ d6i ddd(g d 6d d 6dQd 6i dRe 6d 6i de* 6d 6dg dn 6e7 d 6i dSd 6dTd 6dIdd g dn 6e7 d 6d^ d6i i d.e4 6d 6i d.e3 6d 6i d0e4 6d 6i d0e3 6d 6i dUe( 6d 6i dBe( 6d 6i dCe( 6dn 6eD e7 e)  d 6i eD e7 e'  d 6i i dRe 6d 6e7 d 6d^ d6i ddddVdWg d 6d d 6i dXe* 6d 6ddn 6e d 6i dYd 6dZd 6d[d 6d\d 6d]d 6d^d 6d_d{ 6eD e e+  d 6i d`d 6eD e e+  d 6d^ d6i dad 6dZd 6d[d 6d\d 6dbd 6d^d 6dcd{ 6eD e e&  d 6i d`d 6eD e e&  d 6d^ d6i i de 6i dl e 6g dn 6e d 6d^ d6i d(d 6i d.e4 6d 6i d.e3 6d 6i d0e4 6d 6i d0e3 6d 6eD e e)  d 6i dddei dfe' 6i dge) 6dhi i die) 6i dje' 6i dke 6dlg e 6g d 6dmi dneE eF e* e'   6i doeD e' eE e*   6i dpe 6g d 6e d 6d^ d6i eD e eE e   d 6i eD e eE e  e)  d 6i d dn 6e" d 6d^ d6i d dn 6e? d 6d^ d6i d dn 6eC d 6d^ d6i d dn 6eA d 6d^ d6i d dn 6e d 6d^ d6i i de 6d 6ddn 6e8 d 6g* Z[ i i dqe 6d 6ddn 6i drd 6dsd 6dtdn 6eD e5 eE e   d 6d^ du6i dvd 6dwd 6dxdn 6e7 d 6d^ du6i dydn 6dzd 6d{d 6e d 6d^ du6i d|dn 6d}d 6d~d 6g Z\ d  Z] i
 dd 6dd6dd6dd6dd6dd6dd6dd6dd6dd 6Z^ d  Z_ d S(  sG  

Rules for building C/API module with f2py2e.

Here is a skeleton of a new wrapper function (13Dec2001):

wrapper_function(args)
  declarations
  get_python_arguments, say, `a' and `b'

  get_a_from_python
  if (successful) {

    get_b_from_python
    if (successful) {

      callfortran
      if (successful) {

        put_a_to_python
        if (successful) {

          put_b_to_python
          if (successful) {

            buildvalue = ...

          }

        }

      }

    }
    cleanup_b

  }
  cleanup_a

  return buildvalue

Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.

NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
$Date: 2005/08/30 08:58:42 $
Pearu Peterson

i    (   t   divisiont   absolute_importt   print_functions   $Revision: 1.129 $i
   ii   (   t   __version__N(=   t
   applyrulest	   debugcapit
   dictappendt   errmesst   gentitlet   getargs2t   hascallstatementt   hasexternalst   hasinitvaluet   hasnotet   hasresultnotet   isarrayt   isarrayofstringst	   iscomplext   iscomplexarrayt   iscomplexfunctiont   iscomplexfunction_warnt   isdummyroutinet
   isexternalt
   isfunctiont   isfunction_wrapt   isint1arrayt   isintent_auxt
   isintent_ct   isintent_callbackt   isintent_copyt   isintent_hidet   isintent_inoutt   isintent_nothidet   isintent_outt   isintent_overwritet	   islogicalt   islong_complext   islong_doublet   islong_doublefunctiont   islong_longt   islong_longfunctiont   ismoduleroutinet
   isoptionalt
   isrequiredt   isscalart   issigned_long_longarrayt   isstringt   isstringarrayt   isstringfunctiont   issubroutinet   issubroutine_wrapt   isthreadsafet
   isunsignedt   isunsigned_chart   isunsigned_chararrayt   isunsigned_long_longt   isunsigned_long_longarrayt   isunsigned_shortt   isunsigned_shortarrayt   l_andt   l_nott   l_ort   outmesst   replacet
   stripcomma(   t	   capi_maps(   t   cfuncs(   t   common_rules(   t	   use_rules(   t   f90mod_rules(   t	   func2subrt   declt	   frompyobjt   cleanupfrompyobjt   topyarrt   methodt	   pyobjfromt   closepyobjfromt   freememt   userincludest	   includes0t   includest   typedefst   typedefs_generatedt	   cppmacrosRB   t	   callbackst   latexdoct   restdoct   routine_defst   externroutinest   initf2pywraphookst   commonhookst   initcommonhookst   f90modhookst   initf90modhookss   
s  /* File: #modulename#module.c
 * This file is auto-generated with f2py (version:#f2py_version#).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * See http://cens.ioc.ee/projects/f2py2e/
 * Generation date: s   
 * $Rs   evision:$
 * $Ds{   ate:$
 * Do not edit this file directly unless you know what you are doing!!!
 */

#ifdef __cplusplus
extern "C" {
#endif

s   See f2py2e/cfuncs.py: includess   
#includes#
#includes0#

s,   See f2py2e/rules.py: mod_rules['modulebody']sM   
static PyObject *#modulename#_error;
static PyObject *#modulename#_module;

s   See f2py2e/cfuncs.py: typedefss   
#typedefs#

s(   See f2py2e/cfuncs.py: typedefs_generateds   
#typedefs_generated#

s   See f2py2e/cfuncs.py: cppmacross   
#cppmacros#

s   See f2py2e/cfuncs.py: cfuncss   
#cfuncs#

s"   See f2py2e/cfuncs.py: userincludess   
#userincludes#

s"   See f2py2e/capi_rules.py: usercodes9   
#usercode#

/* See f2py2e/rules.py */
#externroutines#

s#   See f2py2e/capi_rules.py: usercode1s   
#usercode1#

s%   See f2py2e/cb_rules.py: buildcallbacks   
#callbacks#

s   See f2py2e/rules.py: buildapis	   
#body#

s&   See f2py2e/f90mod_rules.py: buildhookss   
#f90modhooks#

s/   See f2py2e/rules.py: module_rules['modulebody']s   

s&   See f2py2e/common_rules.py: buildhookss   
#commonhooks#

s   See f2py2e/rules.pys  

static FortranDataDef f2py_routine_defs[] = {
#routine_defs#
	{NULL}
};

static PyMethodDef f2py_module_methods[] = {
#pymethoddef#
	{NULL,NULL}
};

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

#if PY_VERSION_HEX >= 0x03000000
#define RETVAL m
PyMODINIT_FUNC PyInit_#modulename#(void) {
#else
#define RETVAL
PyMODINIT_FUNC init#modulename#(void) {
#endif
	int i;
	PyObject *m,*d, *s;
#if PY_VERSION_HEX >= 0x03000000
	m = #modulename#_module = PyModule_Create(&moduledef);
#else
	m = #modulename#_module = Py_InitModule("#modulename#", f2py_module_methods);
#endif
	Py_TYPE(&PyFortran_Type) = &PyType_Type;
	import_array();
	if (PyErr_Occurred())
		{PyErr_SetString(PyExc_ImportError, "can't initialize module #modulename# (failed to import numpy)"); return RETVAL;}
	d = PyModule_GetDict(m);
	s = PyString_FromString("$Rs  evision: $");
	PyDict_SetItemString(d, "__version__", s);
#if PY_VERSION_HEX >= 0x03000000
	s = PyUnicode_FromString(
#else
	s = PyString_FromString(
#endif
		"This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\nFunctions:\n"
#docs#".");
	PyDict_SetItemString(d, "__doc__", s);
	#modulename#_error = PyErr_NewException ("#modulename#.error", NULL, NULL);
	Py_DECREF(s);
	for(i=0;f2py_routine_defs[i].name!=NULL;i++)
		PyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));
#initf2pywraphooks#
#initf90modhooks#
#initcommonhooks#
#interface_usercode#

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

	return RETVAL;
}
#ifdef __cplusplus
}
#endif
t
   modulebodyt   separatorsfors*   \section{Module \texttt{#texmodulename#}}
s
   #modnote#
s
   #latexdoc#s   Module #modulename#
t   =iP   s
   
#restdoc#s   /*eof body*/t   bodys   /*eof method*/s   /*eof externroutines*/s   /*eof routine_defs*/s   /*eof initf90modhooks*/s   /*eof initf2pywraphooks*/s   /*eof initcommonhooks*/t    s   #note#t   modnotes  
#begintitle#
static char doc_#apiname#[] = "\
#docreturn##name#(#docsignatureshort#)\n\nWrapper for ``#name#``.\
\n#docstrsigns#";
/* #declfortranroutine# */
static PyObject *#apiname#(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           #functype# (*f2py_func)(#callprotoargument#)) {
	PyObject * volatile capi_buildvalue = NULL;
	volatile int f2py_success = 1;
#decl#
	static char *capi_kwlist[] = {#kwlist##kwlistopt##kwlistxa#NULL};
#usercode#
#routdebugenter#
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
	if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
		"#argformat##keyformat##xaformat#:#pyname#",\
		capi_kwlist#args_capi##keys_capi##keys_xa#))
		return NULL;
#frompyobj#
/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
#callfortranroutine#
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("#returnformat#"#return#);
/*closepyobjfrom*/
#closepyobjfrom#
		} /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
#cleanupfrompyobj#
	if (capi_buildvalue == NULL) {
#routdebugfailure#
	} else {
#routdebugleave#
	}
	CFUNCSMESS("Freeing memory.\n");
#freemem#
#ifdef F2PY_REPORT_ATEXIT
f2py_stop_clock();
#endif
	return capi_buildvalue;
}
#endtitle#
s   #routine_def#s   #initf2pywraphook#s   #declfortranroutine#s!   #docreturn##name#(#docsignature#)t   docs&   #docreturn##name#(#docsignatureshort#)t   docshorts'   "	#docreturn##name#(#docsignature#)\n"
t   docss   arrayobject.ht
   CFUNCSMESSt   MINMAXt   needs   #define DEBUGCFUNCSs1   \subsection{Wrapper function \texttt{#texname#}}
sk   
\noindent{{}\verb@#docreturn##name#@{}}\texttt{(#latexdocsignatureshort#)}
#routnote#

#latexdocstrsigns#
s   Wrapped function ``#name#``
t   -t   callfortranroutinet   routdebugentert   routdebugleavet   routdebugfailures    || t	   setjmpbuft	   docstrreqt	   docstroptt	   docstroutt	   docstrcbss   \n"
"t   docstrsignst   latexdocstrsignst   latexdocstrreqt   latexdocstroptt   latexdocstroutt   latexdocstrcbst   kwlistt	   kwlistoptt   callfortrant   callfortranappendt   docsignt
   docsignopts   /*decl*/s   /*freemem*/t   docsignshortt   docsignoptshorts   \nParameters\n----------s$   \nOther Parameters\n----------------s   \nReturns\n-------s'   \nNotes\n-----\nCall-back functions::\ns   \noindent Required arguments:s   \noindent Optional arguments:s   \noindent Return objects:s   \noindent Call-back functions:t	   args_capit	   keys_capit   functypes   /*frompyobj*/s   /*end of cleanupfrompyobj*/s   /*pyobjfrom*/s   /*end of closepyobjfrom*/s   /*topyarr*/s   /*routdebugleave*/s   /*routdebugenter*/s   /*routdebugfailure*/s   /*callfortranroutine*/t	   argformatt	   keyformatt   need_cfuncst	   docreturnt   returnt   returnformatt   rformatt   kwlistxat   keys_xat   xaformatt	   docsignxat   docsignxashortt   initf2pywraphooks
   --- #note#t   routnotes   f2py_rout_#modulename#_#name#t   apinames   #modulename#.#name#t   pynamet   _checks-   f2py_rout_#modulename#_#f90modulename#_#name#s#   #modulename#.#f90modulename#.#name#t   voidsG   extern void #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);s/   extern void #fortranname#(#callprotoargument#);t   declfortranroutinesn   	{"#name#",-1,{{-1}},0,(char *)#F_FUNC#(#fortranname#,#FORTRANNAME#),(f2py_init_func)#apiname#,doc_#apiname#},sV   	{"#name#",-1,{{-1}},0,(char *)#fortranname#,(f2py_init_func)#apiname#,doc_#apiname#},sE   	{"#name#",-1,{{-1}},0,NULL,(f2py_init_func)#apiname#,doc_#apiname#},t   routine_deft   F_FUNCsR   	fprintf(stderr,"debug-capi:Fortran subroutine `#fortranname#(#callfortran#)'\n");s4   		if (#setjmpbuf#) {
			f2py_success = 0;
		} else {s   			Py_BEGIN_ALLOW_THREADSs9   				#callstatement#;
				/*(*f2py_func)(#callfortran#);*/s    				(*f2py_func)(#callfortran#);s   			Py_END_ALLOW_THREADSs   		}sF   extern void #F_WRAPPEDFUNC#(#name_lower#,#NAME#)(#callprotoargument#);sm   	{"#name#",-1,{{-1}},0,(char *)#F_WRAPPEDFUNC#(#name_lower#,#NAME#),(f2py_init_func)#apiname#,doc_#apiname#},s  
    {
      extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void);
      PyObject* o = PyDict_GetItemString(d,"#name#");
      PyObject_SetAttrString(o,"_cpointer", F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL));
#if PY_VERSION_HEX >= 0x03000000
      PyObject_SetAttrString(o,"__name__", PyUnicode_FromString("#name#"));
#else
      PyObject_SetAttrString(o,"__name__", PyString_FromString("#name#"));
#endif
    }
    t   F_WRAPPEDFUNCsY   	fprintf(stderr,"debug-capi:Fortran subroutine `f2pywrap#name_lower#(#callfortran#)'\n");s1   	if (#setjmpbuf#) {
		f2py_success = 0;
	} else {s   	Py_BEGIN_ALLOW_THREADSs   	(*f2py_func)(#callfortran#);s3   	#callstatement#;
	/*(*f2py_func)(#callfortran#);*/s   	Py_END_ALLOW_THREADSs   	}s  
    {
      extern void #F_FUNC#(#name_lower#,#NAME#)(void);
      PyObject* o = PyDict_GetItemString(d,"#name#");
      PyObject_SetAttrString(o,"_cpointer", F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL));
#if PY_VERSION_HEX >= 0x03000000
      PyObject_SetAttrString(o,"__name__", PyUnicode_FromString("#name#"));
#else
      PyObject_SetAttrString(o,"__name__", PyString_FromString("#name#"));
#endif
    }
    s   #ctype#s   #rname#,s   #pydocsignout#s"   \item[]{{}\verb@#pydocsignout#@{}}s   --- #resultnote#s   #ifdef USESCOMPAQFORTRAN
	fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callcompaqfortran#)\n");
#else
	fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\n");
#endif
sW   	fprintf(stderr,"debug-capi:Fortran function #ctype# #fortranname#(#callfortran#)\n");
sJ   extern #ctype# #F_FUNC#(#fortranname#,#FORTRANNAME#)(#callprotoargument#);s2   extern #ctype# #fortranname#(#callprotoargument#);s#   	#ctype# #name#_return_value={0,0};s   	#ctype# #name#_return_value=0;s.   	PyObject *#name#_return_value_capi = Py_None;sJ   	#callstatement#;
/*	#name#_return_value = (*f2py_func)(#callfortran#);*/
s3   	#name#_return_value = (*f2py_func)(#callfortran#);sV   	fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value.r,#name#_return_value.i);s>   	fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value);sE   	#name#_return_value_capi = pyobj_from_#ctype#1(#name#_return_value);s   pyobj_from_#ctype#1t	   long_longt   long_doubles	   #rformat#s   ,#name#_return_value_capis   ,#name#_return_values$   	#ctype# #name#_return_value = NULL;s!   	int #name#_return_value_len = 0;s,   #name#_return_value,#name#_return_value_len,s%   	#name#_return_value_len = #rlength#;s`   	if ((#name#_return_value = (string)malloc(sizeof(char)*(#name#_return_value_len+1))) == NULL) {s6   		PyErr_SetString(PyExc_MemoryError, "out of memory");s   		f2py_success = 0;s	   	} else {s8   		(#name#_return_value)[#name#_return_value_len] = '\0';s   	if (f2py_success) {s   		Py_BEGIN_ALLOW_THREADSsj   #ifdef USESCOMPAQFORTRAN
		(*f2py_func)(#callcompaqfortran#);
#else
		(*f2py_func)(#callfortran#);
#endif
s   		Py_END_ALLOW_THREADSsW   		fprintf(stderr,"#routdebugshowvalue#\n",#name#_return_value_len,#name#_return_value);s/   	} /* if (f2py_success) after (string)malloc */s!   	STRINGFREE(#name#_return_value);t
   STRINGFREEsZ   	fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#(#docsignature#)\n");sW   	fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: successful.\n");sT   	fprintf(stderr,"debug-capi:Python C/API function #modulename#.#name#: failure.\n");t   complex_long_doublet   unsigned_chart   unsigned_shortt   unsignedt   unsigned_long_longs.   	/* Processing auxiliary variable #varname# */s$   	fprintf(stderr,"#vardebuginfo#\n");s)   	/* End of cleaning variable #varname# */s   	#ctype# #varname# = 0;s   math.hs   	#varname# = #init#;s
   ,#varname#s   #outvarname#,s   #varrformat#s   	#ctype# #varname#;s0   	#varname#.r = #init.r#, #varname#.i = #init.i#;s   	#ctype# #varname# = NULL;s   	int slen(#varname#);s   len..s   	#ctype# *#varname# = NULL;s1   	npy_intp #varname#_Dims[#rank#] = {#rank*[-1]#};s#   	const int #varname#_Rank = #rank#;t   forcombt   _depends   flen(#varname#),t   strings$   	/* Processing variable #varname# */s   #pydocsign#s   \item[]{{}\verb@#pydocsign#@{}}s   --- See above.t   depends   "#varname#",s
   #varname#,s   #varname#=#showinit#,s   #varname#_extra_args=(),s   #varname#_extra_args,s=   #varname#_extra_args : input tuple, optional\n    Default: ()s
   #cbdocstr#s   \item[] #cblatexdocstr#s}   \item[]{{}\verb@#varname#_extra_args := () input tuple@{}} --- Extra arguments for call-back function {{}\verb@#varname#@{}}.s$   	PyObject *#varname#_capi = Py_None;s)   	PyTupleObject *#varname#_xa_capi = NULL;s+   	PyTupleObject *#varname#_args_capi = NULL;s    	int #varname#_nofargs_capi = 0;s!   	#cbname#_typedef #varname#_cptr;s   "#varname#_extra_args",t   Os   O!s   ,&#varname#_capis!   ,&PyTuple_Type,&#varname#_xa_capis   (setjmp(#cbname#_jmpbuf))s   #varname#_cptr,s   #cbname#s   setjmp.hs   if(F2PyCapsule_Check(#varname#_capi)) {
  #varname#_cptr = F2PyCapsule_AsVoidPtr(#varname#_capi);
} else {
  #varname#_cptr = #cbname#;
}
s  if (#varname#_capi==Py_None) {
  #varname#_capi = PyObject_GetAttrString(#modulename#_module,"#varname#");
  if (#varname#_capi) {
    if (#varname#_xa_capi==NULL) {
      if (PyObject_HasAttrString(#modulename#_module,"#varname#_extra_args")) {
        PyObject* capi_tmp = PyObject_GetAttrString(#modulename#_module,"#varname#_extra_args");
        if (capi_tmp)
          #varname#_xa_capi = (PyTupleObject *)PySequence_Tuple(capi_tmp);
        else
          #varname#_xa_capi = (PyTupleObject *)Py_BuildValue("()");
        if (#varname#_xa_capi==NULL) {
          PyErr_SetString(#modulename#_error,"Failed to convert #modulename#.#varname#_extra_args to tuple.\n");
          return NULL;
        }
      }
    }
  }
  if (#varname#_capi==NULL) {
    PyErr_SetString(#modulename#_error,"Callback #varname# not defined (as an argument or module #modulename# attribute).\n");
    return NULL;
  }
}
s  	#varname#_nofargs_capi = #cbname#_nofargs;
	if (create_cb_arglist(#varname#_capi,#varname#_xa_capi,#maxnofargs#,#nofoptargs#,&#cbname#_nofargs,&#varname#_args_capi,"failed in processing argument list for call-back #varname#.")) {
		jmp_buf #varname#_jmpbuf;s   		fprintf(stderr,"debug-capi:Assuming %d arguments; at most #maxnofargs#(-#nofoptargs#) is expected.\n",#cbname#_nofargs);
		CFUNCSMESSPY("for #varname#=",#cbname#_capi);sE   		fprintf(stderr,"#vardebugshowvalue# (call-back in C).\n",#cbname#);s   		CFUNCSMESS("Saving jmpbuf for `#varname#`.\n");
		SWAP(#varname#_capi,#cbname#_capi,PyObject);
		SWAP(#varname#_args_capi,#cbname#_args_capi,PyTupleObject);
		memcpy(&#varname#_jmpbuf,&#cbname#_jmpbuf,sizeof(jmp_buf));s  		CFUNCSMESS("Restoring jmpbuf for `#varname#`.\n");
		#cbname#_capi = #varname#_capi;
		Py_DECREF(#cbname#_args_capi);
		#cbname#_args_capi = #varname#_args_capi;
		#cbname#_nofargs = #varname#_nofargs_capi;
		memcpy(&#cbname#_jmpbuf,&#varname#_jmpbuf,sizeof(jmp_buf));
	}t   SWAPt   create_cb_arglists3   	fprintf(stderr,"#vardebugshowvalue#\n",#varname#);s   &#varname#,sW   	f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);
	if (f2py_success) {s/   	} /*if (f2py_success) of #varname# pyobjfrom*/s   try_pyarr_from_#ctype#s8   	if (#varname#_capi == Py_None) #varname# = #init#; elses   	if (#varname#_capi != Py_None)s   		f2py_success = #ctype#_from_pyobj(&#varname#,#varname#_capi,"#pyname#() #nth# (#varname#) can't be converted to #ctype#");
	if (f2py_success) {s`   		#varname# = (#ctype#)PyObject_IsTrue(#varname#_capi);
		f2py_success = 1;
	if (f2py_success) {s%   	} /*if (f2py_success) of #varname#*/s   #ctype#_from_pyobjsA   	fprintf(stderr,"#vardebugshowvalue#\n",#varname#.r,#varname#.i);s   ,#varname#_capisY   		f2py_success = try_pyarr_from_#ctype#(#varname#_capi,&#varname#);
		if (f2py_success) {s0   		} /*if (f2py_success) of #varname# pyobjfrom*/sT   	if (#varname#_capi==Py_None) {#varname#.r = #init.r#, #varname#.i = #init.i#;} elses0   	}  /*if (f2py_success) of #varname# frompyobj*/s1   	#varname#_capi = pyobj_from_#ctype#1(#varname#);s   slen(#varname#),sC   	fprintf(stderr,"#vardebugshowvalue#\n",slen(#varname#),#varname#);s   	slen(#varname#) = #length#;
	f2py_success = #ctype#_from_pyobj(&#varname#,&slen(#varname#),#init#,#varname#_capi,"#ctype#_from_pyobj failed in converting #nth# `#varname#' of #pyname# to C #ctype#");
	if (f2py_success) {s?   		STRINGFREE(#varname#);
	}  /*if (f2py_success) of #varname#*/sV   	f2py_success = try_pyarr_from_#ctype#(#varname#_capi,#varname#);
	if (f2py_success) {s*   	PyArrayObject *capi_#varname#_tmp = NULL;s   	int capi_#varname#_intent = 0;s   ,capi_#varname#_tmps"   	int capi_overwrite_#varname# = 1;s   "overwrite_#varname#",t   is   ,&capi_overwrite_#varname#s   overwrite_#varname#=1,s   overwrite_#varname#,s9   overwrite_#varname# : input int, optional\n    Default: 1sH   	capi_#varname#_intent |= (capi_overwrite_#varname#?0:F2PY_INTENT_COPY);s"   	int capi_overwrite_#varname# = 0;s   overwrite_#varname#=0,s9   overwrite_#varname# : input int, optional\n    Default: 0s   	#setdims#;s#   	capi_#varname#_intent |= #intent#;sl   	capi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,Py_None);ss   	capi_#varname#_tmp = array_from_pyobj(#atype#,#varname#_Dims,#varname#_Rank,capi_#varname#_intent,#varname#_capi);s   	if (capi_#varname#_tmp == NULL) {
		if (!PyErr_Occurred())
			PyErr_SetString(#modulename#_error,"failed in converting #nth# `#varname#' of #pyname# to C/Fortran array" );
	} else {
		#varname# = (#ctype# *)(PyArray_DATA(capi_#varname#_tmp));
s!   	if (#varname#_capi == Py_None) {s   	{s   		#ctype# capi_c;s  		int *_i,capi_i=0;
		CFUNCSMESS("#name#: Initializing #varname#=#init#\n");
		if (initforcomb(PyArray_DIMS(capi_#varname#_tmp),PyArray_NDIM(capi_#varname#_tmp),1)) {
			while ((_i = nextforcomb()))
				#varname#[capi_i++] = #init#; /* fortran way */
		} else {
			if (!PyErr_Occurred())
				PyErr_SetString(#modulename#_error,"Initialization of #nth# #varname# failed (initforcomb).");
			f2py_success = 0;
		}
	}
	if (f2py_success) {s=   	}  /*if (capi_#varname#_tmp == NULL) ... else of #varname#*/sY   	if((PyObject *)capi_#varname#_tmp!=#varname#_capi) {
		Py_XDECREF(capi_#varname#_tmp); }s!   		Py_XDECREF(capi_#varname#_tmp);s+   	}  /*if (f2py_success) of #varname# init*/s3   	fprintf(stderr,"debug-capi:Checking `#check#'\n");sN   	CHECKSCALAR(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {s   	} /*CHECKSCALAR(#check#)*/t   CHECKSCALARt   _breaksN   	CHECKSTRING(#check#,"#check#","#nth# #varname#","#varshowvalue#",#varname#) {s   	} /*CHECKSTRING(#check#)*/t   CHECKSTRINGt
   CHECKARRAYs2   	CHECKARRAY(#check#,"#check#","#nth# #varname#") {s   	} /*CHECKARRAY(#check#)*/t   CHECKGENERICs4   	CHECKGENERIC(#check#,"#check#","#nth# #varname#") {s   	} /*CHECKGENERIC(#check#)*/c         C` sW	  t  d |  d  i  } t } t j |   } t i t d 6|  } g  } g  } xy|  d D]m} d; }	 xa |  d D]U }
 |
 d d k s t d  qr n  x, |
 d D]  } | d | k r | }	 Pq q Wqr W|	 s t d	 |  q[ n  |	 g } d
 |	 k rUxX |	 d
 j   D]C \ } } t	 j
 |	  } | d
 =| | d <| | d <| j |  qWn  xp | D]h }	 t |	  \ } } | rt |	  r| j |  q| j |  n  t | |  } t | |  } q\Wq[ Wt j |   \ } } | r| j |  n  t | |  } t | |  } t j |   \ } } | r@| j |  n  t | |  } t | |  } x; | D]3 } t j | |  d | d  } t | |  } qeWt j   } i  } x| j   D]} g  | | <xv| | D]j} d } | t j k rt j | } n.| t j k r t j | } n| t j k r?t j | } n | t j k r^t j | } n | t j k r}t j | } n | t j k rt j | } n | t j k rt j | } nt | t j k rt j | } nU | t j k rt j | } n6 | t j k rt j | } n t d t  |   q| | j |  qWqW| j |  xZ | D]R } d | k r~| d |   sd | k r\t | | |   } t | |  } q\q\Wt t! |  } t" j# j$ t% d | d  } | | d <t& | d  } | j' | d j( d d<   | j)   t  d |  d | f  t% d rt" j# j$ t% d | d d  } t& | d  } | j' d  | j' d j$ | d   | j)   t  d t% d | d f  n  t% d  rt" j# j$ t% d | d d!  } | | d" <t& | d  } | j' d# t  d$ t% k r1| j' d%  n  | j' d j$ | d&   d$ t% k rg| j' d'  n  | j)   t  d( t% d | d f  n  | rt" j# j$ t% d | d)  } | | d* <t& | d  } | j' d+  | j' d, t  | j' d-  g  } x d. j$ |  d j* d  D]y } | r| d/ d k rx5 t+ |  d0 k rm| j | d0  d1  | d0 } q9W| j | d  q| j | d  qWd j$ |  j( d2 d  } | j' |  | j)   t  d3 |  n  | rS	t" j# j$ t% d d4 | d  } | | d* <t& | d  } | j' d5  | j' d6 t  | j' d7  g  } x d. j$ |  d j* d  D] } t+ |  d8 k r| d/ d k r| j | d8  d9  | d8 } x5 t+ |  d0 k r| j | d0  d9  | d0 } qW| j | d  qh| j | d  qhWd j$ |  j( d2 d  } | j' |  | j)   t  d: |  n  | S(=   s   
    Return
    s   	Building module "%s"...
t   namet   f2py_versiont
   interfacedRb   t   blockt	   interfaces1   buildmodule: Expected interface block. Skipping.
sL   buildmodule: Could not found the body of interfaced routine "%s". Skipping.
t   entryt   argst   useRc   s   buildmodule: unknown need %s.
R   t	   buildpatht   coutputt   csrct   wR_   s   	i   t    s&   	Wrote C/API module "%s" to file "%s"
t	   dorestdoct
   modulenames   module.rests   .. -*- rest -*-
s   
RW   s8   	ReST Documentation is saved to file "%s/%smodule.rest"
t
   dolatexdocs
   module.text   ltxs6   %% This file is auto-generated with f2py (version:%s)
t
   shortlatexsO   \documentclass{article}
\usepackage{a4wide}
\begin{document}
\tableofcontents

RV   s   \end{document}s2   	Documentation is saved to file "%s/%smodule.tex"
t   f2py_wrapper_outputt   fsrcs   C     -*- fortran -*-
s8   C     This file is autogenerated with f2py (version:%s)
s<   C     It contains Fortran 77 wrappers to fortran functions.
s   

i    iB   s   
     &s   
     &
s'   	Fortran 77 wrappers are saved to "%s"
s   %s-f2pywrappers2.f90s   !     -*- f90 -*-
s8   !     This file is autogenerated with f2py (version:%s)
s<   !     It contains Fortran 90 wrappers to fortran functions.
iH   s   &
     &s'   	Fortran 90 wrappers are saved to "%s"
Ns     (,   R>   t   defmod_rulesRA   t   modsign2mapR   R   t   NoneR   t   itemst   copyt   deepcopyt   appendt   buildapiR)   R   RC   t
   buildhooksRE   RD   t   buildusevarsRB   t	   get_needst   keysRP   RQ   RO   RR   RS   RT   RU   R]   R[   t   reprt   module_rulest   ost   patht   joint   optionst   opent   writeR?   t   closet   splitt   len(   t   mt   umt   rett	   mod_rulest   vrdt   rdt   funcwrapperst   funcwrappers2t   nt   nbt   bit   bt   nb_listt   kt   at   nb1t   apit   wrapt   art   crt   mrt   ut   needst   codet   ct   rt   fnt   ft   wnt   linest   l(    (    s/   /tmp/pip-build-X4mzal/numpy/numpy/f2py/rules.pyt   buildmodule  sD   
	


(


	

	



#
	
#"

t   stt   ndi   R   i   t   thi   i   i   i   i   i	   c         C` s  t  j |   \ }  } t |   \ } } | t _ |  d } t |   re t d |  d |  d f  n t d |  d  t j |   } t i  |  } xZ t	 D]R } d | k r | d |   s d | k r t
 | | |   } t | |  } q q Wd< \ }	 }
 i  } xX| D]P} t j | | |  } t | |  r@t } n t } t | |  st | |  s|	 d }	 t |	  t |	 d	 d
 | d <q|
 d }
 t |
  t |
 d	 d | d <n
 d | d <| | | <x | D]| } d | k rqn  d | k r| d | |  sd | k rt
 | | | |  } t | |  } d | k rWPqWqqWqWx| D]} t | |  rt } n t } | | } x | D]| } d | k rqn  d | k r| d | |  sd | k rt
 | | | |  } t | |  } d | k rPqqqWd | | k rfxH | | d D]5 } | | d <t
 t | | |  } t | |  } q;WqfqfWt | d t  r| d j   n  t | d t  r| d j   n  t t d i | d d 6| d d 6| d d 6  | d <t t d i | d d 6| d d 6  } | d k r[t t d i | d d 6  | d <n% t d i | d d 6| d 6 | d <| d j d d   | d! <| d! j d" d#  | d! <t t d$ i | d% d% 6| d& d& 6  } t | d&  d k r't t d' i | d% d% 6| d& d& 6  | d( <n
 | | d( <| | d% <t | d) t  ryt t d* i | d) d) 6  d+ | d) <n  g  | d, <g  | d- <x d. d/ d0 d1 g D] } | | k rt | | t  r| d, | | | d, <n  d2 | } | | k rt | | t  r| d- | | d d !d3 g | | d d4 g | d- <qqW| d5 sY| d6 r| d7 } t | t  r| j d8  qt | t  st t | t |  f    | d7 c d8 7<n  t
 t |  } t |   rt d9 | d:  n t d; | d:  | | f S(=   Nt   varss,   			Constructing wrapper function "%s.%s"...
R   R   s(   		Constructing wrapper function "%s"...
R   i    i   i
   s	    argumentt   nths    keywordt   hiddenR   R   t   checkRI   RM   s    #docsign##docsignopt##docsignxa#R   R   R   t   docsignatures   #docsignopt##docsignxa#R   R   Rc   s	   #docsign#t   docsignatureshorts   #docsign#[#docsignopt#]t   _s   \_t   latexdocsignatureshortt   ,s   , s    #callfortran##callfortranappend#R}   R~   s#   #callfortran# 0,#callfortranappend#t   callcompaqfortranR   s   #docreturn#s    = Ru   Rv   Rq   Rr   Rs   Rt   t   latexs   \begin{description}s   \end{description}R   R   R   t   |s   			  %s
Rf   s   		  %s
(   i    i    (   RF   t   assubrR	   RA   t   depargsR)   R>   t   routsign2mapR   t
   rout_rulesR   t   sign2mapR   t	   aux_rulest	   arg_rulesR   R*   R   t   stndt   check_rulest
   isinstancet   listt   reverseR@   R?   R   R   t   strt   AssertionErrort   typet   routine_rules(   t   routR   R   R  t   varR   R   R   R   R   t   nthkt   savevrdR   t   _rulesR   t   optargst   cfsR   R   (    (    s/   /tmp/pip-build-X4mzal/numpy/numpy/f2py/rules.pyR   C  s    	
(	
#
#

,	
,
		$&

(


)
(`   t   __doc__t
   __future__R    R   R   R   Rc   t   versionR   R   t   timeR   t   auxfuncsR   R   R   R   R   R	   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   R0   R1   R2   R3   R4   R5   R6   R7   R8   R9   R:   R;   R<   R=   R>   R?   R@   RA   RB   RC   RD   RE   RF   R   t   sepdictR   t   asctimet	   localtimeR   R   R  R  t   typedef_need_dictR  R  R  R   R  R   (    (    (    s/   /tmp/pip-build-X4mzal/numpy/numpy/f2py/rules.pyt   <module>4   s  	 y	l


!8


#(,


#


#


((



 


































		&&