B
    ž3Rc¨  ã               @   s    d Z G dd„ deƒZedkrdS )z #DOC


c               @   sJ   e Zd ZdZddd„Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dS )ÚBitEnsemblez[  used to store a collection of bits and score
  BitVects (or signatures) against them.

  Nc             C   s   |d k	rt |ƒ| _ng | _d S )N)ÚlistÚ_bits)ÚselfÚbits© r   ú<lib/python3.7/site-packages/rdkit/DataStructs/BitEnsemble.pyÚ__init__   s    zBitEnsemble.__init__c             C   s   t |ƒ| _d S )N)r   r   )r   r   r   r   r   ÚSetBits   s    zBitEnsemble.SetBitsc             C   s   | j  |¡ d S )N)r   Úappend)r   Úbitr   r   r   ÚAddBit    s    zBitEnsemble.AddBitc             C   s
   t | jƒS )N)Útupler   )r   r   r   r   ÚGetBits#   s    zBitEnsemble.GetBitsc             C   s
   t | jƒS )N)Úlenr   )r   r   r   r   Ú
GetNumBits&   s    zBitEnsemble.GetNumBitsc             C   s2   |  ¡ }d}x |  ¡ D ]}||kr|d7 }qW |S )z  other must support GetOnBits() é    é   )Z	GetOnBitsr   )r   ÚotherZoblÚcntr   r   r   r   ÚScoreWithOnBits)   s    zBitEnsemble.ScoreWithOnBitsc             C   s*   d}x |   ¡ D ]}|| r|d7 }qW |S )z" other must support __getitem__() r   r   )r   )r   r   r   r   r   r   r   ÚScoreWithIndex2   s
    zBitEnsemble.ScoreWithIndex)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   r   r   r   r   r   r   r   r   r   r      s   
	r   Ú__main__N)r   Úobjectr   r   r   r   r   r   Ú<module>   s   *