ó
Ê½÷Xc           @` sÒ   d  Z  d d l m Z m Z m Z d d l Z d d l Z yR e j ƒ  @ e j d e	 ƒ d d l
 Z
 d d l
 m Z e
 j d ƒ Z Wd QXWn e k
 rŸ n Xd „  Z d Z d	 „  Z e d
 k rÎ e ƒ  n  d S(   sÉ   Precompute the polynomials for the asymptotic expansion of the
generalized exponential integral.

Sources
-------
[1] NIST, Digital Library of Mathematical Functions,
    http://dlmf.nist.gov/8.20#ii

i    (   t   divisiont   print_functiont   absolute_importNt   ignore(   t   Polyt   xc         C` sw   t  d t ƒ g } x^ t |  ƒ D]P } | j t  d d | t t ƒ | | t  t t d ƒ | | j ƒ  ƒ q W| S(   Ni   i   (   R   R   t   ranget   appendt   diff(   t   Kt   At   k(    (    sA   /tmp/pip-build-7oUkmx/scipy/scipy/special/_precompute/expn_asy.pyt
   generate_A   s    Nse   /* This file was automatically generated by _precompute/expn_asy.py.
 * Do not edit it manually!
 */
c          C` s  t  t ƒ t j j d d d ƒ }  d } t | ƒ } t |  d d ƒ ,} | j t ƒ | j d j	 t
 | ƒ ƒ ƒ xj t | ƒ D]\ \ } } d j g  | j ƒ  D] } t | j d	 ƒ ƒ ^ qŸ ƒ } | j d
 j	 | | ƒ ƒ q€ Wd j g  t | d ƒ D] } d j	 | ƒ ^ q÷ ƒ } | j d j	 | ƒ ƒ d j g  | D] } t | j ƒ  ƒ ^ q8ƒ } | j d j	 | ƒ ƒ Wd  QXt j |  d |  ƒ d  S(   Ns   ..t   cephess   expn.hi   s   .newt   ws   #define nA {}
s   , i   s   double A{}[] = {{{}}};
i   s   A{}s   double *A[] = {{{}}};
s   int Adegs[] = {{{}}};
(   t   printt   __doc__t   ost   patht   joinR   t   opent   writet   WARNINGt   formatt   lent	   enumeratet   coeffst   strt   evalfR   t   degreet   rename(   t   fnR	   R
   t   fR   t   AkR   t   tmp(    (    sA   /tmp/pip-build-7oUkmx/scipy/scipy/special/_precompute/expn_asy.pyt   main)   s    
75.t   __main__(   R   t
   __future__R    R   R   R   t   warningst   catch_warningst   simplefiltert   DeprecationWarningt   sympyR   t   symbolsR   t   ImportErrorR   R   R#   t   __name__(    (    (    sA   /tmp/pip-build-7oUkmx/scipy/scipy/special/_precompute/expn_asy.pyt   <module>	   s    		