Run clang-format against header files (#4143)

This commit is contained in:
Eisuke Kawashima
2021-06-08 14:57:51 +09:00
committed by GitHub
parent 0f18dba0ed
commit 78aac3c1bc
234 changed files with 2920 additions and 2998 deletions

View File

@@ -43,7 +43,7 @@ class Catalog {
typedef paramType paramType_t;
//------------------------------------
Catalog() : dp_cParams(nullptr){};
Catalog() : dp_cParams(nullptr) {}
//------------------------------------
virtual ~Catalog() { delete dp_cParams; }
@@ -107,7 +107,7 @@ class Catalog {
// id of the entry in the catalog.
// this is more along the lines of bitId
unsigned int d_fpLength{0}; //!< the length of our fingerprint
paramType *dp_cParams; //!< our params object
paramType *dp_cParams; //!< our params object
};
//-----------------------------------------------------------------------------

View File

@@ -22,10 +22,10 @@ class RDKIT_CATALOGS_EXPORT CatalogEntry {
virtual ~CatalogEntry() = 0;
//! sets our bit Id
void setBitId(int bid) { d_bitId = bid; };
void setBitId(int bid) { d_bitId = bid; }
//! returns our bit Id
int getBitId() const { return d_bitId; };
int getBitId() const { return d_bitId; }
//! returns a text description of this entry
virtual std::string getDescription() const = 0;

View File

@@ -20,10 +20,10 @@ class RDKIT_CATALOGS_EXPORT CatalogParams {
virtual ~CatalogParams() = 0;
//! returns our type string
std::string getTypeStr() const { return d_typeStr; };
std::string getTypeStr() const { return d_typeStr; }
//! sets our type string
void setTypeStr(const std::string &typeStr) { d_typeStr = typeStr; };
void setTypeStr(const std::string &typeStr) { d_typeStr = typeStr; }
//! serializes (pickles) to a stream
virtual void toStream(std::ostream &) const = 0;

View File

@@ -18,8 +18,8 @@ namespace ChemicalFeatures {
//! abstract base class for chemical feature
class ChemicalFeature {
public:
ChemicalFeature(){};
virtual ~ChemicalFeature(){};
ChemicalFeature() {}
virtual ~ChemicalFeature() {}
// returns the feature id
virtual int getId() const = 0;

View File

@@ -33,10 +33,7 @@ class RDKIT_CHEMICALFEATURES_EXPORT FreeChemicalFeature
//! start with everything blank
FreeChemicalFeature()
:
d_family(""),
d_type(""),
d_position(RDGeom::Point3D(0.0, 0.0, 0.0)) {}
: d_family(""), d_type(""), d_position(RDGeom::Point3D(0.0, 0.0, 0.0)) {}
explicit FreeChemicalFeature(const std::string &pickle) {
this->initFromString(pickle);

View File

@@ -35,7 +35,7 @@ class MetricMatrixCalc {
/*! \brief Default Constructor
*
*/
MetricMatrixCalc(){};
MetricMatrixCalc() {}
/*! \brief Set the metric function
*
@@ -87,7 +87,7 @@ class MetricMatrixCalc {
distMat[itab + j] = dp_metricFunc(descripts[i], descripts[j], dim);
}
}
};
}
private:
// pointer to the metric function

View File

@@ -15,12 +15,12 @@
class RDKIT_DATASTRUCTS_EXPORT DatastructsException : public std::exception {
public:
//! construct with an error message
DatastructsException(const char *msg) : _msg(msg){};
DatastructsException(const char *msg) : _msg(msg) {}
//! construct with an error message
DatastructsException(const std::string &msg) : _msg(msg){};
DatastructsException(const std::string &msg) : _msg(msg) {}
//! get the error message
const char *what() const noexcept override { return _msg.c_str(); };
~DatastructsException() noexcept {};
const char *what() const noexcept override { return _msg.c_str(); }
~DatastructsException() noexcept {}
private:
std::string _msg;

View File

@@ -16,7 +16,7 @@ namespace RDKit {
class RDKIT_DATASTRUCTS_EXPORT DiscreteDistMat {
public:
DiscreteDistMat();
~DiscreteDistMat(){};
~DiscreteDistMat() {}
unsigned int getDist(unsigned char v1, unsigned char v2,
DiscreteValueVect::DiscreteValueType type);

View File

@@ -54,11 +54,11 @@ class RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect {
//! constructor from a pickle
DiscreteValueVect(const std::string &pkl) {
initFromText(pkl.c_str(), static_cast<unsigned int>(pkl.size()));
};
}
//! constructor from a pickle
DiscreteValueVect(const char *pkl, const unsigned int len) {
initFromText(pkl, len);
};
}
~DiscreteValueVect() {}
@@ -66,7 +66,7 @@ class RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect {
unsigned int getVal(unsigned int i) const;
//! support indexing using []
int operator[](unsigned int idx) const { return getVal(idx); };
int operator[](unsigned int idx) const { return getVal(idx); }
//! set the value at an index
/*!
@@ -81,7 +81,7 @@ class RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect {
//! returns the length
unsigned int getLength() const;
//! returns the length
unsigned int size() const { return getLength(); };
unsigned int size() const { return getLength(); }
//! return a pointer to our raw data storage
const std::uint32_t *getData() const;

View File

@@ -28,12 +28,12 @@
*/
class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
public:
ExplicitBitVect() {};
ExplicitBitVect() {}
//! initialize with a particular size;
explicit ExplicitBitVect(unsigned int size)
: dp_bits(nullptr), d_size(0), d_numOnBits(0) {
_initForSize(size);
};
}
//! initialize with a particular size and all bits set
ExplicitBitVect(unsigned int size, bool bitsSet);
ExplicitBitVect(const ExplicitBitVect &other);
@@ -46,7 +46,7 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
ExplicitBitVect(boost::dynamic_bitset<> *bits)
: dp_bits(bits),
d_size(static_cast<unsigned int>(bits->size())),
d_numOnBits(static_cast<unsigned int>(bits->count())){};
d_numOnBits(static_cast<unsigned int>(bits->count())) {}
~ExplicitBitVect();
@@ -75,7 +75,7 @@ class RDKIT_DATASTRUCTS_EXPORT ExplicitBitVect : public BitVect {
void getOnBits(IntVect &v) const;
void clearBits() { dp_bits->reset(); };
void clearBits() { dp_bits->reset(); }
std::string toString() const;
boost::dynamic_bitset<> *dp_bits{nullptr}; //!< our raw storage

View File

@@ -57,9 +57,8 @@ struct FPBReader_impl;
*/
class RDKIT_DATASTRUCTS_EXPORT FPBReader {
public:
FPBReader()
{};
FPBReader() {}
//! ctor for reading from a named file
/*!
\param fname the name of the file to reads
@@ -68,11 +67,11 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
*/
FPBReader(const char *fname, bool lazyRead = false) {
_initFromFilename(fname, lazyRead);
};
}
//! \overload
FPBReader(const std::string &fname, bool lazyRead = false) {
_initFromFilename(fname.c_str(), lazyRead);
};
}
//! ctor for reading from an open istream
/*!
\param inStream the stream to read from
@@ -91,13 +90,13 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
dp_impl(nullptr),
df_owner(takeOwnership),
df_init(false),
df_lazyRead(lazyRead){};
df_lazyRead(lazyRead) {}
~FPBReader() {
destroy();
if (df_owner) delete dp_istrm;
dp_istrm = nullptr;
df_init = false;
};
}
//! Read the data from the file and initialize internal data structures
/*!
@@ -119,7 +118,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
if (!df_init) return;
destroy();
df_init = false;
};
}
//! returns the requested fingerprint as an \c ExplicitBitVect
boost::shared_ptr<ExplicitBitVect> getFP(unsigned int idx) const;
//! returns the requested fingerprint as an array of bytes
@@ -131,7 +130,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
std::pair<boost::shared_ptr<ExplicitBitVect>, std::string> operator[](
unsigned int idx) const {
return std::make_pair(getFP(idx), getId(idx));
};
}
//! returns beginning and end indices of fingerprints having on-bit counts
//! within the range (including end points)
@@ -150,7 +149,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
double getTanimoto(unsigned int idx,
boost::shared_array<std::uint8_t> bv) const {
return getTanimoto(idx, bv.get());
};
}
//! \overload
double getTanimoto(unsigned int idx, const ExplicitBitVect &ebv) const;
@@ -174,7 +173,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
boost::shared_array<std::uint8_t> bv, double threshold = 0.7,
bool usePopcountScreen = true) const {
return getTanimotoNeighbors(bv.get(), threshold, usePopcountScreen);
};
}
//! \overload
std::vector<std::pair<double, unsigned int>> getTanimotoNeighbors(
const ExplicitBitVect &ebv, double threshold = 0.7,
@@ -196,7 +195,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
double getTversky(unsigned int idx, boost::shared_array<std::uint8_t> bv,
double ca, double cb) const {
return getTversky(idx, bv.get(), ca, cb);
};
}
//! \overload
double getTversky(unsigned int idx, const ExplicitBitVect &ebv, double ca,
double cb) const;
@@ -223,7 +222,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
boost::shared_array<std::uint8_t> bv, double ca, double cb,
double threshold = 0.7, bool usePopcountScreen = true) const {
return getTverskyNeighbors(bv.get(), ca, cb, threshold, usePopcountScreen);
};
}
//! \overload
std::vector<std::pair<double, unsigned int>> getTverskyNeighbors(
const ExplicitBitVect &ebv, double ca, double cb, double threshold = 0.7,
@@ -239,7 +238,7 @@ class RDKIT_DATASTRUCTS_EXPORT FPBReader {
std::vector<unsigned int> getContainingNeighbors(
boost::shared_array<std::uint8_t> bv) const {
return getContainingNeighbors(bv.get());
};
}
//! \overload
std::vector<unsigned int> getContainingNeighbors(
const ExplicitBitVect &ebv) const;

View File

@@ -53,8 +53,7 @@ namespace RDKit {
class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
public:
typedef boost::tuple<double, unsigned int, unsigned int> ResultTuple;
MultiFPBReader()
{};
MultiFPBReader() {}
/*!
\param initOnSearch: if this is true, the \c init() method on child readers
@@ -64,7 +63,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
MultiFPBReader(bool initOnSearch)
: df_init(false),
df_initOnSearch(initOnSearch),
df_takeOwnership(false){};
df_takeOwnership(false) {}
/*!
\param readers: the set of FPBReader objects to use.
\param takeOwnership: if true, we own the memory for the FPBReaders
@@ -78,10 +77,12 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
~MultiFPBReader() {
df_init = false;
if (df_takeOwnership) {
for (auto& rdr : d_readers) { delete rdr; };
for (auto &rdr : d_readers) {
delete rdr;
}
d_readers.clear();
}
};
}
//! Read the data from the file and initialize internal data structures
/*!
@@ -92,7 +93,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
void init();
//! returns the number of readers
unsigned int length() const { return d_readers.size(); };
unsigned int length() const { return d_readers.size(); }
//! returns the number of bits in our fingerprints (all readers are expected
//! to have the same length)
unsigned int nBits() const;
@@ -122,7 +123,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
d_readers.push_back(rdr);
if (df_init) rdr->init();
return d_readers.size();
};
}
//! returns tanimoto neighbors that are within a similarity threshold
/*!
@@ -144,7 +145,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
boost::shared_array<std::uint8_t> bv, double threshold = 0.7,
int numThreads = 1) const {
return getTanimotoNeighbors(bv.get(), threshold, numThreads);
};
}
//! \overload
std::vector<ResultTuple> getTanimotoNeighbors(const ExplicitBitVect &ebv,
double threshold = 0.7,
@@ -173,7 +174,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
boost::shared_array<std::uint8_t> bv, double ca, double cb,
double threshold = 0.7, int numThreads = 1) const {
return getTverskyNeighbors(bv.get(), ca, cb, threshold, numThreads);
};
}
//! \overload
std::vector<ResultTuple> getTverskyNeighbors(const ExplicitBitVect &ebv,
double ca, double cb,
@@ -190,7 +191,7 @@ class RDKIT_DATASTRUCTS_EXPORT MultiFPBReader {
std::vector<std::pair<unsigned int, unsigned int>> getContainingNeighbors(
boost::shared_array<std::uint8_t> bv, int numThreads = 1) const {
return getContainingNeighbors(bv.get(), numThreads);
};
}
//! \overload
std::vector<std::pair<unsigned int, unsigned int>> getContainingNeighbors(
const ExplicitBitVect &ebv, int numThreads = 1) const;

View File

@@ -33,11 +33,11 @@ typedef IntSet::const_iterator IntSetConstIter;
*/
class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
public:
SparseBitVect() {};
SparseBitVect() {}
//! initialize with a particular size;
explicit SparseBitVect(unsigned int size) : dp_bits(nullptr), d_size(0) {
_initForSize(size);
};
}
//! copy constructor
SparseBitVect(const SparseBitVect &other) : BitVect(other) {
@@ -53,18 +53,18 @@ class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
SparseBitVect(const char *data, const unsigned int dataLen);
SparseBitVect &operator=(const SparseBitVect &);
~SparseBitVect() { delete dp_bits; };
~SparseBitVect() { delete dp_bits; }
bool operator[](const unsigned int which) const;
SparseBitVect operator|(const SparseBitVect &) const;
SparseBitVect operator&(const SparseBitVect &)const;
SparseBitVect operator&(const SparseBitVect &) const;
SparseBitVect operator^(const SparseBitVect &) const;
SparseBitVect operator~() const;
//! returns a (const) pointer to our raw storage
const IntSet *getBitSet() const { return dp_bits; }
unsigned int getNumBits() const { return d_size; };
unsigned int getNumBits() const { return d_size; }
bool setBit(const unsigned int which);
bool setBit(const IntSetIter which);
bool unsetBit(const unsigned int which);
@@ -74,16 +74,17 @@ class RDKIT_DATASTRUCTS_EXPORT SparseBitVect : public BitVect {
unsigned int getNumOnBits() const {
return static_cast<unsigned int>(dp_bits->size());
};
}
unsigned int getNumOffBits() const {
return d_size - static_cast<unsigned int>(dp_bits->size());
};
}
std::string toString() const;
void getOnBits(IntVect &v) const;
void clearBits() { dp_bits->clear(); };
IntSet *dp_bits{nullptr}; //!< our raw data, exposed for the sake of efficiency
void clearBits() { dp_bits->clear(); }
IntSet *dp_bits{
nullptr}; //!< our raw data, exposed for the sake of efficiency
bool operator==(const SparseBitVect &o) const {
return *dp_bits == *o.dp_bits;

View File

@@ -29,10 +29,10 @@ class SparseIntVect {
public:
typedef std::map<IndexType, int> StorageType;
SparseIntVect() : d_length(0){};
SparseIntVect() : d_length(0) {}
//! initialize with a particular length
SparseIntVect(IndexType length) : d_length(length){};
SparseIntVect(IndexType length) : d_length(length) {}
//! Copy constructor
SparseIntVect(const SparseIntVect<IndexType> &other) {
@@ -44,11 +44,11 @@ class SparseIntVect {
//! constructor from a pickle
SparseIntVect(const std::string &pkl) {
initFromText(pkl.c_str(), pkl.size());
};
}
//! constructor from a pickle
SparseIntVect(const char *pkl, const unsigned int len) {
initFromText(pkl, len);
};
}
SparseIntVect &operator=(const SparseIntVect<IndexType> &other) {
if (this == &other) {
@@ -84,7 +84,7 @@ class SparseIntVect {
res = iter->second;
}
return res;
};
}
//! set the value at an index
void setVal(IndexType idx, int val) {
@@ -96,7 +96,7 @@ class SparseIntVect {
} else {
d_data.erase(idx);
}
};
}
#ifdef __clang__
#pragma clang diagnostic pop
#elif (defined(__GNUC__) || defined(__GNUG__)) && \
@@ -104,10 +104,10 @@ class SparseIntVect {
#pragma GCC diagnostic pop
#endif
//! support indexing using []
int operator[](IndexType idx) const { return getVal(idx); };
int operator[](IndexType idx) const { return getVal(idx); }
//! returns the length
IndexType getLength() const { return d_length; };
IndexType getLength() const { return d_length; }
//! returns the sum of all the elements in the vect
//! the doAbs argument toggles summing the absolute values of the elements
@@ -121,9 +121,9 @@ class SparseIntVect {
res += abs(iter->second);
}
return res;
};
}
//! returns the length
unsigned int size() const { return getLength(); };
unsigned int size() const { return getLength(); }
//! returns our nonzero elements as a map(IndexType->int)
const StorageType &getNonzeroElements() const { return d_data; }
@@ -160,7 +160,7 @@ class SparseIntVect {
}
}
return *this;
};
}
const SparseIntVect<IndexType> operator&(
const SparseIntVect<IndexType> &other) const {
SparseIntVect<IndexType> res(*this);
@@ -198,7 +198,7 @@ class SparseIntVect {
++oIter;
}
return *this;
};
}
const SparseIntVect<IndexType> operator|(
const SparseIntVect<IndexType> &other) const {
SparseIntVect<IndexType> res(*this);
@@ -232,7 +232,7 @@ class SparseIntVect {
++oIter;
}
return *this;
};
}
const SparseIntVect<IndexType> operator+(
const SparseIntVect<IndexType> &other) const {
SparseIntVect<IndexType> res(*this);
@@ -266,7 +266,7 @@ class SparseIntVect {
++oIter;
}
return *this;
};
}
const SparseIntVect<IndexType> operator-(
const SparseIntVect<IndexType> &other) const {
SparseIntVect<IndexType> res(*this);
@@ -279,11 +279,11 @@ class SparseIntVect {
++iter;
}
return *this;
};
}
SparseIntVect<IndexType> &operator*(int v) {
SparseIntVect<IndexType> res(*this);
return res *= v;
};
}
SparseIntVect<IndexType> &operator/=(int v) {
typename StorageType::iterator iter = d_data.begin();
while (iter != d_data.end()) {
@@ -291,11 +291,11 @@ class SparseIntVect {
++iter;
}
return *this;
};
}
SparseIntVect<IndexType> &operator/(int v) {
SparseIntVect<IndexType> res(*this);
return res /= v;
};
}
SparseIntVect<IndexType> &operator+=(int v) {
typename StorageType::iterator iter = d_data.begin();
while (iter != d_data.end()) {
@@ -303,11 +303,11 @@ class SparseIntVect {
++iter;
}
return *this;
};
}
SparseIntVect<IndexType> &operator+(int v) {
SparseIntVect<IndexType> res(*this);
return res += v;
};
}
SparseIntVect<IndexType> &operator-=(int v) {
typename StorageType::iterator iter = d_data.begin();
while (iter != d_data.end()) {
@@ -315,11 +315,11 @@ class SparseIntVect {
++iter;
}
return *this;
};
}
SparseIntVect<IndexType> &operator-(int v) {
SparseIntVect<IndexType> res(*this);
return res -= v;
};
}
bool operator==(const SparseIntVect<IndexType> &v2) const {
if (d_length != v2.d_length) {
@@ -352,7 +352,7 @@ class SparseIntVect {
++iter;
}
return ss.str();
};
}
void fromString(const std::string &txt) {
initFromText(txt.c_str(), txt.length());
@@ -393,7 +393,7 @@ class SparseIntVect {
} else {
throw ValueErrorException("bad version in SparseIntVect pickle");
}
};
}
template <typename T>
void readVals(std::stringstream &ss) {
PRECONDITION(sizeof(T) <= sizeof(IndexType), "invalid size");
@@ -435,14 +435,20 @@ void calcVectParams(const SparseIntVect<IndexType> &v1,
// the other vector:
typename SparseIntVect<IndexType>::StorageType::const_iterator iter1, iter2;
iter1 = v1.getNonzeroElements().begin();
if (iter1 != v1.getNonzeroElements().end()) v1Sum += abs(iter1->second);
if (iter1 != v1.getNonzeroElements().end()) {
v1Sum += abs(iter1->second);
}
iter2 = v2.getNonzeroElements().begin();
if (iter2 != v2.getNonzeroElements().end()) v2Sum += abs(iter2->second);
if (iter2 != v2.getNonzeroElements().end()) {
v2Sum += abs(iter2->second);
}
while (iter1 != v1.getNonzeroElements().end()) {
while (iter2 != v2.getNonzeroElements().end() &&
iter2->first < iter1->first) {
++iter2;
if (iter2 != v2.getNonzeroElements().end()) v2Sum += abs(iter2->second);
if (iter2 != v2.getNonzeroElements().end()) {
v2Sum += abs(iter2->second);
}
}
if (iter2 != v2.getNonzeroElements().end()) {
if (iter2->first == iter1->first) {
@@ -452,10 +458,14 @@ void calcVectParams(const SparseIntVect<IndexType> &v1,
andSum += abs(iter1->second);
}
++iter2;
if (iter2 != v2.getNonzeroElements().end()) v2Sum += abs(iter2->second);
if (iter2 != v2.getNonzeroElements().end()) {
v2Sum += abs(iter2->second);
}
}
++iter1;
if (iter1 != v1.getNonzeroElements().end()) v1Sum += abs(iter1->second);
if (iter1 != v1.getNonzeroElements().end()) {
v1Sum += abs(iter1->second);
}
} else {
break;
}

View File

@@ -14,10 +14,10 @@ using namespace RDKit;
class EnumException : public std::exception {
public:
EnumException(const char *msg) : _msg(msg){};
EnumException(const std::string msg) : _msg(msg){};
const char *what() const noexcept override { return _msg.c_str(); };
~EnumException() noexcept {};
EnumException(const char *msg) : _msg(msg) {}
EnumException(const std::string msg) : _msg(msg) {}
const char *what() const noexcept override { return _msg.c_str(); }
~EnumException() noexcept {}
private:
std::string _msg;

View File

@@ -11,8 +11,8 @@ class RDMolecule : public IRDMolecule {
NS_DECL_ISUPPORTS
NS_DECL_IRDMOLECULE
RDMolecule() : dp_mol(0){};
RDMolecule(RDKit::ROMol *mol) : dp_mol(mol){};
RDMolecule() : dp_mol(0) {}
RDMolecule(RDKit::ROMol *mol) : dp_mol(mol) {}
RDKit::ROMol *dp_mol;
private:

View File

@@ -12,8 +12,8 @@ class RDMolSupplier : public IRDMolSupplier {
NS_DECL_ISUPPORTS
NS_DECL_IRDMOLSUPPLIER
RDMolSupplier() : dp_suppl(0){};
RDMolSupplier(RDKit::MolSupplier *suppl) : dp_suppl(suppl){};
RDMolSupplier() : dp_suppl(0) {}
RDMolSupplier(RDKit::MolSupplier *suppl) : dp_suppl(suppl) {}
RDKit::MolSupplier *dp_suppl;
private:

View File

@@ -16,7 +16,7 @@
class classA {
public:
classA() { setProp("useless", 10); };
classA() { setProp("useless", 10); }
~classA() {}
void printA() const {

View File

@@ -20,7 +20,7 @@ typedef std::vector<STR_INT> PAIR_VECT;
class classC {
public:
classC() { setProp("useless", 10); };
classC() { setProp("useless", 10); }
~classC() {}
void printC() const {

View File

@@ -16,7 +16,7 @@
class classA {
public:
classA() { setProp("useless", 10); };
classA() { setProp("useless", 10); }
~classA() {}
void printA() const {

View File

@@ -20,7 +20,7 @@ typedef std::vector<STR_INT> PAIR_VECT;
class classC {
public:
classC() { setProp("useless", 10); };
classC() { setProp("useless", 10); }
~classC() {}
void printC() const {

View File

@@ -6,12 +6,12 @@
class ClassA {
public:
int get4() { return 4; };
int get4() { return 4; }
};
class ClassB {
public:
ClassA *returnOther() { return new ClassA; };
int get3() { return 3; };
int acceptOther(ClassA *other) { return other->get4(); };
ClassA *returnOther() { return new ClassA; }
int get3() { return 3; }
int acceptOther(ClassA *other) { return other->get4(); }
};

View File

@@ -30,9 +30,9 @@ class RDKIT_DISTGEOMETRY_EXPORT BoundsMatrix
typedef boost::shared_array<double> DATA_SPTR;
explicit BoundsMatrix(unsigned int N)
: RDNumeric::SquareMatrix<double>(N, 0.0){};
: RDNumeric::SquareMatrix<double>(N, 0.0) {}
BoundsMatrix(unsigned int N, DATA_SPTR data)
: RDNumeric::SquareMatrix<double>(N, data){};
: RDNumeric::SquareMatrix<double>(N, data) {}
//! Get the upper bound between points i and j
inline double getUpperBound(unsigned int i, unsigned int j) const {

View File

@@ -16,9 +16,7 @@ class ChiralSet;
class RDKIT_DISTGEOMETRY_EXPORT ChiralViolationContrib
: public ForceFields::ForceFieldContrib {
public:
ChiralViolationContrib()
{};
ChiralViolationContrib() {}
//! Constructor
/*!
@@ -40,7 +38,7 @@ class RDKIT_DISTGEOMETRY_EXPORT ChiralViolationContrib
void getGrad(double *pos, double *grad) const;
virtual ChiralViolationContrib *copy() const {
return new ChiralViolationContrib(*this);
};
}
static double calcChiralVolume(unsigned int idx1, unsigned int idx2,
unsigned int idx3, unsigned int idx4,

View File

@@ -19,8 +19,7 @@ namespace DistGeom {
class RDKIT_DISTGEOMETRY_EXPORT DistViolationContrib
: public ForceFields::ForceFieldContrib {
public:
DistViolationContrib()
{};
DistViolationContrib() {}
//! Constructor
/*!
@@ -40,12 +39,14 @@ class RDKIT_DISTGEOMETRY_EXPORT DistViolationContrib
void getGrad(double *pos, double *grad) const;
virtual DistViolationContrib *copy() const {
return new DistViolationContrib(*this);
};
}
private:
unsigned int d_end1Idx{0}, d_end2Idx{0}; //!< indices of end points
double d_ub{1000.0}; //!< upper bound on the distance between d_end1Idx,d_end2Idx
double d_lb{0.0}; //!< lower bound on the distance between d_end1Idx,d_end2Idx
double d_ub{
1000.0}; //!< upper bound on the distance between d_end1Idx, d_end2Idx
double d_lb{
0.0}; //!< lower bound on the distance between d_end1Idx, d_end2Idx
double d_weight{1.0}; //!< used to adjust relative contribution weights
};
} // namespace DistGeom

View File

@@ -15,7 +15,7 @@ namespace DistGeom {
class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
: public ForceFields::ForceFieldContrib {
public:
FourthDimContrib() {};
FourthDimContrib() {}
//! Constructor
/*!
@@ -30,7 +30,7 @@ class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
PRECONDITION(owner, "bad force field");
PRECONDITION(owner->dimension() == 4, "force field has wrong dimension");
dp_forceField = owner;
};
}
//! return the contribution of this contrib to the energy of a given state
double getEnergy(double *pos) const {
@@ -52,9 +52,7 @@ class RDKIT_DISTGEOMETRY_EXPORT FourthDimContrib
unsigned int pid = d_idx * dp_forceField->dimension() + 3;
grad[pid] += d_weight * pos[pid];
}
virtual FourthDimContrib *copy() const {
return new FourthDimContrib(*this);
};
virtual FourthDimContrib *copy() const { return new FourthDimContrib(*this); }
private:
unsigned int d_idx{0};

View File

@@ -19,24 +19,24 @@ template <typename FAMILYMARKER, typename TYPEMARKER = FAMILYMARKER,
typename LOCTYPE = RDGeom::Point3D>
class ExplicitFeature {
public:
ExplicitFeature(){};
ExplicitFeature() {}
explicit ExplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t)
: d_family(f), d_type(t){};
: d_family(f), d_type(t) {}
ExplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t,
const LOCTYPE &loc)
: d_family(f), d_type(t), d_loc(loc){};
: d_family(f), d_type(t), d_loc(loc) {}
const FAMILYMARKER &getFamily() const { return d_family; };
void setFamily(const FAMILYMARKER &f) { d_family = f; };
const FAMILYMARKER &getFamily() const { return d_family; }
void setFamily(const FAMILYMARKER &f) { d_family = f; }
const TYPEMARKER &getType() const { return d_type; };
void setType(const TYPEMARKER &t) { d_type = t; };
const TYPEMARKER &getType() const { return d_type; }
void setType(const TYPEMARKER &t) { d_type = t; }
const LOCTYPE &getLoc() const { return d_loc; };
void setLoc(const LOCTYPE &loc) { d_loc = loc; };
const LOCTYPE &getLoc() const { return d_loc; }
void setLoc(const LOCTYPE &loc) { d_loc = loc; }
const std::vector<LOCTYPE> &getDirs() const { return d_dirs; };
std::vector<LOCTYPE> &getDirs() { return d_dirs; };
const std::vector<LOCTYPE> &getDirs() const { return d_dirs; }
std::vector<LOCTYPE> &getDirs() { return d_dirs; }
private:
FAMILYMARKER d_family;
@@ -49,15 +49,15 @@ template <typename FAMILYMARKER, typename TYPEMARKER = FAMILYMARKER,
typename LOCTYPE = RDGeom::Point3D>
class ImplicitFeature {
public:
ImplicitFeature() : d_weightSum(0.0){};
ImplicitFeature() : d_weightSum(0.0) {}
explicit ImplicitFeature(const FAMILYMARKER &f, const TYPEMARKER &t)
: d_weightSum(0.0), d_family(f), d_type(t){};
: d_weightSum(0.0), d_family(f), d_type(t) {}
const FAMILYMARKER &getFamily() const { return d_family; };
void setFamily(const FAMILYMARKER &f) { d_family = f; };
const FAMILYMARKER &getFamily() const { return d_family; }
void setFamily(const FAMILYMARKER &f) { d_family = f; }
const TYPEMARKER &getType() const { return d_type; };
void setType(const TYPEMARKER &t) { d_type = t; };
const TYPEMARKER &getType() const { return d_type; }
void setType(const TYPEMARKER &t) { d_type = t; }
LOCTYPE getLoc() const {
PRECONDITION(d_weights.size() == d_locs.size(), "weight/locs mismatch");
@@ -68,7 +68,7 @@ class ImplicitFeature {
accum += tmp;
}
return accum;
};
}
void addPoint(const LOCTYPE *p, double weight = 1.0) {
d_locs.push_back(p);
d_weights.push_back(weight);
@@ -80,8 +80,8 @@ class ImplicitFeature {
d_weightSum = 0.0;
}
const std::vector<LOCTYPE> &getDirs() const { return d_dirs; };
std::vector<LOCTYPE> &getDirs() { return d_dirs; };
const std::vector<LOCTYPE> &getDirs() const { return d_dirs; }
std::vector<LOCTYPE> &getDirs() { return d_dirs; }
private:
double d_weightSum;

View File

@@ -19,9 +19,9 @@ class RDKIT_FORCEFIELD_EXPORT ForceFieldContrib {
public:
friend class ForceField;
ForceFieldContrib() {};
ForceFieldContrib(ForceFields::ForceField *owner) : dp_forceField(owner){};
virtual ~ForceFieldContrib(){};
ForceFieldContrib() {}
ForceFieldContrib(ForceFields::ForceField *owner) : dp_forceField(owner) {}
virtual ~ForceFieldContrib() {}
//! returns our contribution to the energy of a position
virtual double getEnergy(double *pos) const = 0;

View File

@@ -79,9 +79,7 @@ typedef std::vector<ContribPtr> ContribPtrVect;
class RDKIT_FORCEFIELD_EXPORT ForceField {
public:
//! construct with a dimension
ForceField(unsigned int dimension = 3)
: d_dimension(dimension)
{};
ForceField(unsigned int dimension = 3) : d_dimension(dimension) {}
~ForceField();
@@ -180,12 +178,12 @@ class RDKIT_FORCEFIELD_EXPORT ForceField {
// setters and getters
//! returns a reference to our points (a PointPtrVect)
RDGeom::PointPtrVect &positions() { return d_positions; };
const RDGeom::PointPtrVect &positions() const { return d_positions; };
RDGeom::PointPtrVect &positions() { return d_positions; }
const RDGeom::PointPtrVect &positions() const { return d_positions; }
//! returns a reference to our contribs (a ContribPtrVect)
ContribPtrVect &contribs() { return d_contribs; };
const ContribPtrVect &contribs() const { return d_contribs; };
ContribPtrVect &contribs() { return d_contribs; }
const ContribPtrVect &contribs() const { return d_contribs; }
//! returns the distance between two points
/*!
@@ -222,16 +220,16 @@ class RDKIT_FORCEFIELD_EXPORT ForceField {
unsigned int dimension() const { return d_dimension; }
//! returns the number of points the ForceField is handling
unsigned int numPoints() const { return d_numPoints; };
unsigned int numPoints() const { return d_numPoints; }
INT_VECT &fixedPoints() { return d_fixedPoints; };
const INT_VECT &fixedPoints() const { return d_fixedPoints; };
INT_VECT &fixedPoints() { return d_fixedPoints; }
const INT_VECT &fixedPoints() const { return d_fixedPoints; }
protected:
unsigned int d_dimension;
bool df_init{false}; //!< whether or not we've been initialized
unsigned int d_numPoints{0}; //!< the number of active points
double *dp_distMat{nullptr}; //!< our internal distance matrix
bool df_init{false}; //!< whether or not we've been initialized
unsigned int d_numPoints{0}; //!< the number of active points
double *dp_distMat{nullptr}; //!< our internal distance matrix
RDGeom::PointPtrVect d_positions; //!< pointers to the points we're using
ContribPtrVect d_contribs; //!< contributions to the energy
INT_VECT d_fixedPoints;

View File

@@ -25,7 +25,7 @@ class MMFFProp;
//! The angle-bend term for MMFF
class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
public:
AngleBendContrib() {};
AngleBendContrib() {}
//! Constructor
/*!
The angle is between atom1 - atom2 - atom3
@@ -42,9 +42,7 @@ class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
const MMFFProp *mmffPropParamsCentralAtom);
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual AngleBendContrib *copy() const {
return new AngleBendContrib(*this);
};
virtual AngleBendContrib *copy() const { return new AngleBendContrib(*this); }
private:
bool d_isLinear;

View File

@@ -22,7 +22,7 @@ namespace MMFF {
class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
: public ForceFieldContrib {
public:
AngleConstraintContrib(){};
AngleConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -50,7 +50,7 @@ class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
virtual AngleConstraintContrib *copy() const {
return new AngleConstraintContrib(*this);
};
}
private:
double computeAngleTerm(double angle) const;

View File

@@ -22,7 +22,7 @@ class MMFFBondStretchEmpiricalRule;
//! The bond-stretch term for MMFF
class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
public:
BondStretchContrib() {};
BondStretchContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -42,12 +42,12 @@ class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
virtual BondStretchContrib *copy() const {
return new BondStretchContrib(*this);
};
}
private:
int d_at1Idx{-1}, d_at2Idx{-1}; //!< indices of end points
double d_r0; //!< rest length of the bond
double d_kb; //!< force constant of the bond
double d_r0; //!< rest length of the bond
double d_kb; //!< force constant of the bond
};
namespace Utils {

View File

@@ -22,7 +22,7 @@ namespace MMFF {
class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
: public ForceFieldContrib {
public:
DistanceConstraintContrib() {};
DistanceConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -49,12 +49,12 @@ class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual DistanceConstraintContrib *copy() const {
return new DistanceConstraintContrib(*this);
};
}
private:
int d_end1Idx{-1}, d_end2Idx{-1}; //!< indices of end points
double d_minLen, d_maxLen; //!< rest length of the bond
double d_forceConstant; //!< force constant of the bond
int d_end1Idx{-1}, d_end2Idx{-1}; //!< indices of end points
double d_minLen, d_maxLen; //!< rest length of the bond
double d_forceConstant; //!< force constant of the bond
};
} // namespace MMFF
} // namespace ForceFields

View File

@@ -23,7 +23,7 @@ class MMFFVdW;
//! the van der Waals term for MMFF
class RDKIT_FORCEFIELD_EXPORT VdWContrib : public ForceFieldContrib {
public:
VdWContrib() {};
VdWContrib() {}
//! Constructor
/*!
@@ -36,7 +36,7 @@ class RDKIT_FORCEFIELD_EXPORT VdWContrib : public ForceFieldContrib {
const MMFFVdWRijstarEps *mmffVdWConstants);
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual VdWContrib *copy() const { return new VdWContrib(*this); };
virtual VdWContrib *copy() const { return new VdWContrib(*this); }
private:
int d_at1Idx{-1}, d_at2Idx{-1};
@@ -47,7 +47,7 @@ class RDKIT_FORCEFIELD_EXPORT VdWContrib : public ForceFieldContrib {
//! the electrostatic term for MMFF
class RDKIT_FORCEFIELD_EXPORT EleContrib : public ForceFieldContrib {
public:
EleContrib() {};
EleContrib() {}
//! Constructor
/*!
@@ -61,7 +61,7 @@ class RDKIT_FORCEFIELD_EXPORT EleContrib : public ForceFieldContrib {
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual EleContrib *copy() const { return new EleContrib(*this); };
virtual EleContrib *copy() const { return new EleContrib(*this); }
private:
int d_at1Idx{-1}, d_at2Idx{-1};

View File

@@ -23,7 +23,7 @@ class MMFFOop;
//! the out-of-plane term for MMFF
class RDKIT_FORCEFIELD_EXPORT OopBendContrib : public ForceFieldContrib {
public:
OopBendContrib() {};
OopBendContrib() {}
//! Constructor
/*!
The Wilson angle is between the vector formed by atom2-atom4
@@ -40,7 +40,7 @@ and the angle formed by atom1-atom2-atom3
const MMFFOop *mmffOopParams);
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual OopBendContrib *copy() const { return new OopBendContrib(*this); };
virtual OopBendContrib *copy() const { return new OopBendContrib(*this); }
private:
int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1}, d_at4Idx{-1};

View File

@@ -23,7 +23,7 @@ namespace MMFF {
class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
: public ForceFieldContrib {
public:
PositionConstraintContrib() {};
PositionConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -42,10 +42,10 @@ class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual PositionConstraintContrib *copy() const {
return new PositionConstraintContrib(*this);
};
}
private:
int d_atIdx{-1}; //!< index of the restrained atom
int d_atIdx{-1}; //!< index of the restrained atom
double d_maxDispl; //!< maximum allowed displacement
RDGeom::Point3D d_pos0; //!< reference position
double d_forceConstant; //!< force constant of the bond

View File

@@ -26,7 +26,7 @@ class MMFFProp;
//! The angle-bend term for MMFF
class RDKIT_FORCEFIELD_EXPORT StretchBendContrib : public ForceFieldContrib {
public:
StretchBendContrib() {};
StretchBendContrib() {}
//! Constructor
/*!
The angle is between atom1 - atom2 - atom3
@@ -49,7 +49,7 @@ class RDKIT_FORCEFIELD_EXPORT StretchBendContrib : public ForceFieldContrib {
void getGrad(double *pos, double *grad) const;
virtual StretchBendContrib *copy() const {
return new StretchBendContrib(*this);
};
}
private:
int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1};

View File

@@ -27,7 +27,7 @@ class MMFFTor;
//! the torsion term for MMFF
class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
public:
TorsionAngleContrib(){};
TorsionAngleContrib() {}
//! Constructor
/*!
The torsion is between atom1 - atom2 - atom3 - atom4
@@ -48,7 +48,7 @@ class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
void getGrad(double *pos, double *grad) const;
virtual TorsionAngleContrib *copy() const {
return new TorsionAngleContrib(*this);
};
}
private:
int d_at1Idx{-1}, d_at2Idx{-1}, d_at3Idx{-1}, d_at4Idx{-1};

View File

@@ -22,7 +22,7 @@ namespace MMFF {
class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
: public ForceFieldContrib {
public:
TorsionConstraintContrib(){};
TorsionConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -51,7 +51,7 @@ class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual TorsionConstraintContrib *copy() const {
return new TorsionConstraintContrib(*this);
};
}
private:
void setParameters(ForceField *owner, unsigned int idx1, unsigned int idx2,

View File

@@ -21,7 +21,7 @@ class AtomicParams;
//! The angle-bend term for the Universal Force Field
class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
public:
AngleBendContrib(){};
AngleBendContrib() {}
//! Constructor
/*!
The angle is between atom1 - atom2 - atom3
@@ -50,9 +50,7 @@ class RDKIT_FORCEFIELD_EXPORT AngleBendContrib : public ForceFieldContrib {
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual AngleBendContrib *copy() const {
return new AngleBendContrib(*this);
};
virtual AngleBendContrib *copy() const { return new AngleBendContrib(*this); }
private:
int d_at1Idx{-1};

View File

@@ -22,7 +22,7 @@ namespace UFF {
class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
: public ForceFieldContrib {
public:
AngleConstraintContrib(){};
AngleConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -50,7 +50,7 @@ class RDKIT_FORCEFIELD_EXPORT AngleConstraintContrib
virtual AngleConstraintContrib *copy() const {
return new AngleConstraintContrib(*this);
};
}
private:
double computeAngleTerm(double angle) const;

View File

@@ -19,7 +19,7 @@ class AtomicParams;
//! The bond-stretch term for the Universal Force Field
class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
public:
BondStretchContrib(){};
BondStretchContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -40,7 +40,7 @@ class RDKIT_FORCEFIELD_EXPORT BondStretchContrib : public ForceFieldContrib {
virtual BondStretchContrib *copy() const {
return new BondStretchContrib(*this);
};
}
private:
int d_end1Idx{-1}; //!< indices of end points

View File

@@ -22,7 +22,7 @@ namespace UFF {
class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
: public ForceFieldContrib {
public:
DistanceConstraintContrib(){};
DistanceConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -49,7 +49,7 @@ class RDKIT_FORCEFIELD_EXPORT DistanceConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual DistanceConstraintContrib *copy() const {
return new DistanceConstraintContrib(*this);
};
}
private:
int d_end1Idx{-1}; //!< indices of end points

View File

@@ -23,7 +23,7 @@ class AtomicParams;
//! The inversion term for the Universal Force Field
class RDKIT_FORCEFIELD_EXPORT InversionContrib : public ForceFieldContrib {
public:
InversionContrib(){};
InversionContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -43,9 +43,7 @@ class RDKIT_FORCEFIELD_EXPORT InversionContrib : public ForceFieldContrib {
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual InversionContrib *copy() const {
return new InversionContrib(*this);
};
virtual InversionContrib *copy() const { return new InversionContrib(*this); }
private:
int d_at1Idx{-1};

View File

@@ -30,7 +30,7 @@ class AtomicParams;
*/
class RDKIT_FORCEFIELD_EXPORT vdWContrib : public ForceFieldContrib {
public:
vdWContrib(){};
vdWContrib() {}
//! Constructor
/*!
@@ -48,7 +48,7 @@ class RDKIT_FORCEFIELD_EXPORT vdWContrib : public ForceFieldContrib {
double threshMultiplier = 10.0);
double getEnergy(double *pos) const;
void getGrad(double *pos, double *grad) const;
virtual vdWContrib *copy() const { return new vdWContrib(*this); };
virtual vdWContrib *copy() const { return new vdWContrib(*this); }
private:
int d_at1Idx{-1};

View File

@@ -23,7 +23,7 @@ namespace UFF {
class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
: public ForceFieldContrib {
public:
PositionConstraintContrib() {};
PositionConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -42,10 +42,10 @@ class RDKIT_FORCEFIELD_EXPORT PositionConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual PositionConstraintContrib *copy() const {
return new PositionConstraintContrib(*this);
};
}
private:
int d_atIdx{-1}; //!< index of the restrained atom
int d_atIdx{-1}; //!< index of the restrained atom
double d_maxDispl; //!< maximum allowed displacement
RDGeom::Point3D d_pos0; //!< reference position
double d_forceConstant; //!< force constant of the bond

View File

@@ -28,7 +28,7 @@ class AtomicParams;
//! the torsion term for the Universal Force Field
class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
public:
TorsionAngleContrib(){};
TorsionAngleContrib() {}
//! Constructor
/*!
The torsion is between atom1 - atom2 - atom3 - atom4
@@ -68,10 +68,10 @@ class RDKIT_FORCEFIELD_EXPORT TorsionAngleContrib : public ForceFieldContrib {
void getGrad(double *pos, double *grad) const;
void scaleForceConstant(unsigned int count) {
this->d_forceConstant /= static_cast<double>(count);
};
}
virtual TorsionAngleContrib *copy() const {
return new TorsionAngleContrib(*this);
};
}
private:
int d_at1Idx{-1};

View File

@@ -22,7 +22,7 @@ namespace UFF {
class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
: public ForceFieldContrib {
public:
TorsionConstraintContrib(){};
TorsionConstraintContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
@@ -51,7 +51,7 @@ class RDKIT_FORCEFIELD_EXPORT TorsionConstraintContrib
void getGrad(double *pos, double *grad) const;
virtual TorsionConstraintContrib *copy() const {
return new TorsionConstraintContrib(*this);
};
}
private:
void setParameters(ForceField *owner, unsigned int idx1, unsigned int idx2,

View File

@@ -23,7 +23,7 @@ namespace python = boost::python;
namespace ForceFields {
class PyForceField {
public:
PyForceField(ForceField *f) : field(f){};
PyForceField(ForceField *f) : field(f) {}
~PyForceField() {
// std::cerr << " *** destroy PyForce field " << std::endl;
@@ -86,18 +86,18 @@ class PyForceField {
class PyMMFFMolProperties {
public:
PyMMFFMolProperties(RDKit::MMFF::MMFFMolProperties *mp)
: mmffMolProperties(mp){};
~PyMMFFMolProperties(){};
: mmffMolProperties(mp) {}
~PyMMFFMolProperties() {}
unsigned int getMMFFAtomType(unsigned int idx) {
return (unsigned int)(mmffMolProperties->getMMFFAtomType(idx));
};
}
double getMMFFFormalCharge(unsigned int idx) {
return mmffMolProperties->getMMFFFormalCharge(idx);
};
}
double getMMFFPartialCharge(unsigned int idx) {
return mmffMolProperties->getMMFFPartialCharge(idx);
};
}
PyObject *getMMFFBondStretchParams(const RDKit::ROMol &mol,
const unsigned int idx1,
const unsigned int idx2);
@@ -122,37 +122,37 @@ class PyMMFFMolProperties {
PyObject *getMMFFVdWParams(const unsigned int idx1, const unsigned int idx2);
void setMMFFDielectricModel(std::uint8_t dielModel) {
mmffMolProperties->setMMFFDielectricModel(dielModel);
};
}
void setMMFFDielectricConstant(double dielConst) {
mmffMolProperties->setMMFFDielectricConstant(dielConst);
};
}
void setMMFFBondTerm(bool state) {
mmffMolProperties->setMMFFBondTerm(state);
};
}
void setMMFFAngleTerm(const bool state) {
mmffMolProperties->setMMFFAngleTerm(state);
};
}
void setMMFFStretchBendTerm(const bool state) {
mmffMolProperties->setMMFFStretchBendTerm(state);
};
}
void setMMFFOopTerm(const bool state) {
mmffMolProperties->setMMFFOopTerm(state);
};
}
void setMMFFTorsionTerm(const bool state) {
mmffMolProperties->setMMFFTorsionTerm(state);
};
}
void setMMFFVdWTerm(const bool state) {
mmffMolProperties->setMMFFVdWTerm(state);
};
}
void setMMFFEleTerm(const bool state) {
mmffMolProperties->setMMFFEleTerm(state);
};
}
void setMMFFVariant(const std::string &mmffVariant) {
mmffMolProperties->setMMFFVariant(mmffVariant);
};
}
void setMMFFVerbosity(unsigned int verbosity) {
mmffMolProperties->setMMFFVerbosity(verbosity);
};
}
boost::shared_ptr<RDKit::MMFF::MMFFMolProperties> mmffMolProperties;
};
PyObject *getUFFBondStretchParams(const RDKit::ROMol &mol,

View File

@@ -19,6 +19,7 @@
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
@@ -41,10 +42,12 @@ class FuzzedDataProvider {
// when splitting fuzzing input into pieces, as every piece is put into a
// separate buffer (i.e. ASan would catch any under-/overflow) and the memory
// will be released automatically.
template <typename T> std::vector<T> ConsumeBytes(size_t num_bytes);
template <typename T>
std::vector<T> ConsumeBytes(size_t num_bytes);
template <typename T>
std::vector<T> ConsumeBytesWithTerminator(size_t num_bytes, T terminator = 0);
template <typename T> std::vector<T> ConsumeRemainingBytes();
template <typename T>
std::vector<T> ConsumeRemainingBytes();
// Methods returning strings. Use only when you need a std::string or a null
// terminated C-string. Otherwise, prefer the methods returning std::vector.
@@ -54,24 +57,32 @@ class FuzzedDataProvider {
std::string ConsumeRemainingBytesAsString();
// Methods returning integer values.
template <typename T> T ConsumeIntegral();
template <typename T> T ConsumeIntegralInRange(T min, T max);
template <typename T>
T ConsumeIntegral();
template <typename T>
T ConsumeIntegralInRange(T min, T max);
// Methods returning floating point values.
template <typename T> T ConsumeFloatingPoint();
template <typename T> T ConsumeFloatingPointInRange(T min, T max);
template <typename T>
T ConsumeFloatingPoint();
template <typename T>
T ConsumeFloatingPointInRange(T min, T max);
// 0 <= return value <= 1.
template <typename T> T ConsumeProbability();
template <typename T>
T ConsumeProbability();
bool ConsumeBool();
// Returns a value chosen from the given enum.
template <typename T> T ConsumeEnum();
template <typename T>
T ConsumeEnum();
// Returns a value from the given array.
template <typename T, size_t size> T PickValueInArray(const T (&array)[size]);
template <typename T> T PickValueInArray(std::initializer_list<const T> list);
template <typename T, size_t size>
T PickValueInArray(const T (&array)[size]);
template <typename T>
T PickValueInArray(std::initializer_list<const T> list);
// Writes data to the given destination and returns number of bytes written.
size_t ConsumeData(void *destination, size_t num_bytes);
@@ -90,7 +101,8 @@ class FuzzedDataProvider {
template <typename T>
std::vector<T> ConsumeBytes(size_t size, size_t num_bytes);
template <typename TS, typename TU> TS ConvertUnsignedToSigned(TU value);
template <typename TS, typename TU>
TS ConvertUnsignedToSigned(TU value);
const uint8_t *data_ptr_;
size_t remaining_bytes_;
@@ -144,8 +156,8 @@ inline std::string FuzzedDataProvider::ConsumeBytesAsString(size_t num_bytes) {
// input data, returns what remains of the input. Designed to be more stable
// with respect to a fuzzer inserting characters than just picking a random
// length and then consuming that many bytes with |ConsumeBytes|.
inline std::string
FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
inline std::string FuzzedDataProvider::ConsumeRandomLengthString(
size_t max_length) {
// Reads bytes from the start of |data_ptr_|. Maps "\\" to "\", and maps "\"
// followed by anything else to the end of the string. As a result of this
// logic, a fuzzer can insert characters into the string, and the string
@@ -162,8 +174,9 @@ FuzzedDataProvider::ConsumeRandomLengthString(size_t max_length) {
if (next == '\\' && remaining_bytes_ != 0) {
next = ConvertUnsignedToSigned<char>(data_ptr_[0]);
Advance(1);
if (next != '\\')
if (next != '\\') {
break;
}
}
result += next;
}
@@ -187,7 +200,8 @@ inline std::string FuzzedDataProvider::ConsumeRemainingBytesAsString() {
// Returns a number in the range [Type's min, Type's max]. The value might
// not be uniformly distributed in the given range. If there's no input data
// left, always returns |min|.
template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
template <typename T>
T FuzzedDataProvider::ConsumeIntegral() {
return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
std::numeric_limits<T>::max());
}
@@ -201,8 +215,9 @@ T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
static_assert(std::is_integral<T>::value, "An integral type is required.");
static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
if (min > max)
if (min > max) {
abort();
}
// Use the biggest type possible to hold the range and the result.
uint64_t range = static_cast<uint64_t>(max) - min;
@@ -232,7 +247,8 @@ T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
// Returns a floating point value in the range [Type's lowest, Type's max] by
// consuming bytes from the input data. If there's no input data left, always
// returns approximately 0.
template <typename T> T FuzzedDataProvider::ConsumeFloatingPoint() {
template <typename T>
T FuzzedDataProvider::ConsumeFloatingPoint() {
return ConsumeFloatingPointInRange<T>(std::numeric_limits<T>::lowest(),
std::numeric_limits<T>::max());
}
@@ -242,8 +258,9 @@ template <typename T> T FuzzedDataProvider::ConsumeFloatingPoint() {
// |min| must be less than or equal to |max|.
template <typename T>
T FuzzedDataProvider::ConsumeFloatingPointInRange(T min, T max) {
if (min > max)
if (min > max) {
abort();
}
T range = .0;
T result = min;
@@ -265,7 +282,8 @@ T FuzzedDataProvider::ConsumeFloatingPointInRange(T min, T max) {
// Returns a floating point number in the range [0.0, 1.0]. If there's no
// input data left, always returns 0.
template <typename T> T FuzzedDataProvider::ConsumeProbability() {
template <typename T>
T FuzzedDataProvider::ConsumeProbability() {
static_assert(std::is_floating_point<T>::value,
"A floating point type is required.");
@@ -288,7 +306,8 @@ inline bool FuzzedDataProvider::ConsumeBool() {
// Returns an enum value. The enum must start at 0 and be contiguous. It must
// also contain |kMaxValue| aliased to its largest (inclusive) value. Such as:
// enum class Foo { SomeValue, OtherValue, kMaxValue = OtherValue };
template <typename T> T FuzzedDataProvider::ConsumeEnum() {
template <typename T>
T FuzzedDataProvider::ConsumeEnum() {
static_assert(std::is_enum<T>::value, "|T| must be an enum type.");
return static_cast<T>(
ConsumeIntegralInRange<uint32_t>(0, static_cast<uint32_t>(T::kMaxValue)));
@@ -304,8 +323,9 @@ T FuzzedDataProvider::PickValueInArray(const T (&array)[size]) {
template <typename T>
T FuzzedDataProvider::PickValueInArray(std::initializer_list<const T> list) {
// TODO(Dor1s): switch to static_assert once C++14 is allowed.
if (!list.size())
if (!list.size()) {
abort();
}
return *(list.begin() + ConsumeIntegralInRange<size_t>(0, list.size() - 1));
}
@@ -331,8 +351,9 @@ inline void FuzzedDataProvider::CopyAndAdvance(void *destination,
}
inline void FuzzedDataProvider::Advance(size_t num_bytes) {
if (num_bytes > remaining_bytes_)
if (num_bytes > remaining_bytes_) {
abort();
}
data_ptr_ += num_bytes;
remaining_bytes_ -= num_bytes;
@@ -350,8 +371,9 @@ std::vector<T> FuzzedDataProvider::ConsumeBytes(size_t size, size_t num_bytes) {
// To increase the odds even more, we also call |shrink_to_fit| below.
std::vector<T> result(size);
if (size == 0) {
if (num_bytes != 0)
if (num_bytes != 0) {
abort();
}
return result;
}
@@ -371,8 +393,9 @@ TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
"Source type must be unsigned.");
// TODO(Dor1s): change to `if constexpr` once C++17 becomes mainstream.
if (std::numeric_limits<TS>::is_modulo)
if (std::numeric_limits<TS>::is_modulo) {
return static_cast<TS>(value);
}
// Avoid using implementation-defined unsigned to signed conversions.
// To learn more, see https://stackoverflow.com/questions/13150449.
@@ -384,4 +407,4 @@ TS FuzzedDataProvider::ConvertUnsignedToSigned(TU value) {
}
}
#endif // LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_
#endif // LLVM_FUZZER_FUZZED_DATA_PROVIDER_H_

View File

@@ -22,12 +22,12 @@ class Point3D;
class RDKIT_RDGEOMETRYLIB_EXPORT GridException : public std::exception {
public:
//! construct with an error message
GridException(const char *msg) : _msg(msg){};
GridException(const char *msg) : _msg(msg) {}
//! construct with an error message
GridException(const std::string &msg) : _msg(msg){};
GridException(const std::string &msg) : _msg(msg) {}
//! get the error message
const char *what() const noexcept override { return _msg.c_str(); };
~GridException() noexcept {};
const char *what() const noexcept override { return _msg.c_str(); }
~GridException() noexcept {}
private:
std::string _msg;
@@ -36,7 +36,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT GridException : public std::exception {
//! Virtual base class for a grid object
class RDKIT_RDGEOMETRYLIB_EXPORT Grid3D {
public:
virtual ~Grid3D(){};
virtual ~Grid3D() {}
virtual int getGridPointIndex(const Point3D &point) const = 0;
virtual int getVal(const Point3D &point) const = 0;
virtual void setVal(const Point3D &point, unsigned int val) = 0;

View File

@@ -83,7 +83,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT UniformGrid3D : public Grid3D {
void setVal(unsigned int pointId, unsigned int val);
//! \brief get the size of the grid (number of grid points)
unsigned int getSize() const { return d_numX * d_numY * d_numZ; };
unsigned int getSize() const { return d_numX * d_numY * d_numZ; }
//! \brief set the occupancy for a multi-layered sphere
/*!
@@ -115,24 +115,24 @@ class RDKIT_RDGEOMETRYLIB_EXPORT UniformGrid3D : public Grid3D {
unsigned int &zi) const;
//! \brief get the number of grid points along x-axis
unsigned int getNumX() const { return d_numX; };
unsigned int getNumX() const { return d_numX; }
//! \brief get the number of grid points along y-axis
unsigned int getNumY() const { return d_numY; };
unsigned int getNumY() const { return d_numY; }
//! \brief get the number of grid points along z-axis
unsigned int getNumZ() const { return d_numZ; };
unsigned int getNumZ() const { return d_numZ; }
//! \brief get the grid's offset
const Point3D &getOffset() const { return d_offSet; };
const Point3D &getOffset() const { return d_offSet; }
//! \brief get the grid's spacing
double getSpacing() const { return d_spacing; };
double getSpacing() const { return d_spacing; }
//! \brief return a \b const pointer to our occupancy vector
const RDKit::DiscreteValueVect *getOccupancyVect() const {
return dp_storage;
};
}
//! \brief returns true if the grid \c other has parameters
//! compatible with ours.
@@ -168,7 +168,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT UniformGrid3D : public Grid3D {
d_numZ * d_spacing, d_spacing, dp_storage->getValueType(),
&d_offSet);
return res;
};
}
private:
//! \brief internal initialization code

View File

@@ -29,7 +29,7 @@ namespace RDGeom {
class RDKIT_RDGEOMETRYLIB_EXPORT Point {
// this is the virtual base class, mandating certain functions
public:
virtual ~Point(){};
virtual ~Point() {}
virtual double operator[](unsigned int i) const = 0;
virtual double &operator[](unsigned int i) = 0;
@@ -57,10 +57,10 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
double y{0.0};
double z{0.0};
Point3D(){};
Point3D(double xv, double yv, double zv) : x(xv), y(yv), z(zv){};
Point3D() {}
Point3D(double xv, double yv, double zv) : x(xv), y(yv), z(zv) {}
~Point3D(){};
~Point3D() {}
Point3D(const Point3D &other)
: Point(other), x(other.x), y(other.y), z(other.z) {}
@@ -99,35 +99,35 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
y = other.y;
z = other.z;
return *this;
};
}
Point3D &operator+=(const Point3D &other) {
x += other.x;
y += other.y;
z += other.z;
return *this;
};
}
Point3D &operator-=(const Point3D &other) {
x -= other.x;
y -= other.y;
z -= other.z;
return *this;
};
}
Point3D &operator*=(double scale) {
x *= scale;
y *= scale;
z *= scale;
return *this;
};
}
Point3D &operator/=(double scale) {
x /= scale;
y /= scale;
z /= scale;
return *this;
};
}
Point3D operator-() const {
Point3D res(x, y, z);
@@ -142,23 +142,23 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
x /= l;
y /= l;
z /= l;
};
}
double length() const {
double res = x * x + y * y + z * z;
return sqrt(res);
};
}
double lengthSq() const {
// double res = pow(x,2) + pow(y,2) + pow(z,2);
double res = x * x + y * y + z * z;
return res;
};
}
double dotProduct(const Point3D &other) const {
double res = x * (other.x) + y * (other.y) + z * (other.z);
return res;
};
}
/*! \brief determines the angle between a vector to this point
* from the origin and a vector to the other point.
@@ -217,7 +217,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point3D : public Point {
res.y = -x * (other.z) + z * (other.x);
res.z = x * (other.y) - y * (other.x);
return res;
};
}
/*! \brief Get a unit perpendicular from this point (treating it as a vector):
*
@@ -273,13 +273,13 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
double x{0.0};
double y{0.0};
Point2D(){};
Point2D(double xv, double yv) : x(xv), y(yv){};
~Point2D(){};
Point2D() {}
Point2D(double xv, double yv) : x(xv), y(yv) {}
~Point2D() {}
Point2D(const Point2D &other) : Point(other), x(other.x), y(other.y) {}
//! construct from a Point3D (ignoring the z coordinate)
Point2D(const Point3D &p3d) : Point(p3d), x(p3d.x), y(p3d.y){};
Point2D(const Point3D &p3d) : Point(p3d), x(p3d.x), y(p3d.y) {}
virtual Point *copy() const { return new Point2D(*this); }
@@ -307,31 +307,31 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
x = other.x;
y = other.y;
return *this;
};
}
Point2D &operator+=(const Point2D &other) {
x += other.x;
y += other.y;
return *this;
};
}
Point2D &operator-=(const Point2D &other) {
x -= other.x;
y -= other.y;
return *this;
};
}
Point2D &operator*=(double scale) {
x *= scale;
y *= scale;
return *this;
};
}
Point2D &operator/=(double scale) {
x /= scale;
y /= scale;
return *this;
};
}
Point2D operator-() const {
Point2D res(x, y);
@@ -344,7 +344,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
double ln = this->length();
x /= ln;
y /= ln;
};
}
void rotate90() {
double temp = x;
@@ -356,17 +356,17 @@ class RDKIT_RDGEOMETRYLIB_EXPORT Point2D : public Point {
// double res = pow(x,2) + pow(y,2);
double res = x * x + y * y;
return sqrt(res);
};
}
double lengthSq() const {
double res = x * x + y * y;
return res;
};
}
double dotProduct(const Point2D &other) const {
double res = x * (other.x) + y * (other.y);
return res;
};
}
double angleTo(const Point2D &other) const {
Point2D t1, t2;
@@ -405,7 +405,7 @@ class RDKIT_RDGEOMETRYLIB_EXPORT PointND : public Point {
PointND(unsigned int dim) {
RDNumeric::Vector<double> *nvec = new RDNumeric::Vector<double>(dim, 0.0);
dp_storage.reset(nvec);
};
}
PointND(const PointND &other) : Point(other) {
RDNumeric::Vector<double> *nvec =

View File

@@ -39,8 +39,8 @@ struct RDKIT_ABBREVIATIONS_EXPORT AbbreviationMatch {
AbbreviationDefinition abbrev;
AbbreviationMatch(const std::vector<std::pair<int, int>>& matchArg,
const AbbreviationDefinition& abbrevArg)
: match(matchArg), abbrev(abbrevArg){};
AbbreviationMatch() : match(), abbrev(){};
: match(matchArg), abbrev(abbrevArg) {}
AbbreviationMatch() : match(), abbrev() {}
bool operator==(const AbbreviationMatch& other) const {
return abbrev == other.abbrev && match == other.match;
}

View File

@@ -112,31 +112,31 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
virtual Atom *copy() const;
//! returns our atomic number
int getAtomicNum() const { return d_atomicNum; };
int getAtomicNum() const { return d_atomicNum; }
//! sets our atomic number
void setAtomicNum(int newNum) { d_atomicNum = newNum; };
void setAtomicNum(int newNum) { d_atomicNum = newNum; }
//! returns our symbol (determined by our atomic number)
std::string getSymbol() const;
//! returns whether or not this instance belongs to a molecule
bool hasOwningMol() const { return dp_mol != nullptr; };
bool hasOwningMol() const { return dp_mol != nullptr; }
//! returns a reference to the ROMol that owns this instance
ROMol &getOwningMol() const {
PRECONDITION(dp_mol, "no owner");
return *dp_mol;
};
}
//! returns our index within the ROMol
unsigned int getIdx() const { return d_index; };
unsigned int getIdx() const { return d_index; }
//! sets our index within the ROMol
/*!
<b>Notes:</b>
- this makes no sense if we do not have an owning molecule
- the index should be <tt>< this->getOwningMol()->getNumAtoms()</tt>
*/
void setIdx(unsigned int index) { d_index = index; };
void setIdx(unsigned int index) { d_index = index; }
//! overload
template <class U>
void setIdx(const U index) {
@@ -196,31 +196,29 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
<b>Notes:</b>
- requires an owning molecule
*/
unsigned int getNumRadicalElectrons() const { return d_numRadicalElectrons; };
void setNumRadicalElectrons(unsigned int num) {
d_numRadicalElectrons = num;
};
unsigned int getNumRadicalElectrons() const { return d_numRadicalElectrons; }
void setNumRadicalElectrons(unsigned int num) { d_numRadicalElectrons = num; }
//! returns the formal charge of this atom
int getFormalCharge() const { return d_formalCharge; };
int getFormalCharge() const { return d_formalCharge; }
//! set's the formal charge of this atom
void setFormalCharge(int what) { d_formalCharge = what; };
void setFormalCharge(int what) { d_formalCharge = what; }
//! \brief sets our \c noImplicit flag, indicating whether or not
//! we are allowed to have implicit Hs
void setNoImplicit(bool what) { df_noImplicit = what; };
void setNoImplicit(bool what) { df_noImplicit = what; }
//! returns the \c noImplicit flag
bool getNoImplicit() const { return df_noImplicit; };
bool getNoImplicit() const { return df_noImplicit; }
//! sets our number of explicit Hs
void setNumExplicitHs(unsigned int what) { d_numExplicitHs = what; };
void setNumExplicitHs(unsigned int what) { d_numExplicitHs = what; }
//! returns our number of explicit Hs
unsigned int getNumExplicitHs() const { return d_numExplicitHs; };
unsigned int getNumExplicitHs() const { return d_numExplicitHs; }
//! sets our \c isAromatic flag, indicating whether or not we are aromatic
void setIsAromatic(bool what) { df_isAromatic = what; };
void setIsAromatic(bool what) { df_isAromatic = what; }
//! returns our \c isAromatic flag
bool getIsAromatic() const { return df_isAromatic; };
bool getIsAromatic() const { return df_isAromatic; }
//! returns our mass
double getMass() const;
@@ -228,23 +226,23 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
//! sets our isotope number
void setIsotope(unsigned int what);
//! returns our isotope number
unsigned int getIsotope() const { return d_isotope; };
unsigned int getIsotope() const { return d_isotope; }
//! sets our \c chiralTag
void setChiralTag(ChiralType what) { d_chiralTag = what; };
void setChiralTag(ChiralType what) { d_chiralTag = what; }
//! inverts our \c chiralTag
void invertChirality();
//! returns our \c chiralTag
ChiralType getChiralTag() const {
return static_cast<ChiralType>(d_chiralTag);
};
}
//! sets our hybridization
void setHybridization(HybridizationType what) { d_hybrid = what; };
void setHybridization(HybridizationType what) { d_hybrid = what; }
//! returns our hybridization
HybridizationType getHybridization() const {
return static_cast<HybridizationType>(d_hybrid);
};
}
// ------------------------------------
// Some words of explanation before getting down into
@@ -259,7 +257,7 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
// ------------------------------------
// This method can be used to distinguish query atoms from standard atoms:
virtual bool hasQuery() const { return false; };
virtual bool hasQuery() const { return false; }
//! NOT CALLABLE
virtual void setQuery(QUERYATOM_QUERY *what);
@@ -356,10 +354,10 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
*/
int calcImplicitValence(bool strict = true);
AtomMonomerInfo *getMonomerInfo() { return dp_monomerInfo; };
const AtomMonomerInfo *getMonomerInfo() const { return dp_monomerInfo; };
AtomMonomerInfo *getMonomerInfo() { return dp_monomerInfo; }
const AtomMonomerInfo *getMonomerInfo() const { return dp_monomerInfo; }
//! takes ownership of the pointer
void setMonomerInfo(AtomMonomerInfo *info) { dp_monomerInfo = info; };
void setMonomerInfo(AtomMonomerInfo *info) { dp_monomerInfo = info; }
//! Set the atom map Number of the atom
void setAtomMapNum(int mapno, bool strict = true) {
@@ -384,7 +382,7 @@ class RDKIT_GRAPHMOL_EXPORT Atom : public RDProps {
//! sets our owning molecule
void setOwningMol(ROMol *other);
//! sets our owning molecule
void setOwningMol(ROMol &other) { setOwningMol(&other); };
void setOwningMol(ROMol &other) { setOwningMol(&other); }
bool df_isAromatic;
bool df_noImplicit;

View File

@@ -31,7 +31,7 @@ template <class Atom_, class Mol_>
class RDKIT_GRAPHMOL_EXPORT AtomIterator_ {
public:
typedef AtomIterator_<Atom_, Mol_> ThisType;
AtomIterator_() : _mol(nullptr){};
AtomIterator_() : _mol(nullptr) {}
AtomIterator_(Mol_ *mol);
AtomIterator_(Mol_ *mol, int pos);
AtomIterator_(const ThisType &other);
@@ -74,7 +74,7 @@ template <class Atom_, class Mol_>
class RDKIT_GRAPHMOL_EXPORT HeteroatomIterator_ {
public:
typedef HeteroatomIterator_<Atom_, Mol_> ThisType;
HeteroatomIterator_() : _mol(nullptr){};
HeteroatomIterator_() : _mol(nullptr) {}
HeteroatomIterator_(Mol_ *mol);
HeteroatomIterator_(Mol_ *mol, int pos);
~HeteroatomIterator_();
@@ -111,7 +111,7 @@ template <class Atom_, class Mol_>
class RDKIT_GRAPHMOL_EXPORT AromaticAtomIterator_ {
public:
typedef AromaticAtomIterator_<Atom_, Mol_> ThisType;
AromaticAtomIterator_() : _mol(nullptr){};
AromaticAtomIterator_() : _mol(nullptr) {}
AromaticAtomIterator_(Mol_ *mol);
AromaticAtomIterator_(Mol_ *mol, int pos);
~AromaticAtomIterator_();
@@ -144,7 +144,7 @@ template <class Atom_, class Mol_>
class RDKIT_GRAPHMOL_EXPORT QueryAtomIterator_ {
public:
typedef QueryAtomIterator_<Atom_, Mol_> ThisType;
QueryAtomIterator_() : _mol(nullptr){};
QueryAtomIterator_() : _mol(nullptr) {}
QueryAtomIterator_(Mol_ *mol, QueryAtom const *what);
QueryAtomIterator_(Mol_ *mol, int pos);
~QueryAtomIterator_();
@@ -178,7 +178,7 @@ template <class Atom_, class Mol_>
class RDKIT_GRAPHMOL_EXPORT MatchingAtomIterator_ {
public:
typedef MatchingAtomIterator_<Atom_, Mol_> ThisType;
MatchingAtomIterator_() : _mol(nullptr), _qF(nullptr){};
MatchingAtomIterator_() : _mol(nullptr), _qF(nullptr) {}
MatchingAtomIterator_(Mol_ *mol, bool (*fn)(Atom_ *));
MatchingAtomIterator_(Mol_ *mol, int pos);
~MatchingAtomIterator_();

View File

@@ -117,9 +117,9 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
virtual Bond *copy() const;
//! returns our \c bondType
BondType getBondType() const { return static_cast<BondType>(d_bondType); };
BondType getBondType() const { return static_cast<BondType>(d_bondType); }
//! sets our \c bondType
void setBondType(BondType bT) { d_bondType = bT; };
void setBondType(BondType bT) { d_bondType = bT; }
//! \brief returns our \c bondType as a double
//! (e.g. SINGLE->1.0, AROMATIC->1.5, etc.)
double getBondTypeAsDouble() const;
@@ -132,27 +132,27 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
double getValenceContrib(const Atom *at) const;
//! sets our \c isAromatic flag
void setIsAromatic(bool what) { df_isAromatic = what; };
void setIsAromatic(bool what) { df_isAromatic = what; }
//! returns the status of our \c isAromatic flag
bool getIsAromatic() const { return df_isAromatic; };
bool getIsAromatic() const { return df_isAromatic; }
//! sets our \c isConjugated flag
void setIsConjugated(bool what) { df_isConjugated = what; };
void setIsConjugated(bool what) { df_isConjugated = what; }
//! returns the status of our \c isConjugated flag
bool getIsConjugated() const { return df_isConjugated; };
bool getIsConjugated() const { return df_isConjugated; }
//! returns whether or not this instance belongs to a molecule
bool hasOwningMol() const { return dp_mol != nullptr; };
bool hasOwningMol() const { return dp_mol != nullptr; }
//! returns a reference to the ROMol that owns this instance
ROMol &getOwningMol() const {
PRECONDITION(dp_mol, "no owner");
return *dp_mol;
};
}
//! sets our owning molecule
void setOwningMol(ROMol *other);
//! sets our owning molecule
void setOwningMol(ROMol &other) { setOwningMol(&other); };
void setOwningMol(ROMol &other) { setOwningMol(&other); }
//! returns our index within the ROMol
/*!
@@ -160,28 +160,28 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
- this makes no sense if we do not have an owning molecule
*/
unsigned int getIdx() const { return d_index; };
unsigned int getIdx() const { return d_index; }
//! sets our index within the ROMol
/*!
<b>Notes:</b>
- this makes no sense if we do not have an owning molecule
- the index should be <tt>< this->getOwningMol()->getNumBonds()</tt>
*/
void setIdx(unsigned int index) { d_index = index; };
void setIdx(unsigned int index) { d_index = index; }
//! returns the index of our begin Atom
/*!
<b>Notes:</b>
- this makes no sense if we do not have an owning molecule
*/
unsigned int getBeginAtomIdx() const { return d_beginAtomIdx; };
unsigned int getBeginAtomIdx() const { return d_beginAtomIdx; }
//! returns the index of our end Atom
/*!
<b>Notes:</b>
- this makes no sense if we do not have an owning molecule
*/
unsigned int getEndAtomIdx() const { return d_endAtomIdx; };
unsigned int getEndAtomIdx() const { return d_endAtomIdx; }
//! given the index of one Atom, returns the index of the other
/*!
@@ -241,7 +241,7 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
// ------------------------------------
// This method can be used to distinguish query bonds from standard bonds
virtual bool hasQuery() const { return false; };
virtual bool hasQuery() const { return false; }
// FIX: the const crap here is all mucked up.
//! NOT CALLABLE
@@ -265,9 +265,9 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
virtual bool Match(Bond const *what) const;
//! sets our direction
void setBondDir(BondDir what) { d_dirTag = what; };
void setBondDir(BondDir what) { d_dirTag = what; }
//! returns our direction
BondDir getBondDir() const { return static_cast<BondDir>(d_dirTag); };
BondDir getBondDir() const { return static_cast<BondDir>(d_dirTag); }
//! sets our stereo code
/*!
@@ -286,9 +286,9 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
"Stereo atoms should be specified before specifying CIS/TRANS "
"bond stereochemistry")
d_stereo = what;
};
}
//! returns our stereo code
BondStereo getStereo() const { return static_cast<BondStereo>(d_stereo); };
BondStereo getStereo() const { return static_cast<BondStereo>(d_stereo); }
//! sets the atoms to be considered as reference points for bond stereo
/*!
@@ -310,12 +310,12 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
const_cast<Bond *>(this)->dp_stereoAtoms = new INT_VECT();
}
return *dp_stereoAtoms;
};
}
//! \overload
INT_VECT &getStereoAtoms() {
if (!dp_stereoAtoms) dp_stereoAtoms = new INT_VECT();
return *dp_stereoAtoms;
};
}
//! calculates any of our lazy \c properties
/*!
@@ -328,7 +328,7 @@ class RDKIT_GRAPHMOL_EXPORT Bond : public RDProps {
//! sets our owning molecule
// void setOwningMol(ROMol *other);
//! sets our owning molecule
// void setOwningMol(ROMol &other) {setOwningMol(&other);};
// void setOwningMol(ROMol &other) { setOwningMol(&other); }
bool df_isAromatic;
bool df_isConjugated;
std::uint8_t d_bondType;

View File

@@ -28,7 +28,7 @@ class RDKIT_GRAPHMOL_EXPORT BondIterator_ {
// FIX: I'm not pleased with the lack of internal testing code
// (PREs and the like) in here
public:
BondIterator_() {};
BondIterator_() {}
BondIterator_(ROMol *mol);
BondIterator_(ROMol *mol, ROMol::EDGE_ITER pos);
BondIterator_(const BondIterator_ &other);
@@ -51,7 +51,7 @@ class RDKIT_GRAPHMOL_EXPORT BondIterator_ {
//! but it theoretically ought to be RandomAccess.
class RDKIT_GRAPHMOL_EXPORT ConstBondIterator_ {
public:
ConstBondIterator_() {};
ConstBondIterator_() {}
ConstBondIterator_(ROMol const *mol);
ConstBondIterator_(ROMol const *mol, ROMol::EDGE_ITER pos);
ConstBondIterator_(const ConstBondIterator_ &other);

View File

@@ -52,8 +52,8 @@ RDKIT_CIPLABELER_EXPORT void assignCIPLabels(ROMol &mol);
* \param bonds - bitset with the bond indexes to be labeled.
*
*/
RDKIT_CIPLABELER_EXPORT void
assignCIPLabels(ROMol &mol, const boost::dynamic_bitset<> &atoms,
const boost::dynamic_bitset<> &bonds);
} // namespace CIPLabeler
} // namespace RDKit
RDKIT_CIPLABELER_EXPORT void assignCIPLabels(
ROMol &mol, const boost::dynamic_bitset<> &atoms,
const boost::dynamic_bitset<> &bonds);
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -21,10 +21,11 @@ namespace RDKit {
namespace CIPLabeler {
template <typename T, typename U> class CIPMolSpan {
public:
template <typename T, typename U>
class CIPMolSpan {
public:
class CIPMolIter {
public:
public:
CIPMolIter() = delete;
CIPMolIter(ROMol &mol, U pos) : d_mol{mol}, d_pos{std::move(pos)} {}
@@ -40,29 +41,30 @@ public:
bool operator!=(const CIPMolIter &it) const { return d_pos != it.d_pos; }
private:
private:
ROMol &d_mol;
U d_pos;
T d_current = nullptr;
};
public:
public:
CIPMolSpan() = delete;
CIPMolSpan(ROMol &mol, std::pair<U, U> &&itr)
: d_mol{mol}, d_istart{std::move(itr.first)},
: d_mol{mol},
d_istart{std::move(itr.first)},
d_iend{std::move(itr.second)} {}
CIPMolIter begin() { return {d_mol, d_istart}; }
CIPMolIter end() { return {d_mol, d_iend}; }
private:
private:
ROMol &d_mol;
const U d_istart;
const U d_iend;
};
class CIPMol {
public:
public:
CIPMol() = delete;
explicit CIPMol(ROMol &mol);
@@ -91,12 +93,12 @@ public:
// Dative bonds get bond order 0.
int getBondOrder(Bond *bond) const;
private:
private:
ROMol &d_mol;
std::unique_ptr<RWMol> dp_kekulized_mol = nullptr;
std::vector<boost::rational<int>> d_atomnums;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -23,12 +23,12 @@ namespace CIPLabeler {
*
*/
enum class Descriptor {
NONE, // Unspecified
NONE, // Unspecified
UNKNOWN,
ns, // Other
/**
* Tetrahedral
*/
ns, // Other
/**
* Tetrahedral
*/
R,
S,
r,
@@ -53,45 +53,45 @@ enum class Descriptor {
static std::string to_string(const Descriptor &desc) {
switch (desc) {
case Descriptor::NONE:
return "NONE";
case Descriptor::UNKNOWN:
return "UNKNOWN";
case Descriptor::ns:
return "ns";
case Descriptor::R:
return "R";
case Descriptor::S:
return "S";
case Descriptor::r:
return "r";
case Descriptor::s:
return "s";
case Descriptor::seqTrans:
return "e";
case Descriptor::seqCis:
return "z";
case Descriptor::E:
return "E";
case Descriptor::Z:
return "Z";
case Descriptor::M:
return "M";
case Descriptor::P:
return "P";
case Descriptor::m:
return "m";
case Descriptor::p:
return "p";
case Descriptor::SP_4:
return "SP_4";
case Descriptor::TBPY_5:
return "TBPY_5";
case Descriptor::OC_6:
return "OC_6";
case Descriptor::NONE:
return "NONE";
case Descriptor::UNKNOWN:
return "UNKNOWN";
case Descriptor::ns:
return "ns";
case Descriptor::R:
return "R";
case Descriptor::S:
return "S";
case Descriptor::r:
return "r";
case Descriptor::s:
return "s";
case Descriptor::seqTrans:
return "e";
case Descriptor::seqCis:
return "z";
case Descriptor::E:
return "E";
case Descriptor::Z:
return "Z";
case Descriptor::M:
return "M";
case Descriptor::P:
return "P";
case Descriptor::m:
return "m";
case Descriptor::p:
return "p";
case Descriptor::SP_4:
return "SP_4";
case Descriptor::TBPY_5:
return "TBPY_5";
case Descriptor::OC_6:
return "OC_6";
}
throw std::runtime_error("Unknown descriptor");
}
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -44,8 +44,7 @@ class CIPMol;
*
*/
class Digraph {
public:
public:
Digraph() = delete;
Digraph(const Digraph &) = delete;
Digraph &operator=(const Digraph &) = delete;
@@ -93,7 +92,7 @@ public:
Node &addNode(std::vector<char> &&visit, Atom *atom,
boost::rational<int> &&frac, int dist, int flags);
private:
private:
const CIPMol &d_mol;
// The node from which the Digraph is first initialized.
@@ -113,5 +112,5 @@ private:
void addEdge(Node *beg, Bond *bond, Node *end);
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -21,8 +21,7 @@ namespace CIPLabeler {
class Node;
class Edge {
public:
public:
Edge() = delete;
Edge(const Edge &) = delete;
Edge &operator=(const Edge &) = delete;
@@ -47,12 +46,12 @@ public:
void flip();
private:
private:
Node *dp_beg;
Node *dp_end;
Bond *dp_bond;
Descriptor d_aux = Descriptor::NONE;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -30,12 +30,12 @@ namespace CIPLabeler {
class CIPMol;
enum class Type {
Cv4D3, // =C(X)-
Nv3D2, // =N-
Nv4D3Plus, // =[N+]<
Nv2D2Minus, // -[N-]-
Cv3D3Minus, // -[C(X)-]-
Ov3D2Plus, // -[O+]=
Cv4D3, // =C(X)-
Nv3D2, // =N-
Nv4D3Plus, // =[N+]<
Nv2D2Minus, // -[N-]-
Cv3D3Minus, // -[C(X)-]-
Ov3D2Plus, // -[O+]=
Other
};
@@ -48,5 +48,5 @@ enum class Type {
*/
std::vector<boost::rational<int>> calcFracAtomNums(const CIPMol &mol);
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -25,7 +25,7 @@ namespace CIPLabeler {
class Digraph;
class Node {
public:
public:
/**
* Flag indicates whether the node has been expanded.
*/
@@ -105,7 +105,7 @@ public:
std::vector<Edge *> getNonTerminalOutEdges() const;
private:
private:
Digraph *dp_g;
Atom *dp_atom;
int d_dist;
@@ -121,5 +121,5 @@ private:
Node *newTerminalChild(int idx, Atom *atom, int flags) const;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -19,8 +19,7 @@ namespace CIPLabeler {
*
*/
class Priority {
public:
public:
Priority() = delete;
Priority(bool unique, bool pseudoAsym)
@@ -42,10 +41,10 @@ public:
*/
bool isPseudoAsymetric() const { return d_pseudoAsym; }
private:
private:
bool d_unique;
bool d_pseudoAsym;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -26,8 +26,7 @@ class Node;
*
*/
class Sort {
public:
public:
Sort(const SequenceRule *comparator);
Sort(std::vector<const SequenceRule *> comparators);
@@ -37,15 +36,15 @@ public:
Priority prioritize(const Node *node, std::vector<Edge *> &edges,
bool deep = true) const;
std::vector<std::vector<Edge *>>
getGroups(const std::vector<Edge *> &sorted) const;
std::vector<std::vector<Edge *>> getGroups(
const std::vector<Edge *> &sorted) const;
private:
private:
const std::vector<const SequenceRule *> d_rules;
int compareSubstituents(const Node *node, const Edge *a, const Edge *b,
bool deep) const;
}; // namespace CIPLabeler
}; // namespace CIPLabeler
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -21,8 +21,8 @@ namespace CIPLabeler {
class RDKIT_CIPLABELER_EXPORT TooManyNodesException
: public std::runtime_error {
public:
TooManyNodesException(const std::string &msg) : std::runtime_error(msg){};
TooManyNodesException(const std::string &msg) : std::runtime_error(msg) {}
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace RDKit

View File

@@ -27,8 +27,7 @@ namespace CIPLabeler {
class Rules;
class Configuration {
public:
public:
template <typename T>
static int parity4(const std::vector<T> &trg, const std::vector<T> &ref) {
if (ref.size() != 4 || trg.size() != ref.size()) {
@@ -38,94 +37,118 @@ public:
if (ref[0] == trg[0]) {
if (ref[1] == trg[1]) {
// a,b,c,d -> a,b,c,d
if (ref[2] == trg[2] && ref[3] == trg[3])
if (ref[2] == trg[2] && ref[3] == trg[3]) {
return 2;
}
// a,b,c,d -> a,b,d,c
if (ref[2] == trg[3] && ref[3] == trg[2])
if (ref[2] == trg[3] && ref[3] == trg[2]) {
return 1;
}
} else if (ref[1] == trg[2]) {
// a,b,c,d -> a,c,b,d
if (ref[2] == trg[1] && ref[3] == trg[3])
if (ref[2] == trg[1] && ref[3] == trg[3]) {
return 1;
}
// a,b,c,d -> a,c,d,b
if (ref[2] == trg[3] && ref[3] == trg[1])
if (ref[2] == trg[3] && ref[3] == trg[1]) {
return 2;
}
} else if (ref[1] == trg[3]) {
// a,b,c,d -> a,d,c,b
if (ref[2] == trg[2] && ref[3] == trg[1])
if (ref[2] == trg[2] && ref[3] == trg[1]) {
return 1;
}
// a,b,c,d -> a,d,b,c
if (ref[2] == trg[1] && ref[3] == trg[2])
if (ref[2] == trg[1] && ref[3] == trg[2]) {
return 2;
}
}
} else if (ref[0] == trg[1]) {
if (ref[1] == trg[0]) {
// a,b,c,d -> b,a,c,d
if (ref[2] == trg[2] && ref[3] == trg[3])
if (ref[2] == trg[2] && ref[3] == trg[3]) {
return 1;
}
// a,b,c,d -> b,a,d,c
if (ref[2] == trg[3] && ref[3] == trg[2])
if (ref[2] == trg[3] && ref[3] == trg[2]) {
return 2;
}
} else if (ref[1] == trg[2]) {
// a,b,c,d -> b,c,a,d
if (ref[2] == trg[0] && ref[3] == trg[3])
if (ref[2] == trg[0] && ref[3] == trg[3]) {
return 2;
}
// a,b,c,d -> b,c,d,a
if (ref[2] == trg[3] && ref[3] == trg[0])
if (ref[2] == trg[3] && ref[3] == trg[0]) {
return 1;
}
} else if (ref[1] == trg[3]) {
// a,b,c,d -> b,d,c,a
if (ref[2] == trg[2] && ref[3] == trg[0])
if (ref[2] == trg[2] && ref[3] == trg[0]) {
return 2;
}
// a,b,c,d -> b,d,a,c
if (ref[2] == trg[0] && ref[3] == trg[2])
if (ref[2] == trg[0] && ref[3] == trg[2]) {
return 1;
}
}
} else if (ref[0] == trg[2]) {
if (ref[1] == trg[1]) {
// a,b,c,d -> c,b,a,d
if (ref[2] == trg[0] && ref[3] == trg[3])
if (ref[2] == trg[0] && ref[3] == trg[3]) {
return 1;
}
// a,b,c,d -> c,b,d,a
if (ref[2] == trg[3] && ref[3] == trg[0])
if (ref[2] == trg[3] && ref[3] == trg[0]) {
return 2;
}
} else if (ref[1] == trg[0]) {
// a,b,c,d -> c,a,b,d
if (ref[2] == trg[1] && ref[3] == trg[3])
if (ref[2] == trg[1] && ref[3] == trg[3]) {
return 2;
}
// a,b,c,d -> c,a,d,b
if (ref[2] == trg[3] && ref[3] == trg[1])
if (ref[2] == trg[3] && ref[3] == trg[1]) {
return 1;
}
} else if (ref[1] == trg[3]) {
// a,b,c,d -> c,d,a,b
if (ref[2] == trg[0] && ref[3] == trg[1])
if (ref[2] == trg[0] && ref[3] == trg[1]) {
return 2;
}
// a,b,c,d -> c,d,b,a
if (ref[2] == trg[1] && ref[3] == trg[0])
if (ref[2] == trg[1] && ref[3] == trg[0]) {
return 1;
}
}
} else if (ref[0] == trg[3]) {
if (ref[1] == trg[1]) {
// a,b,c,d -> d,b,c,a
if (ref[2] == trg[2] && ref[3] == trg[0])
if (ref[2] == trg[2] && ref[3] == trg[0]) {
return 1;
}
// a,b,c,d -> d,b,a,c
if (ref[2] == trg[0] && ref[3] == trg[2])
if (ref[2] == trg[0] && ref[3] == trg[2]) {
return 2;
}
} else if (ref[1] == trg[2]) {
// a,b,c,d -> d,c,b,a
if (ref[2] == trg[1] && ref[3] == trg[0])
if (ref[2] == trg[1] && ref[3] == trg[0]) {
return 2;
}
// a,b,c,d -> d,c,a,b
if (ref[2] == trg[0] && ref[3] == trg[1])
if (ref[2] == trg[0] && ref[3] == trg[1]) {
return 1;
}
} else if (ref[1] == trg[0]) {
// a,b,c,d -> d,a,c,b
if (ref[2] == trg[2] && ref[3] == trg[1])
if (ref[2] == trg[2] && ref[3] == trg[1]) {
return 2;
}
// a,b,c,d -> d,a,b,c
if (ref[2] == trg[1] && ref[3] == trg[2])
if (ref[2] == trg[1] && ref[3] == trg[2]) {
return 1;
}
}
}
@@ -156,7 +179,7 @@ public:
virtual void setPrimaryLabel(Descriptor desc) = 0;
protected:
protected:
Edge *findInternalEdge(const std::vector<Edge *> &edges, Atom *f1, Atom *f2);
bool isInternalEdge(const Edge *edge, Atom *f1, Atom *f2);
@@ -165,7 +188,7 @@ protected:
void setCarriers(std::vector<Atom *> &&carriers);
private:
private:
/**
* Foci are the atoms on which the configuration is based,
* and which will carry the label. E.g., the chiral atom in
@@ -183,7 +206,7 @@ private:
Digraph d_digraph;
}; // namespace CIPLabeler
}; // namespace CIPLabeler
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -16,7 +16,7 @@ namespace RDKit {
namespace CIPLabeler {
class Sp2Bond : public Configuration {
public:
public:
Sp2Bond() = delete;
Sp2Bond(const CIPMol &mol, Bond *bond, Atom *startAtom, Atom *endAtom,
@@ -28,14 +28,14 @@ public:
Descriptor label(Node *root1, Digraph &digraph, const Rules &comp) override;
private:
private:
Bond *dp_bond;
// bond->getStereo() can return both E/Z or CIS/TRANS,
// so we cache CIS/TRANS we found.
Bond::BondStereo d_cfg;
}; // namespace CIPLabeler
}; // namespace CIPLabeler
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -16,7 +16,7 @@ namespace RDKit {
namespace CIPLabeler {
class Tetrahedral : public Configuration {
public:
public:
Tetrahedral() = delete;
Tetrahedral(const CIPMol &mol, Atom *focus);
@@ -27,9 +27,9 @@ public:
Descriptor label(Node *node, Digraph &digraph, const Rules &comp) override;
private:
private:
Descriptor label(Node *node, const Rules &comp) const;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -30,19 +30,19 @@ namespace CIPLabeler {
* @see Descriptor
*/
class PairList {
public:
public:
static Descriptor ref(Descriptor descriptor) {
switch (descriptor) {
case Descriptor::R:
case Descriptor::M:
case Descriptor::seqCis:
return Descriptor::R;
case Descriptor::S:
case Descriptor::P:
case Descriptor::seqTrans:
return Descriptor::S;
default:
return Descriptor::NONE;
case Descriptor::R:
case Descriptor::M:
case Descriptor::seqCis:
return Descriptor::R;
case Descriptor::S:
case Descriptor::P:
case Descriptor::seqTrans:
return Descriptor::S;
default:
return Descriptor::NONE;
}
}
@@ -77,16 +77,16 @@ public:
bool add(Descriptor descriptor) {
switch (descriptor) {
case Descriptor::R:
case Descriptor::S:
case Descriptor::M:
case Descriptor::P:
case Descriptor::seqTrans:
case Descriptor::seqCis:
addAndPair(descriptor);
return true;
default:
return false;
case Descriptor::R:
case Descriptor::S:
case Descriptor::M:
case Descriptor::P:
case Descriptor::seqTrans:
case Descriptor::seqCis:
addAndPair(descriptor);
return true;
default:
return false;
}
}
@@ -96,7 +96,8 @@ public:
*
* @param descriptors a collection of descriptors to be added
*/
template <typename T> void addAll(const T &descriptors) {
template <typename T>
void addAll(const T &descriptors) {
for (const auto &descriptor : descriptors) {
add(descriptor);
}
@@ -151,7 +152,7 @@ public:
return ss.str();
}
private:
private:
std::vector<Descriptor> d_descriptors;
std::uint32_t d_pairing = 0;
@@ -173,5 +174,5 @@ private:
}
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -17,11 +17,11 @@ namespace CIPLabeler {
// CIP Rule 1a: Higher atomic number precedes lower.
class Rule1a : public SequenceRule {
public:
public:
Rule1a();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -24,8 +24,7 @@ namespace CIPLabeler {
*
*/
class Rule1b : public SequenceRule {
public:
public:
Rule1b();
int compare(const Edge *a, const Edge *b) const override;
@@ -34,9 +33,9 @@ public:
* Flag indicates whether to match the problematic
* IUPAC 2013 recommendations for Rule 1B.
*/
private:
private:
static const bool IUPAC_2013 = false;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -31,12 +31,11 @@ namespace CIPLabeler {
* cases as the elements atomic weight."</i>
*/
class Rule2 : public SequenceRule {
public:
public:
Rule2();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -22,12 +22,11 @@ namespace CIPLabeler {
*
*/
class Rule3 : public SequenceRule {
public:
public:
Rule3();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -22,12 +22,11 @@ namespace CIPLabeler {
*
*/
class Rule4a : public SequenceRule {
public:
public:
Rule4a();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -23,15 +23,14 @@ namespace CIPLabeler {
*
*/
class Rule4b : public SequenceRule {
public:
public:
Rule4b();
Rule4b(Descriptor ref);
int compare(const Edge *a, const Edge *b) const override;
private:
private:
const Descriptor d_ref = Descriptor::NONE;
std::vector<Descriptor> getReferenceDescriptors(const Node *node) const;
@@ -43,14 +42,14 @@ private:
std::vector<std::vector<const Node *>> initialLevel(const Node *node) const;
std::vector<std::vector<const Node *>>
getNextLevel(const std::vector<std::vector<const Node *>> &prevLevel) const;
std::vector<std::vector<const Node *>> getNextLevel(
const std::vector<std::vector<const Node *>> &prevLevel) const;
std::vector<const Node *>
toNodeList(const std::vector<Edge *> &eqEdges) const;
std::vector<const Node *> toNodeList(
const std::vector<Edge *> &eqEdges) const;
std::vector<PairList>
newPairLists(const std::vector<Descriptor> &descriptors) const;
std::vector<PairList> newPairLists(
const std::vector<Descriptor> &descriptors) const;
void fillPairs(const Node *beg, PairList &plist) const;
@@ -60,5 +59,5 @@ private:
Sort getRefSorter(const SequenceRule *replacement_rule) const;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -21,12 +21,11 @@ namespace CIPLabeler {
*
*/
class Rule4c : public SequenceRule {
public:
public:
Rule4c();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -22,12 +22,11 @@ namespace CIPLabeler {
* </i>
*/
class Rule5 : public SequenceRule {
public:
public:
Rule5();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -21,15 +21,14 @@ namespace CIPLabeler {
*
*/
class Rule5New : public SequenceRule {
public:
public:
Rule5New();
Rule5New(Descriptor ref);
int compare(const Edge *a, const Edge *b) const override;
private:
private:
const Descriptor d_ref = Descriptor::NONE;
void fillPairs(const Node *beg, PairList &plist) const;
@@ -37,5 +36,5 @@ private:
Sort getRefSorter(const SequenceRule *replacement_rule) const;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -19,11 +19,11 @@ namespace CIPLabeler {
* <b>Sequence Rule 6 (proposed)</b>
*/
class Rule6 : public SequenceRule {
public:
public:
Rule6();
int compare(const Edge *a, const Edge *b) const override;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -20,8 +20,7 @@ namespace RDKit {
namespace CIPLabeler {
class Rules : public SequenceRule {
public:
public:
Rules() = delete;
Rules(std::initializer_list<SequenceRule *> rules) {
@@ -83,9 +82,9 @@ public:
return 0;
}
private:
private:
std::vector<const SequenceRule *> d_rules;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -26,14 +26,14 @@ namespace CIPLabeler {
class CIPMol;
namespace {
template <typename T> inline int three_way_comparison(const T &x, const T &y) {
template <typename T>
inline int three_way_comparison(const T &x, const T &y) {
return x < y ? -1 : (x == y ? 0 : 1);
}
} // namespace
} // namespace
class SequenceRule {
public:
public:
SequenceRule();
virtual ~SequenceRule();
@@ -56,12 +56,12 @@ public:
virtual int compare(const Edge *a, const Edge *b) const = 0;
protected:
protected:
std::unique_ptr<const Sort> dp_sorter = nullptr;
private:
private:
bool areUpEdges(Node *aNode, Node *bNode, Edge *aEdge, Edge *bEdge) const;
};
} // namespace CIPLabeler
} // namespace RDKit
} // namespace CIPLabeler
} // namespace RDKit

View File

@@ -55,7 +55,7 @@ class RDKIT_GRAPHMOL_EXPORT MolStackElem {
explicit MolStackElem(Atom *at) {
type = MOL_STACK_ATOM;
obj.atom = at;
};
}
//! construct a bond node
/*!
@@ -67,12 +67,12 @@ class RDKIT_GRAPHMOL_EXPORT MolStackElem {
type = MOL_STACK_BOND;
obj.bond = bond;
number = idx;
};
}
//! construct for a ring closure
explicit MolStackElem(int idx) {
type = MOL_STACK_RING;
number = idx;
};
}
//! construct for a branch opening or closing
explicit MolStackElem(const char *chr, int idx) {
switch (chr[0]) {

View File

@@ -72,8 +72,7 @@ class RDKIT_CHEMREACTIONS_EXPORT CartesianProductStrategy
size_t m_numPermutationsProcessed{};
public:
CartesianProductStrategy()
: EnumerationStrategyBase() {}
CartesianProductStrategy() : EnumerationStrategyBase() {}
using EnumerationStrategyBase::initialize;

View File

@@ -60,8 +60,7 @@ namespace RDKit {
struct RDKIT_CHEMREACTIONS_EXPORT EnumerationParams {
int reagentMaxMatchCount{INT_MAX};
bool sanePartialProducts{false};
EnumerationParams()
{}
EnumerationParams() {}
EnumerationParams(const EnumerationParams &rhs)
: reagentMaxMatchCount(rhs.reagentMaxMatchCount),

View File

@@ -56,10 +56,10 @@ namespace RDKit {
class RDKIT_CHEMREACTIONS_EXPORT EnumerationStrategyException
: public std::exception {
public:
EnumerationStrategyException(const char *msg) : _msg(msg){};
EnumerationStrategyException(const std::string &msg) : _msg(msg){};
const char *what() const noexcept override { return _msg.c_str(); };
~EnumerationStrategyException() noexcept {};
EnumerationStrategyException(const char *msg) : _msg(msg) {}
EnumerationStrategyException(const std::string &msg) : _msg(msg) {}
const char *what() const noexcept override { return _msg.c_str(); }
~EnumerationStrategyException() noexcept {}
private:
std::string _msg;
@@ -124,12 +124,11 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerationStrategyBase {
m_permutationSizes; // m_permutationSizes num bbs per group
boost::uint64_t
m_numPermutations{}; // total number of permutations for this group
// -1 if > ssize_t::max
// -1 if > ssize_t::max
public:
static const boost::uint64_t EnumerationOverflow =
static_cast<boost::uint64_t>(-1);
EnumerationStrategyBase()
: m_permutation(), m_permutationSizes() {}
EnumerationStrategyBase() : m_permutation(), m_permutationSizes() {}
virtual ~EnumerationStrategyBase() {}
@@ -138,7 +137,8 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerationStrategyBase {
//! Initialize the enumerator based on the reaction and the
//! supplied building blocks
//! This is the standard API point.
//! This calls the derived class's initializeStrategy method which must be implemented
//! This calls the derived class's initializeStrategy method which must be
//! implemented
void initialize(const ChemicalReaction &reaction,
const EnumerationTypes::BBS &building_blocks) {
// default initialization, may be overridden (sets the # reactants
@@ -155,8 +155,10 @@ class RDKIT_CHEMREACTIONS_EXPORT EnumerationStrategyBase {
// ! Initialize derived class. Must exist.
// ! EnumerationStrategyBase structures are already initialized:
// ! m_permutationSizes - [ length of building blocks for each reactant set ]
// ! m_numPermutations - number of possible permutations ( -1 if not computable )
// ! m_permutation - the first permutation, always the first supplied reactants
// ! m_numPermutations - number of possible permutations
// ! ( -1 if not computable )
// ! m_permutation - the first permutation, always the first supplied
// ! reactants
virtual void initializeStrategy(
const ChemicalReaction &reaction,
const EnumerationTypes::BBS &building_blocks) = 0;

View File

@@ -62,7 +62,7 @@ class RDKIT_CHEMREACTIONS_EXPORT EvenSamplePairsStrategy
std::vector<std::vector<boost::uint64_t>> pair_counts;
std::set<boost::uint64_t> selected;
boost::uint64_t seed{}; // last seed for permutation (starts at 0)
boost::uint64_t seed{}; // last seed for permutation (starts at 0)
boost::uint64_t M{}, a{}, b{}; // random number stuff
boost::uint64_t nslack{}, min_nslack{};
boost::uint64_t rejected_period{}, rejected_unique{};
@@ -71,13 +71,12 @@ class RDKIT_CHEMREACTIONS_EXPORT EvenSamplePairsStrategy
public:
EvenSamplePairsStrategy()
: EnumerationStrategyBase(),
used_count(),
var_used(),
pair_used(),
pair_counts(),
selected()
{}
selected() {}
EvenSamplePairsStrategy(const EvenSamplePairsStrategy &rhs)
: EnumerationStrategyBase(rhs),

View File

@@ -71,7 +71,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
public:
RandomSampleStrategy()
: EnumerationStrategyBase(),
m_rng(),
m_distributions() {
for (size_t i = 0; i < m_permutation.size(); ++i) {
@@ -85,8 +85,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
const EnumerationTypes::BBS &) {
m_distributions.clear();
for (size_t i = 0; i < m_permutationSizes.size(); ++i) {
m_distributions.emplace_back(
0, m_permutationSizes[i] - 1);
m_distributions.emplace_back(0, m_permutationSizes[i] - 1);
}
m_numPermutationsProcessed = 0;
@@ -145,8 +144,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleStrategy
// reset the uniform distributions
m_distributions.clear();
for (size_t i = 0; i < m_permutationSizes.size(); ++i) {
m_distributions.emplace_back(
0, m_permutationSizes[i] - 1);
m_distributions.emplace_back(0, m_permutationSizes[i] - 1);
}
}

View File

@@ -77,7 +77,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
public:
RandomSampleAllBBsStrategy()
: EnumerationStrategyBase(),
m_rng(),
m_distributions() {
for (size_t i = 0; i < m_permutation.size(); ++i) {
@@ -94,8 +94,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
m_maxoffset =
*std::max_element(m_permutationSizes.begin(), m_permutationSizes.end());
for (size_t i = 0; i < m_permutationSizes.size(); ++i) {
m_distributions.emplace_back(
0, m_permutationSizes[i] - 1);
m_distributions.emplace_back(0, m_permutationSizes[i] - 1);
}
m_numPermutationsProcessed = 0;
@@ -166,8 +165,7 @@ class RDKIT_CHEMREACTIONS_EXPORT RandomSampleAllBBsStrategy
// reset the uniform distributions
m_distributions.clear();
for (size_t i = 0; i < m_permutationSizes.size(); ++i) {
m_distributions.emplace_back(
0, m_permutationSizes[i] - 1);
m_distributions.emplace_back(0, m_permutationSizes[i] - 1);
}
}

View File

@@ -47,12 +47,12 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReactionException
: public std::exception {
public:
//! construct with an error message
explicit ChemicalReactionException(const char *msg) : _msg(msg){};
explicit ChemicalReactionException(const char *msg) : _msg(msg) {}
//! construct with an error message
explicit ChemicalReactionException(const std::string msg) : _msg(msg){};
explicit ChemicalReactionException(const std::string msg) : _msg(msg) {}
//! get the error message
const char *what() const noexcept override { return _msg.c_str(); };
~ChemicalReactionException() noexcept {};
const char *what() const noexcept override { return _msg.c_str(); }
~ChemicalReactionException() noexcept {}
private:
std::string _msg;
@@ -120,7 +120,7 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReaction : public RDProps {
friend class ReactionPickler;
public:
ChemicalReaction() : RDProps(){};
ChemicalReaction() : RDProps() {}
ChemicalReaction(const ChemicalReaction &other) : RDProps() {
df_needsInit = other.df_needsInit;
df_implicitProperties = other.df_implicitProperties;
@@ -277,13 +277,13 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReaction : public RDProps {
}
unsigned int getNumReactantTemplates() const {
return rdcast<unsigned int>(this->m_reactantTemplates.size());
};
}
unsigned int getNumProductTemplates() const {
return rdcast<unsigned int>(this->m_productTemplates.size());
};
}
unsigned int getNumAgentTemplates() const {
return rdcast<unsigned int>(this->m_agentTemplates.size());
};
}
//! initializes our internal reactant-matching datastructures.
/*!
@@ -296,7 +296,7 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReaction : public RDProps {
*/
void initReactantMatchers(bool silent = false);
bool isInitialized() const { return !df_needsInit; };
bool isInitialized() const { return !df_needsInit; }
//! validates the reactants and products to make sure the reaction seems
//"reasonable"
@@ -335,10 +335,10 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReaction : public RDProps {
specified in the reaction.
*/
bool getImplicitPropertiesFlag() const { return df_implicitProperties; };
bool getImplicitPropertiesFlag() const { return df_implicitProperties; }
//! sets the implicit properties flag. See the documentation for
//! getImplicitProertiesFlag() for a discussion of what this means.
void setImplicitPropertiesFlag(bool val) { df_implicitProperties = val; };
void setImplicitPropertiesFlag(bool val) { df_implicitProperties = val; }
private:
bool df_needsInit{true};

View File

@@ -73,9 +73,7 @@ enum FingerprintType {
the difference fingerprint.
*/
struct RDKIT_CHEMREACTIONS_EXPORT ReactionFingerprintParams {
ReactionFingerprintParams()
{}
ReactionFingerprintParams() {}
ReactionFingerprintParams(bool includeAgents, double bitRatioAgents,
unsigned int nonAgentWeight, int agentWeight,

View File

@@ -50,13 +50,13 @@ class RDKIT_CHEMREACTIONS_EXPORT ChemicalReactionParserException
: public std::exception {
public:
//! construct with an error message
explicit ChemicalReactionParserException(const char *msg) : _msg(msg){};
explicit ChemicalReactionParserException(const char *msg) : _msg(msg) {}
//! construct with an error message
explicit ChemicalReactionParserException(const std::string &msg)
: _msg(msg){};
: _msg(msg) {}
//! get the error message
const char *what() const noexcept override { return _msg.c_str(); };
~ChemicalReactionParserException() noexcept {};
const char *what() const noexcept override { return _msg.c_str(); }
~ChemicalReactionParserException() noexcept {}
private:
std::string _msg;

View File

@@ -28,10 +28,10 @@ class ChemicalReaction;
class RDKIT_CHEMREACTIONS_EXPORT ReactionPicklerException
: public std::exception {
public:
ReactionPicklerException(const char *msg) : _msg(msg){};
ReactionPicklerException(const std::string msg) : _msg(msg){};
const char *what() const noexcept override { return _msg.c_str(); };
~ReactionPicklerException() noexcept {};
ReactionPicklerException(const char *msg) : _msg(msg) {}
ReactionPicklerException(const std::string msg) : _msg(msg) {}
const char *what() const noexcept override { return _msg.c_str(); }
~ReactionPicklerException() noexcept {}
private:
std::string _msg;
@@ -67,22 +67,22 @@ class RDKIT_CHEMREACTIONS_EXPORT ReactionPickler {
static void pickleReaction(const ChemicalReaction *rxn, std::ostream &ss);
static void pickleReaction(const ChemicalReaction &rxn, std::ostream &ss) {
ReactionPickler::pickleReaction(&rxn, ss);
};
}
static void pickleReaction(const ChemicalReaction &rxn, std::ostream &ss,
unsigned int propertyFlags) {
ReactionPickler::pickleReaction(&rxn, ss, propertyFlags);
};
}
//! pickles a reaction and adds the results to string \c res
static void pickleReaction(const ChemicalReaction *rxn, std::string &res,
unsigned int propertyFlags);
static void pickleReaction(const ChemicalReaction *rxn, std::string &res);
static void pickleReaction(const ChemicalReaction &rxn, std::string &res) {
ReactionPickler::pickleReaction(&rxn, res);
};
}
static void pickleReaction(const ChemicalReaction &rxn, std::string &res,
unsigned int propertyFlags) {
ReactionPickler::pickleReaction(&rxn, res, propertyFlags);
};
}
//! constructs a reaction from a pickle stored in a
//! string
@@ -91,14 +91,14 @@ class RDKIT_CHEMREACTIONS_EXPORT ReactionPickler {
static void reactionFromPickle(const std::string &pickle,
ChemicalReaction &rxn) {
ReactionPickler::reactionFromPickle(pickle, &rxn);
};
}
//! constructs a reaction from a pickle stored in a
//! stream
static void reactionFromPickle(std::istream &ss, ChemicalReaction *rxn);
static void reactionFromPickle(std::istream &ss, ChemicalReaction &rxn) {
ReactionPickler::reactionFromPickle(ss, &rxn);
};
}
private:
//! do the actual work of pickling a reaction

View File

@@ -43,10 +43,10 @@ namespace RDKit {
//! class for flagging sanitization errors
class RDKIT_CHEMREACTIONS_EXPORT RxnSanitizeException : public std::exception {
public:
RxnSanitizeException(const char *msg) : _msg(msg){};
RxnSanitizeException(const std::string &msg) : _msg(msg){};
const char *what() const noexcept override { return _msg.c_str(); };
~RxnSanitizeException() noexcept {};
RxnSanitizeException(const char *msg) : _msg(msg) {}
RxnSanitizeException(const std::string &msg) : _msg(msg) {}
const char *what() const noexcept override { return _msg.c_str(); }
~RxnSanitizeException() noexcept {}
private:
std::string _msg;

View File

@@ -101,25 +101,24 @@ RDKIT_CHEMTRANSFORMS_EXPORT void constructBRICSBondTypes(
std::vector<FragmenterBondType> &defs);
} // namespace MolFragmenter
enum class RDKIT_CHEMTRANSFORMS_EXPORT MolzipLabel {
AtomMapNumber,
Isotope,
FragmentOnBonds,
AtomType };
enum class RDKIT_CHEMTRANSFORMS_EXPORT MolzipLabel {
AtomMapNumber,
Isotope,
FragmentOnBonds,
AtomType
};
struct RDKIT_CHEMTRANSFORMS_EXPORT MolzipParams {
MolzipLabel label = MolzipLabel::AtomMapNumber;
std::vector<std::string> atomSymbols;
};
RDKIT_CHEMTRANSFORMS_EXPORT std::unique_ptr<ROMol> molzip(
RDKIT_CHEMTRANSFORMS_EXPORT std::unique_ptr<ROMol> molzip(
const ROMol &a, const ROMol &b,
const MolzipParams &params=MolzipParams());
RDKIT_CHEMTRANSFORMS_EXPORT std::unique_ptr<ROMol> molzip(const ROMol &a,
const MolzipParams &params=MolzipParams());
const MolzipParams &params = MolzipParams());
RDKIT_CHEMTRANSFORMS_EXPORT std::unique_ptr<ROMol> molzip(
const ROMol &a, const MolzipParams &params = MolzipParams());
} // namespace RDKit
#endif

View File

@@ -24,12 +24,12 @@ class ROMol;
class RDKIT_GRAPHMOL_EXPORT ConformerException : public std::exception {
public:
//! construct with an error message
ConformerException(const char *msg) : _msg(msg){};
ConformerException(const char *msg) : _msg(msg) {}
//! construct with an error message
ConformerException(const std::string &msg) : _msg(msg){};
ConformerException(const std::string &msg) : _msg(msg) {}
//! get the error message
const char *what() const noexcept override { return _msg.c_str(); };
~ConformerException() noexcept {};
const char *what() const noexcept override { return _msg.c_str(); }
~ConformerException() noexcept {}
private:
std::string _msg;
@@ -46,7 +46,7 @@ class RDKIT_GRAPHMOL_EXPORT Conformer : public RDProps {
friend class ROMol;
//! Constructor
Conformer() { d_positions.clear(); };
Conformer() { d_positions.clear(); }
//! Constructor with number of atoms specified ID specification
Conformer(unsigned int numAtoms) {
@@ -56,14 +56,14 @@ class RDKIT_GRAPHMOL_EXPORT Conformer : public RDProps {
d_positions.resize(0);
d_positions.clear();
}
};
}
//! Copy Constructor: initialize from a second conformation.
Conformer(const Conformer &other);
Conformer &operator=(const Conformer &other);
//! Destructor
~Conformer(){};
~Conformer() {}
//! Resize the conformer so that more atoms location can be added.
//! Useful, for e.g., when adding hydrogens
@@ -73,7 +73,7 @@ class RDKIT_GRAPHMOL_EXPORT Conformer : public RDProps {
void reserve(unsigned int size) { d_positions.reserve(size); }
//! returns whether or not this instance belongs to a molecule
bool hasOwningMol() const { return dp_mol != nullptr; };
bool hasOwningMol() const { return dp_mol != nullptr; }
//! Get the molecule that owns this instance
ROMol &getOwningMol() const {

View File

@@ -30,11 +30,7 @@ class RDKIT_DEPICTOR_EXPORT EmbeddedAtom {
public:
typedef enum { UNSPECIFIED = 0, CISTRANS, RING } EAtomType;
EmbeddedAtom()
{
neighs.clear();
}
EmbeddedAtom() { neighs.clear(); }
EmbeddedAtom(const EmbeddedAtom &other) = default;
@@ -161,7 +157,7 @@ class RDKIT_DEPICTOR_EXPORT EmbeddedFrag {
EmbeddedFrag() {
d_eatoms.clear();
d_attachPts.clear();
};
}
//! Initializer from a single atom id
/*!

View File

@@ -30,10 +30,10 @@ typedef boost::shared_array<double> DOUBLE_SMART_PTR;
class RDKIT_DEPICTOR_EXPORT DepictException : public std::exception {
public:
DepictException(const char *msg) : _msg(msg){};
DepictException(const std::string msg) : _msg(msg){};
const char *what() const noexcept override { return _msg.c_str(); };
~DepictException() noexcept {};
DepictException(const char *msg) : _msg(msg) {}
DepictException(const std::string msg) : _msg(msg) {}
const char *what() const noexcept override { return _msg.c_str(); }
~DepictException() noexcept {}
private:
std::string _msg;

Some files were not shown because too many files have changed in this diff Show More