o
    i                     @   s>   d dl Z dd Zdd Zdd Zdd	 Zd
d ZdddZdS )    Nc                 C   s   | d u r	t dS | S )Nr   r   )cupyzerosarg r   _/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/cupyx/scipy/signal/_lti_conversion.py_none_to_empty_2d   s   
r	   c                 C   s   | d ur	t | S d S N)r   
atleast_2dr   r   r   r   _atleast_2d_or_none   s   
r   c                 C   s   | d ur| j S dS )N)NN)shape)Mr   r   r   _shape_or_none   s   r   c                  G   s   | D ]
}|d ur|  S qd S r
   r   )argsr   r   r   r   _choice_not_none   s
   r   c                 C   s*   | j dkr
t|S | j |krtd| S )Nr   z*The input arrays have incompatible shapes.)r   r   r   
ValueError)r   r   r   r   r   _restore   s
   


r   c                 C   s   t t| |||f\} }}}t| \}}t|\}}t|\}}	t|\}
}t|||	}t||}t||
}|du sA|du sA|du rEtdt t| |||f\} }}}t| ||f} t|||f}t|||f}t|||f}| |||fS )a  Check state-space matrices and ensure they are 2-D.

    If enough information on the system is provided, that is, enough
    properly-shaped arrays are passed to the function, the missing ones
    are built from this information, ensuring the correct number of
    rows and columns. Otherwise a ValueError is raised.

    Parameters
    ----------
    A, B, C, D : array_like, optional
        State-space matrices. All of them are None (missing) by default.
        See `ss2tf` for format.

    Returns
    -------
    A, B, C, D : array
        Properly shaped state-space matrices.

    Raises
    ------
    ValueError
        If not enough information on the system was provided.

    Nz%Not enough information on the system.)mapr   r   r   r   r	   r   )ABCDMANAMBNBMCNCMDNDpqrr   r   r   abcd_normalize&   s    

r$   )NNNN)r   r	   r   r   r   r   r$   r   r   r   r   <module>   s    	