
    i                     h    d dl Z d dlmZ ddlmZ ddlmZmZ  e            Z G d de          Z	dS )	    N)Union   )BaseMetaClass)get_array_type_code_uint32SparseVectorImplc                       e Zd ZdZdedeeej        f         deeej        f         fdZd Z	d Z
ed             Zed	ej        fd
            Zed	efd            Zed	ej        fd            ZdS )SparseVectorz4
    Provides information about sparse vectors.
    num_dimensionsindicesvaluesc                    t          |t          j                  r|j        t          k    rt          j        t          |          }t          |t          j                  st          j        d|          }t	          |          t	          |          k    rt          d          t          j        |||          | _        dS )au  
        Creates and returns a :ref:`SparseVector object <sparsevectorsobj>`.

        The ``num_dimensions`` parameter is the number of dimensions contained
        in the vector.

        The ``indices`` parameter is the indices (zero-based) of non-zero
        values in the vector.

        The ``values`` parameter is the non-zero values stored in the vector.
        dz.indices and values must be of the same length!N)	
isinstancearraytypecodeARRAY_TYPE_CODE_UINT32len	TypeErrorr   from_values_impl)selfr
   r   r   s       f/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/oracledb/sparse_vector.py__init__zSparseVector.__init__.   s    $ 7EK00	C#999k"8'BBG&%+.. 	.[f--Fw<<3v;;&&LMMM%1GV
 



    c                 T    | j         j        }| d| j         d| j         d| j         dS )N(, ))	__class___public_namer
   r   r   )r   cls_names     r   __repr__zSparseVector.__repr__L   sP    >. . .$- . .|. .#{. . .	
r   c                 l    d| j          dt          | j                   dt          | j                   dS )N[r   ])r
   listr   r   r   s    r   __str__zSparseVector.__str__S   sM    $# $ $tDL'9'9 $ $DK  $ $ $	
r   c                 >    |                      |           }||_        |S )N)__new__r   )clsimplvectors      r   
_from_implzSparseVector._from_implY   s    S!!r   returnc                     | j         j        S )zT
        Returns the indices (zero-based) of non-zero values in the vector.
        )r   r   r'   s    r   r   zSparseVector.indices_   s    
 z!!r   c                     | j         j        S )zK
        Returns the number of dimensions contained in the vector.
        )r   r
   r'   s    r   r
   zSparseVector.num_dimensionsf   s    
 z((r   c                     | j         j        S )zC
        Returns the non-zero values stored in the vector.
        )r   r   r'   s    r   r   zSparseVector.valuesm   s    
 z  r   N)__name__
__module____qualname____doc__intr   r&   r   r   r"   r(   classmethodr.   propertyr   r
   r    r   r   r	   r	   )   s        

 tU[()
 dEK'(	
 
 
 
<
 
 

 
 
   [
 " " " " X" ) ) ) ) X) ! ! ! ! X! ! !r   r	   )	metaclass)
r   typingr   baser   	base_implr   r   r   r	   r:   r   r   <module>r?      s   @              C C C C C C C C3355 I! I! I! I! I!] I! I! I! I! I! I!r   