![]() |
RDKit
Open-source cheminformatics and machine learning.
|
a class for efficiently storing sparse vectors of ints More...
#include <SparseIntVect.h>
Public Types | |
typedef std::map< IndexType, int > | StorageType |
Public Member Functions | |
SparseIntVect () | |
SparseIntVect (IndexType length) | |
initialize with a particular length More... | |
SparseIntVect (const SparseIntVect< IndexType > &other) | |
Copy constructor. More... | |
SparseIntVect (const std::string &pkl) | |
constructor from a pickle More... | |
SparseIntVect (const char *pkl, const unsigned int len) | |
constructor from a pickle More... | |
SparseIntVect & | operator= (const SparseIntVect< IndexType > &other) |
~SparseIntVect () | |
destructor (doesn't need to do anything) More... | |
int | getVal (IndexType idx) const |
return the value at an index More... | |
void | setVal (IndexType idx, int val) |
set the value at an index More... | |
int | operator[] (IndexType idx) const |
support indexing using [] More... | |
IndexType | getLength () const |
returns the length More... | |
int | getTotalVal (bool doAbs=false) const |
unsigned int | size () const |
returns the length More... | |
const StorageType & | getNonzeroElements () const |
returns our nonzero elements as a map(IndexType->int) More... | |
SparseIntVect< IndexType > & | operator&= (const SparseIntVect< IndexType > &other) |
const SparseIntVect< IndexType > | operator& (const SparseIntVect< IndexType > &other) const |
SparseIntVect< IndexType > & | operator|= (const SparseIntVect< IndexType > &other) |
const SparseIntVect< IndexType > | operator| (const SparseIntVect< IndexType > &other) const |
SparseIntVect< IndexType > & | operator+= (const SparseIntVect< IndexType > &other) |
const SparseIntVect< IndexType > | operator+ (const SparseIntVect< IndexType > &other) const |
SparseIntVect< IndexType > & | operator-= (const SparseIntVect< IndexType > &other) |
const SparseIntVect< IndexType > | operator- (const SparseIntVect< IndexType > &other) const |
SparseIntVect< IndexType > & | operator*= (int v) |
SparseIntVect< IndexType > & | operator* (int v) |
SparseIntVect< IndexType > & | operator/= (int v) |
SparseIntVect< IndexType > & | operator/ (int v) |
SparseIntVect< IndexType > & | operator+= (int v) |
SparseIntVect< IndexType > & | operator+ (int v) |
SparseIntVect< IndexType > & | operator-= (int v) |
SparseIntVect< IndexType > & | operator- (int v) |
bool | operator== (const SparseIntVect< IndexType > &v2) const |
bool | operator!= (const SparseIntVect< IndexType > &v2) const |
std::string | toString () const |
returns a binary string representation (pickle) More... | |
void | fromString (const std::string &txt) |
a class for efficiently storing sparse vectors of ints
Definition at line 28 of file SparseIntVect.h.
typedef std::map<IndexType, int> RDKit::SparseIntVect< IndexType >::StorageType |
Definition at line 30 of file SparseIntVect.h.
|
inline |
Definition at line 32 of file SparseIntVect.h.
|
inline |
initialize with a particular length
Definition at line 35 of file SparseIntVect.h.
|
inline |
Copy constructor.
Definition at line 38 of file SparseIntVect.h.
|
inline |
constructor from a pickle
Definition at line 44 of file SparseIntVect.h.
|
inline |
constructor from a pickle
Definition at line 48 of file SparseIntVect.h.
|
inline |
destructor (doesn't need to do anything)
Definition at line 62 of file SparseIntVect.h.
|
inline |
Definition at line 355 of file SparseIntVect.h.
|
inline |
returns the length
Definition at line 108 of file SparseIntVect.h.
Referenced by RDKit::DiceSimilarity(), RDKit::SparseIntVect< IndexType >::size(), and RDKit::TverskySimilarity().
|
inline |
returns our nonzero elements as a map(IndexType->int)
Definition at line 127 of file SparseIntVect.h.
|
inline |
returns the sum of all the elements in the vect the doAbs argument toggles summing the absolute values of the elements
Definition at line 112 of file SparseIntVect.h.
Referenced by RDKit::DiceSimilarity().
|
inline |
return the value at an index
Definition at line 75 of file SparseIntVect.h.
Referenced by RDKit::SparseIntVect< IndexType >::operator[](), and RDKit::updateFromSequence().
|
inline |
Definition at line 328 of file SparseIntVect.h.
|
inline |
Definition at line 162 of file SparseIntVect.h.
|
inline |
this is a "fuzzy" intesection, the final value of each element is equal to the minimum from the two vects.
Definition at line 132 of file SparseIntVect.h.
|
inline |
Definition at line 281 of file SparseIntVect.h.
|
inline |
Definition at line 273 of file SparseIntVect.h.
|
inline |
Definition at line 234 of file SparseIntVect.h.
|
inline |
Definition at line 305 of file SparseIntVect.h.
|
inline |
Definition at line 206 of file SparseIntVect.h.
|
inline |
Definition at line 297 of file SparseIntVect.h.
|
inline |
Definition at line 268 of file SparseIntVect.h.
|
inline |
Definition at line 317 of file SparseIntVect.h.
|
inline |
Definition at line 240 of file SparseIntVect.h.
|
inline |
Definition at line 309 of file SparseIntVect.h.
|
inline |
Definition at line 293 of file SparseIntVect.h.
|
inline |
Definition at line 285 of file SparseIntVect.h.
|
inline |
Definition at line 52 of file SparseIntVect.h.
|
inline |
Definition at line 322 of file SparseIntVect.h.
|
inline |
support indexing using []
Definition at line 105 of file SparseIntVect.h.
References RDKit::SparseIntVect< IndexType >::getVal().
|
inline |
Definition at line 200 of file SparseIntVect.h.
|
inline |
this is a "fuzzy" union, the final value of each element is equal to the maximum from the two vects.
Definition at line 171 of file SparseIntVect.h.
|
inline |
set the value at an index
Definition at line 88 of file SparseIntVect.h.
Referenced by RDKit::updateFromSequence().
|
inline |
returns the length
Definition at line 124 of file SparseIntVect.h.
References RDKit::SparseIntVect< IndexType >::getLength().
|
inline |
returns a binary string representation (pickle)
Definition at line 333 of file SparseIntVect.h.
References ci_SPARSEINTVECT_VERSION, and RDKit::streamWrite().