12#ifndef RD_REAL_VALUE_VECT_20140407
13#define RD_REAL_VALUE_VECT_20140407
15#include <boost/smart_ptr.hpp>
20class UniformRealValueGrid3D;
32 d_data.resize(d_length, 0.0);
37 d_data.resize(d_length, val);
42 initFromText(pkl.c_str(), pkl.size());
46 RealValueVect(
const char *pkl,
unsigned int len) { initFromText(pkl, len); };
52 double operator[](
unsigned int idx)
const {
return getVal(idx); };
55 void setVal(
unsigned int i,
double val);
61 unsigned int getLength()
const {
return d_length; };
64 unsigned int size()
const {
return getLength(); };
88 void setToVal(
double val) { std::fill(d_data.begin(), d_data.end(), val); }
90 const std::vector<double> &
getData()
const {
return d_data; }
91 std::vector<double> &
getData() {
return d_data; }
94 void initFromText(
const char *pkl,
const unsigned int len);
95 unsigned int d_length = 0;
96 std::vector<double> d_data;
std::vector< double > & getData()
RealValueVect & operator|=(const RealValueVect &other)
in-place operator|
unsigned int size() const
returns the length
double getTotalVal() const
returns the sum of all the elements in the vect
RealValueVect(const char *pkl, unsigned int len)
constructor from a pickle
void setVal(unsigned int i, double val)
set the value at an index
RealValueVect(const std::string &pkl)
constructor from a pickle
RealValueVect & operator-=(const RealValueVect &other)
in-place operator-
unsigned int getLength() const
returns the length
RealValueVect(unsigned int length, double val)
initialize with a particular size and initial value
RealValueVect & operator+=(const RealValueVect &other)
in-place operator+
double getVal(unsigned int i) const
return the value at an index
void setLength(unsigned int sz)
RealValueVect(unsigned int length)
initialize with a particular size
std::string toString() const
returns a binary string representation (pickle)
RealValueVect & operator&=(const RealValueVect &other)
in-place operator&
void setToVal(double val)
double operator[](unsigned int idx) const
support indexing using []
const std::vector< double > & getData() const
bool compareVectors(const RealValueVect &other) const
compares 2 vectors and returns false if different
#define RDKIT_DATASTRUCTS_EXPORT
RDKIT_DATASTRUCTS_EXPORT RealValueVect operator&(const RealValueVect &p1, const RealValueVect &p2)
support rvv3 = rvv1&rvv2
RDKIT_DATASTRUCTS_EXPORT unsigned int computeL1Norm(const DiscreteValueVect &v1, const DiscreteValueVect &v2)
RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect operator-(const DiscreteValueVect &p1, const DiscreteValueVect &p2)
RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect operator+(const DiscreteValueVect &p1, const DiscreteValueVect &p2)
RDKIT_DATASTRUCTS_EXPORT RealValueVect operator|(const RealValueVect &p1, const RealValueVect &p2)
support rvv3 = rvv1|rvv2