TProcura
Biblioteca em C++ para testes paramétricos de algoritmos, e coleção de algoritmos de procura e otimização
Loading...
Searching...
No Matches
TBits Class Reference

#include <TVector.h>

Inheritance diagram for TBits:
Collaboration diagram for TBits:

Public Member Functions

 TBits (int words=0)
 
unsigned int Hash () const
 
TBits operator& (const TBits &other) const
 
TBits operator| (const TBits &other) const
 
TBits operator^ (const TBits &other) const
 
TBits operator~ () const
 
TBitsoperator&= (const TBits &other)
 
TBitsoperator|= (const TBits &other)
 
TBitsoperator^= (const TBits &other)
 
 operator bool () const
 
bool GetBit (int index) const
 
void SetBit (int index, bool value)
 
void SetBits (uint64_t value, int bitIndex, int bitCount)
 
uint64_t GetBits (int bitIndex, int bitCount) const
 
- Public Member Functions inherited from TVector< uint64_t >
TVectoroperator+= (const TVector &o)
 Concatena outro vetor a este.
 
TVectoroperator+= (std::initializer_list< uint64_t > init)
 Adiciona múltiplos elementos ao final do vetor.
 
TVector< uint64_t > & operator+= (const char *str)=delete
 Acrescenta elementos a partir de uma string no formato de lista.
 
 TVector (int size=0)
 Construtor.
 
 TVector (int size, uint64_t const *init)
 Constrói um vetor pré-carregado a partir de um array.
 
virtual ~TVector () noexcept
 Destrutor.
 
 TVector (const TVector &o)
 Construtor de cópia.
 
 TVector (TVector &&o) noexcept
 Construtor de movimentação.
 
 TVector (std::initializer_list< uint64_t > init)
 Constrói um vetor a partir de uma lista de inicialização.
 
 TVector (const char *str)
 Constrói um vetor de inteiros a partir de uma string no formato de lista.
 
TVectoroperator= (const TVector &o)
 Operador de atribuição por cópia.
 
TVectoroperator= (TVector &&o) noexcept
 Operador de atribuição por movimentação.
 
TVector< uint64_t > & Add (uint64_t a)
 
TVector< uint64_t > & Insert (TVector< uint64_t > &v, int index=0)
 Insere um vetor de itens na posição indicada.
 
TVector< uint64_t > & Insert (uint64_t a, int index=0)
 Insere um único elemento na posição indicada.
 
TVector< uint64_t > & Push (uint64_t a)
 
uint64_t & Pop ()
 
uint64_t & operator[] (int i)
 Acesso por índice com auto-expansão.
 
const uint64_t & operator[] (int i) const
 Acesso constante por índice sem modificação de tamanho.
 
uint64_t * Data ()
 Acesso direto.
 
const uint64_t * Data () const
 Acesso direto constante.
 
uint64_t & First ()
 
uint64_t & Last ()
 
int Count () const
 
TVector< uint64_t > & Count (int value)
 Ajusta o tamanho lógico do vetor para value.
 
virtual bool Empty () const
 
uint64_t & Random ()
 
TVector< uint64_t > & BeASet ()
 Converte o vetor num conjunto: remove duplicados e ordena.
 
TVector< uint64_t > & Union (const TVector< uint64_t > &v)
 Realiza a união deste conjunto com outro.
 
TVector< uint64_t > & Intersection (const TVector< uint64_t > &v)
 Interseção deste conjunto com outro.
 
TVector< uint64_t > & Difference (const TVector< uint64_t > &v)
 Diferença deste conjunto em relação a outro.
 
bool Equal (const TVector< uint64_t > &v) const
 Verifica se dois vetores-conjunto são iguais.
 
bool Contained (const TVector< uint64_t > &v) const
 Verifica se este conjunto está contido no outro.
 
TVector< uint64_t > & Delete (int i)
 Remove o elemento na posição i deslocando os seguintes.
 
TVector< uint64_t > & Remove (uint64_t const &i)
 Remove todas as ocorrências de um dado elemento.
 
int Find (uint64_t &i, bool binary=false, int left=0, int right=-1)
 Procura um elemento no vetor.
 
TVector< uint64_t > & Replace (uint64_t const &iold, uint64_t const &inew)
 Substitui todas as ocorrências de um valor antigo por um novo.
 
TVector< uint64_t > & Sort (TVector< int > *idxvect=nullptr)
 Ordena todo o vetor, opcionalmente devolvendo índices ordenados.
 
void Sort (int start, int end=-1)
 Ordena um subintervalo [start,end] do vetor.
 
TVector< uint64_t > & RandomOrder ()
 Coloca os elementos em ordem aleatória (Fisher–Yates shuffle).
 
TVector< uint64_t > & Invert ()
 Inverte a ordem dos elementos no vetor.
 
TVector< uint64_t > & Reset (uint64_t const &i)
 Preenche todo o vetor com um mesmo valor.
 
int Distance (TVector< uint64_t > &v, int type=0)
 Calcula várias métricas de “distância” entre vetores.
 
uint64_t * begin () noexcept
 
const uint64_t * begin () const noexcept
 
uint64_t * end () noexcept
 
const uint64_t * end () const noexcept
 
TVector< uint64_t > & operator+= (const uint64_t &x)
 
TVector< uint64_t > & operator-= (const uint64_t &x)
 

Additional Inherited Members

- Static Public Attributes inherited from TVector< uint64_t >
static uint64_t erro
 Valor retornado em casos de acesso inválido.
 

Detailed Description

Definition at line 1260 of file TVector.h.

Constructor & Destructor Documentation

◆ TBits()

TBits::TBits ( int  words = 0)
inline

Definition at line 1263 of file TVector.h.

Here is the call graph for this function:

Member Function Documentation

◆ GetBit()

bool TBits::GetBit ( int  index) const
inline

Definition at line 1348 of file TVector.h.

Here is the call graph for this function:

◆ GetBits()

uint64_t TBits::GetBits ( int  bitIndex,
int  bitCount 
) const
inline

Definition at line 1355 of file TVector.h.

Here is the call graph for this function:

◆ Hash()

unsigned int TBits::Hash ( ) const
inline

Definition at line 1294 of file TVector.h.

Here is the caller graph for this function:

◆ operator bool()

TBits::operator bool ( ) const
inlineexplicit

Definition at line 1278 of file TVector.h.

Here is the call graph for this function:

◆ operator&()

TBits TBits::operator& ( const TBits other) const
inline

Definition at line 1311 of file TVector.h.

Here is the call graph for this function:

◆ operator&=()

TBits & TBits::operator&= ( const TBits other)
inline

Definition at line 1273 of file TVector.h.

◆ operator^()

TBits TBits::operator^ ( const TBits other) const
inline

Definition at line 1330 of file TVector.h.

Here is the call graph for this function:

◆ operator^=()

TBits & TBits::operator^= ( const TBits other)
inline

Definition at line 1275 of file TVector.h.

◆ operator|()

TBits TBits::operator| ( const TBits other) const
inline

Definition at line 1319 of file TVector.h.

Here is the call graph for this function:

◆ operator|=()

TBits & TBits::operator|= ( const TBits other)
inline

Definition at line 1274 of file TVector.h.

◆ operator~()

TBits TBits::operator~ ( ) const
inline

Definition at line 1341 of file TVector.h.

Here is the call graph for this function:

◆ SetBit()

void TBits::SetBit ( int  index,
bool  value 
)
inline

Definition at line 1368 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBits()

void TBits::SetBits ( uint64_t  value,
int  bitIndex,
int  bitCount 
)
inline

Definition at line 1385 of file TVector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: