RDKit: RDKit::DiscreteValueVect Class Reference

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
RDKit::DiscreteValueVect Class Reference

a class for efficiently storing vectors of discrete values More...

`#include <DiscreteValueVect.h>`

## Public Types
enum | DiscreteValueType { ONEBITVALUE = 0 , TWOBITVALUE , FOURBITVALUE , EIGHTBITVALUE , SIXTEENBITVALUE }
| used to define the possible range of the values More...
typedef boost::shared_array< std::uint32_t > | DATA_SPTR

## Public Member Functions
| DiscreteValueVect (DiscreteValueType valType, unsigned int length)
| initialize with a particular type and size
| DiscreteValueVect (const DiscreteValueVect &other)
| Copy constructor.
DiscreteValueVect & | operator= (const DiscreteValueVect &other)
| DiscreteValueVect (const std::string &pkl)
| constructor from a pickle
| DiscreteValueVect (const char *pkl, const unsigned int len)
| constructor from a pickle
| ~DiscreteValueVect ()=default
unsigned int | getVal (unsigned int i) const
| return the value at an index
int | operator[] (unsigned int idx) const
| support indexing using []
void | setVal (unsigned int i, unsigned int val)
| set the value at an index
unsigned int | getTotalVal () const
| returns the sum of all the elements in the vect
unsigned int | getLength () const
| returns the length
unsigned int | size () const
| returns the length
const std::uint32_t * | getData () const
| return a pointer to our raw data storage
unsigned int | getNumBitsPerVal () const
| return the number of bits used to store each value
DiscreteValueType | getValueType () const
| return the type of value being stored
unsigned int | getNumInts () const
| returns the size of our storage
DiscreteValueVect | operator& (const DiscreteValueVect &other) const
| support dvv3 = dvv1&dvv2
DiscreteValueVect | operator| (const DiscreteValueVect &other) const
| support dvv3 = dvv1|dvv2
DiscreteValueVect & | operator+= (const DiscreteValueVect &other)
DiscreteValueVect & | operator-= (const DiscreteValueVect &other)
std::string | toString () const
| returns a binary string representation (pickle)

## Detailed Description

a class for efficiently storing vectors of discrete values

Definition at line 24 of file DiscreteValueVect.h.

## Member Typedef Documentation

## ◆ DATA_SPTR

typedef boost::shared_array<std::uint32_t> RDKit::DiscreteValueVect::DATA_SPTR

Definition at line 26 of file DiscreteValueVect.h.

## Member Enumeration Documentation

## ◆ DiscreteValueType

enum RDKit::DiscreteValueVect::DiscreteValueType

used to define the possible range of the values

Enumerator
ONEBITVALUE |
TWOBITVALUE |
FOURBITVALUE |
EIGHTBITVALUE |
SIXTEENBITVALUE |

Definition at line 29 of file DiscreteValueVect.h.

## Constructor & Destructor Documentation

## ◆ DiscreteValueVect() [1/4]

RDKit::DiscreteValueVect::DiscreteValueVect | ( | DiscreteValueType | valType,
|  | unsigned int | length )
| inline

initialize with a particular type and size

Definition at line 38 of file DiscreteValueVect.h.

References RDKit::BITS_PER_INT.

Referenced by DiscreteValueVect(), operator&(), operator+=(), operator-=(), operator=(), and operator|().

## ◆ DiscreteValueVect() [2/4]

RDKit::DiscreteValueVect::DiscreteValueVect | ( | const DiscreteValueVect & | other | ) |

Copy constructor.

References DiscreteValueVect().

## ◆ DiscreteValueVect() [3/4]

RDKit::DiscreteValueVect::DiscreteValueVect | ( | const std::string & | pkl | ) |
| inline

constructor from a pickle

Definition at line 55 of file DiscreteValueVect.h.

## ◆ DiscreteValueVect() [4/4]

RDKit::DiscreteValueVect::DiscreteValueVect | ( | const char * | pkl,
|  | const unsigned int | len )
| inline

constructor from a pickle

Definition at line 59 of file DiscreteValueVect.h.

## ◆ ~DiscreteValueVect()

RDKit::DiscreteValueVect::~DiscreteValueVect | ( |  | ) |
| default

## Member Function Documentation

## ◆ getData()

const std::uint32_t * RDKit::DiscreteValueVect::getData | ( |  | ) | const

return a pointer to our raw data storage

## ◆ getLength()

unsigned int RDKit::DiscreteValueVect::getLength | ( |  | ) | const

returns the length

Referenced by size().

## ◆ getNumBitsPerVal()

unsigned int RDKit::DiscreteValueVect::getNumBitsPerVal | ( |  | ) | const
| inline

return the number of bits used to store each value

Definition at line 90 of file DiscreteValueVect.h.

## ◆ getNumInts()

unsigned int RDKit::DiscreteValueVect::getNumInts | ( |  | ) | const
| inline

returns the size of our storage

Definition at line 96 of file DiscreteValueVect.h.

## ◆ getTotalVal()

unsigned int RDKit::DiscreteValueVect::getTotalVal | ( |  | ) | const

returns the sum of all the elements in the vect

## ◆ getVal()

unsigned int RDKit::DiscreteValueVect::getVal | ( | unsigned int | i | ) | const

return the value at an index

Referenced by operator[]().

## ◆ getValueType()

DiscreteValueType RDKit::DiscreteValueVect::getValueType | ( |  | ) | const
| inline

return the type of value being stored

Definition at line 93 of file DiscreteValueVect.h.

## ◆ operator&()

DiscreteValueVect RDKit::DiscreteValueVect::operator& | ( | const DiscreteValueVect & | other | ) | const

support dvv3 = dvv1&dvv2

operator& returns the minimum value for each element. e.g.: [0,1,2,0] & [0,1,1,1] -> [0,1,1,0]

References DiscreteValueVect().

## ◆ operator+=()

DiscreteValueVect & RDKit::DiscreteValueVect::operator+= | ( | const DiscreteValueVect & | other | ) |

References DiscreteValueVect().

## ◆ operator-=()

DiscreteValueVect & RDKit::DiscreteValueVect::operator-= | ( | const DiscreteValueVect & | other | ) |

References DiscreteValueVect().

## ◆ operator=()

DiscreteValueVect & RDKit::DiscreteValueVect::operator= | ( | const DiscreteValueVect & | other | ) |

References DiscreteValueVect().

## ◆ operator[]()

int RDKit::DiscreteValueVect::operator[] | ( | unsigned int | idx | ) | const
| inline

support indexing using []

Definition at line 69 of file DiscreteValueVect.h.

References getVal().

## ◆ operator|()

DiscreteValueVect RDKit::DiscreteValueVect::operator| | ( | const DiscreteValueVect & | other | ) | const

support dvv3 = dvv1|dvv2

operator& returns the maximum value for each element. e.g.: [0,1,2,0] | [0,1,1,1] -> [0,1,2,1]

References DiscreteValueVect().

## ◆ setVal()

void RDKit::DiscreteValueVect::setVal | ( | unsigned int | i,
|  | unsigned int | val )

set the value at an index

NOTE: it is an error to have val > the max value this DiscreteValueVect can accommodate

## ◆ size()

unsigned int RDKit::DiscreteValueVect::size | ( |  | ) | const
| inline

returns the length

Definition at line 84 of file DiscreteValueVect.h.

References getLength().

## ◆ toString()

std::string RDKit::DiscreteValueVect::toString | ( |  | ) | const

returns a binary string representation (pickle)

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

- DiscreteValueVect.h