� �g�Uc @ s� d Z d d l m Z m Z m Z m Z m Z d d l m Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d S( s4 Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for more information. i����( t arrayt asarrayt isscalart eyet dot( t reducec C s t | t | | � � S( s+ Returns the matrix multiplication of A*B*C( R ( t At Bt C( ( s ./filterpy/common/helpers.pyt dot3 s c C s t | t | t | | � � � S( s- Returns the matrix multiplication of A*B*C*D( R ( R R R t D( ( s ./filterpy/common/helpers.pyt dot4 s c G s t t | � S( s8 Returns the matrix multiplication of 2 or more matrices( R R ( t args( ( s ./filterpy/common/helpers.pyt dotn s c C s� | | | | � } | | | d | | d | � } | | | d | | d | � } | | | | | | � } | | d | d | | d S( s^ computes 4th order Runge-Kutta for dy/dx. **Parameters** y : scalar Initial/current value for y x : scalar Initial/current value for x dx : scalar difference in x (e.g. the time step) f : ufunc(y,x) Callable function (y, x) that you supply to compute dy/dx for the specified values. g �?i g @( ( t yt xt dxt ft k1t k2t k3t k4( ( s ./filterpy/common/helpers.pyt runge_kutta4% s ##c C sF t | d t �} | j | | f k rB t d j | | � � � n | S( s� Returns a copy of 'value' as an numpy.array with dtype=float. Throws exception if the array is not dimensioned correctly. Value may be any type which converts to numpy.array (list, np.array, np.matrix, etc) t dtypes must have shape ({},{})( R t floatt shapet Exceptiont format( t valuet dim_xt dim_yt v( ( s ./filterpy/common/helpers.pyt setter>