11 #ifndef RD_MULTIFPBREADER_H_APR2016 12 #define RD_MULTIFPBREADER_H_APR2016 24 #include <boost/tuple/tuple.hpp> 25 #include <boost/foreach.hpp> 56 typedef boost::tuple<double, unsigned int, unsigned int>
ResultTuple;
58 : df_init(false), df_initOnSearch(false), df_takeOwnership(false){};
67 df_initOnSearch(initOnSearch),
68 df_takeOwnership(false){};
76 MultiFPBReader(std::vector<FPBReader *> &readers,
bool takeOwnership =
false,
77 bool initOnSearch =
false);
81 if (df_takeOwnership) {
82 BOOST_FOREACH (
FPBReader *rdr, d_readers) {
delete rdr; };
96 unsigned int length()
const {
return d_readers.size(); };
99 unsigned int nBits()
const;
107 FPBReader *getReader(
unsigned int which);
123 d_readers.push_back(rdr);
124 if (df_init) rdr->
init();
125 return d_readers.size();
140 std::vector<ResultTuple> getTanimotoNeighbors(
const boost::uint8_t *bv,
141 double threshold = 0.7,
142 int numThreads = 1)
const;
145 boost::shared_array<boost::uint8_t> bv,
double threshold = 0.7,
146 int numThreads = 1)
const {
147 return getTanimotoNeighbors(bv.get(), threshold, numThreads);
150 std::vector<ResultTuple> getTanimotoNeighbors(
const ExplicitBitVect &ebv,
151 double threshold = 0.7,
152 int numThreads = 1)
const;
168 std::vector<ResultTuple> getTverskyNeighbors(
const boost::uint8_t *bv,
169 double ca,
double cb,
170 double threshold = 0.7,
171 int numThreads = 1)
const;
174 boost::shared_array<boost::uint8_t> bv,
double ca,
double cb,
175 double threshold = 0.7,
int numThreads = 1)
const {
176 return getTverskyNeighbors(bv.get(), ca, cb, threshold, numThreads);
179 std::vector<ResultTuple> getTverskyNeighbors(
const ExplicitBitVect &ebv,
180 double ca,
double cb,
181 double threshold = 0.7,
182 int numThreads = 1)
const;
188 std::vector<std::pair<unsigned int, unsigned int> > getContainingNeighbors(
189 const boost::uint8_t *bv,
int numThreads = 1)
const;
192 boost::shared_array<boost::uint8_t> bv,
int numThreads = 1)
const {
193 return getContainingNeighbors(bv.get(), numThreads);
196 std::vector<std::pair<unsigned int, unsigned int> > getContainingNeighbors(
200 std::vector<FPBReader *> d_readers;
201 bool df_init, df_initOnSearch, df_takeOwnership;
std::vector< ResultTuple > getTanimotoNeighbors(boost::shared_array< boost::uint8_t > bv, double threshold=0.7, int numThreads=1) const
std::vector< std::pair< unsigned int, unsigned int > > getContainingNeighbors(boost::shared_array< boost::uint8_t > bv, int numThreads=1) const
class for reading and searching FPB files
boost::tuple< double, unsigned int, unsigned int > ResultTuple
#define RDKIT_DATASTRUCTS_EXPORT
std::vector< ResultTuple > getTverskyNeighbors(boost::shared_array< boost::uint8_t > bv, double ca, double cb, double threshold=0.7, int numThreads=1) const
class for reading and searching multiple FPB files
void init()
Read the data from the file and initialize internal data structures.
MultiFPBReader(bool initOnSearch)
#define PRECONDITION(expr, mess)
a class for bit vectors that are densely occupied
unsigned int addReader(FPBReader *rdr)
adds a new FPBReader to our list
contains a simple class for reading and searching FPB files
unsigned int length() const
returns the number of readers