ó
Ë˝÷Xc           @   s   d  d l  Z d  d l m Z m Z d  d l m Z d  d l j j	 Z
 d   Z d   Z d   Z d Z d Z d	   Z d
   Z d   Z d S(   i˙˙˙˙N(   t   assert_equalt   assert_allclose(   t   odeintc         C   s&   t  j |   } t j | |  |  | S(   N(   t   npt
   zeros_liket	   banded5x5(   t   yt   tt   dydt(    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyt   rhs   s    c         C   sD   t  |   } t j | | f d d } t j | |  d d |  | S(   Nt   ordert   Fi   (   t   lenR   t   zerosR   t   banded5x5_jac(   R   R   t   nt   jac(    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyR      s    c         C   sD   t  |   } t j d | f d d } t j | |  d d |  | S(   Ni   R
   R   i   (   R   R   R   R   t   banded5x5_bjac(   R   R   R   t   bjac(    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyR      s    i   i   c         C   si  |  t  k r! d  } d  } t } n4 |  t k rB d } d } t } n t d |  f   t j d d  } d } d } d } d	 } | t j | d  }	 t t	 | |	 d
 | d | d | d | d | d t
 \ }
 } |
 d } | d d } | d d } | d d } | j   } t j | | | |   \ } } } t | | d d t | | | f | | | f  d  S(   Ni   i   s   invalid jactype: %rg      đ?g      @gdyáýĽ=gvIhÂ%<=g      Ŕ?i@   t   Dfunt   mlt   mut   atolt   rtolt   full_outputi˙˙˙˙t   nstt   nfet   njegę-q=(   t   JACTYPE_FULLt   NoneR   t   JACTYPE_BANDEDR   t
   ValueErrorR   t   arangeR   R	   t   Truet   copyR   t   banded5x5_solveR   R    (   t   jactypeR   R   t   jacobiant   y0R   R   t   dtt   nstepsR   t   solt   infot   yfinalt
   odeint_nstt
   odeint_nfet
   odeint_njet   y1R   R   R   (    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyt   check_odeint    s4    		
!c           C   s   t  t  d  S(   N(   R0   R   (    (    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyt   test_odeint_full_jacF   s    c           C   s   t  t  d  S(   N(   R0   R   (    (    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyt   test_odeint_banded_jacJ   s    (   t   numpyR   t   numpy.testingR    R   t   scipy.integrateR   t#   scipy.integrate._test_odeint_bandedt	   integratet   _test_odeint_bandedR   R	   R   R   R   R   R0   R1   R2   (    (    (    sD   /tmp/pip-build-7oUkmx/scipy/scipy/integrate/tests/test_odeint_jac.pyt   <module>   s   				&	