403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/sympy/matrices/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/sympy/matrices/__pycache__/normalforms.cpython-312.pyc
�

M�Zd���f�dZddlmZddlmZddlmZddlmZ	m
ZmZ
d
d�Zd
d�Zd
d	�Z
dd
d�d�Zy)z,Functions returning normal forms of matrices�)�ZZ)�Poly)�DomainMatrix)�smith_normal_form�invariant_factors�hermite_normal_formNc��t|dd�}|jd��}tj|�}|xs|}|�|j	|�}|S)zConvert Matrix to DomainMatrix�ringNc�F�t|t�r|j�S|S�N)�
isinstancer�as_expr)�es �</usr/lib/python3/dist-packages/sympy/matrices/normalforms.py�<lambda>z_to_domain.<locals>.<lambda>s��Z��4�-@�a�i�i�k��a��)�getattr�	applyfuncr�from_Matrix�
convert_to)�m�domainr
�dMs    r�
_to_domainr
sS���1�f�d�#�D�	���G�H�A�	�	!�	!�!�	$�B�
�^�t�F�
��
�]�]�6�
"��
�Irc�L�t||�}t|�j�S)a�
    Return the Smith Normal Form of a matrix `m` over the ring `domain`.
    This will only work if the ring is a principal ideal domain.

    Examples
    ========

    >>> from sympy import Matrix, ZZ
    >>> from sympy.matrices.normalforms import smith_normal_form
    >>> m = Matrix([[12, 6, 4], [3, 9, 6], [2, 16, 14]])
    >>> print(smith_normal_form(m, domain=ZZ))
    Matrix([[1, 0, 0], [0, 10, 0], [0, 0, -30]])

    )r�_snf�	to_Matrix)rrrs   rrrs#��
�A�v�	�B���8����rc������t||��t��}t�fd�|D��}t|d�r;|jj
r%|j��fd��t�fd�|D��}|S)a9
    Return the tuple of abelian invariants for a matrix `m`
    (as in the Smith-Normal form)

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Smith_normal_form#Algorithm
    .. [2] https://web.archive.org/web/20200331143852/https://sierra.nmsu.edu/morandi/notes/SmithNormalForm.pdf

    c3�T�K�|]}�jj|����!y�wr)r�to_sympy)�.0�frs  �r�	<genexpr>z$invariant_factors.<locals>.<genexpr><s �����;�a�B�I�I�&�&�q�)�;�s�%(r
c�H��t|�j�j��S)N)r)r�symbolsr)r"�Ks �rrz#invariant_factors.<locals>.<lambda>As����Q��	�	�!�(�(� C�rc3�.�K�|]}�|����y�wr�)r!r"�to_polys  �rr#z$invariant_factors.<locals>.<genexpr>Bs�����8�1�G�A�J�8�s�)r�_invf�tuple�hasattrr
�is_PolynomialRing)rr�factorsr&rr)s   @@@rrr.sd���
�A�v�	�B��B�i�G��;�7�;�;�G��q�&���6�6�#�#����A�C�G��8��8�8�G��NrF��D�
check_rankc��|�)tj|�stt|��}t|j||��j�S)a
    Compute the Hermite Normal Form of a Matrix *A* of integers.

    Examples
    ========

    >>> from sympy import Matrix
    >>> from sympy.matrices.normalforms import hermite_normal_form
    >>> m = Matrix([[12, 6, 4], [3, 9, 6], [2, 16, 14]])
    >>> print(hermite_normal_form(m))
    Matrix([[10, 0, 2], [0, 15, 3], [0, 0, 2]])

    Parameters
    ==========

    A : $m \times n$ ``Matrix`` of integers.

    D : int, optional
        Let $W$ be the HNF of *A*. If known in advance, a positive integer *D*
        being any multiple of $\det(W)$ may be provided. In this case, if *A*
        also has rank $m$, then we may use an alternative algorithm that works
        mod *D* in order to prevent coefficient explosion.

    check_rank : boolean, optional (default=False)
        The basic assumption is that, if you pass a value for *D*, then
        you already believe that *A* has rank $m$, so we do not waste time
        checking it for you. If you do want this to be checked (and the
        ordinary, non-modulo *D* algorithm to be used if the check fails), then
        set *check_rank* to ``True``.

    Returns
    =======

    ``Matrix``
        The HNF of matrix *A*.

    Raises
    ======

    DMDomainError
        If the domain of the matrix is not :ref:`ZZ`.

    DMShapeError
        If the mod *D* algorithm is used but the matrix has more rows than
        columns.

    References
    ==========

    .. [1] Cohen, H. *A Course in Computational Algebraic Number Theory.*
       (See Algorithms 2.4.5 and 2.4.8.)

    r/)r�of_type�int�_hnf�_repr)�Ar0r1s   rrrFs=��n	�}�R�Z�Z��]��s�1�v�J������!�
�3�=�=�?�?rr)�__doc__�sympy.polys.domains.integerringr�sympy.polys.polytoolsr�sympy.polys.matricesr� sympy.polys.matrices.normalformsrrrr*rr5rr(rr�<module>r=s7��2�.�&�-���� �&�0!%��9@r

Youez - 2016 - github.com/yon3zu
LinuXploit