Commit 9128f81c authored by Vedran Miletić's avatar Vedran Miletić

Use standard C++ containers and remove RbtContainers.h

parent 37bca30f
......@@ -721,7 +721,7 @@ TEST_F(RbtChromTest, OccupancyThreshold) {
void RbtChromTest::measureRandOrMutateDiff(RbtChromElement *chrom, int nTrials,
bool bMutate, double &meanDiff,
double &minDiff, double &maxDiff) {
RbtDoubleList refVec;
std::vector<double> refVec;
chrom->GetVector(refVec);
meanDiff = 0.0;
minDiff = 0.0;
......@@ -751,7 +751,7 @@ void RbtChromTest::measureRandOrMutateDiff(RbtChromElement *chrom, int nTrials,
void RbtChromTest::measureCrossoverDiff(RbtChromElement *chrom, int nTrials,
double &meanDiff, double &minDiff,
double &maxDiff) {
RbtDoubleList refVec;
std::vector<double> refVec;
chrom->GetVector(refVec);
meanDiff = 0.0;
minDiff = 0.0;
......
......@@ -65,7 +65,7 @@ private:
/////////////////////
// Private data
/////////////////////
RbtIntList chrom;
std::vector<int> chrom;
RbtCellList cells;
int nProgramInputs, nFunctionsInputs, nProgramOutputs, nRows, nColumns;
};
......
......@@ -37,7 +37,7 @@ public:
private:
void CreateRandomCtes(int);
RbtDoubleList ctes;
std::vector<double> ctes;
RbtCellContextPtr contextp;
RbtGPFFCHK1(); // default constructor disabled
RbtReturnTypeArray inputTestTable, inputTrainingTable;
......
......@@ -34,7 +34,7 @@ public:
private:
void CreateRandomCtes(int);
RbtDoubleList ctes;
std::vector<double> ctes;
};
// Useful typedefs
......
......@@ -38,7 +38,7 @@ public:
private:
void CreateRandomCtes(int);
RbtDoubleList ctes;
std::vector<double> ctes;
RbtCellContextPtr contextp;
RbtGPFFHSP90(); // default constructor disabled
RbtReturnTypeArray inputTestTable, inputTrainingTable;
......
......@@ -39,7 +39,7 @@ public:
private:
void CreateRandomCtes(int);
RbtDoubleList ctes;
std::vector<double> ctes;
RbtCellContextPtr contextp;
RbtGPFFSpike(); // default constructor disabled
};
......
......@@ -17,7 +17,6 @@
#include "RbtCell.h"
#include "RbtCommand.h"
#include "RbtContainers.h"
#include "RbtGPChromosome.h"
#include "RbtGPTypes.h"
......
......@@ -14,7 +14,9 @@
#ifndef _RBT_H_
#define _RBT_H_
#include "RbtContainers.h"
#include <map>
#include <vector>
#include "RbtError.h"
#if defined _WIN32 || defined __CYGWIN__
......@@ -38,6 +40,15 @@
#endif
#endif
// Segment is a named part of an RbtModel (usually an intact molecule)
// For now, a segment is defined as just an RbtString
// RbtSegmentMap holds a map of (key=unique segment name, value=number of atoms
// in segment)
typedef std::string RbtSegment;
typedef std::map<RbtSegment, unsigned int> RbtSegmentMap;
typedef RbtSegmentMap::iterator RbtSegmentMapIter;
typedef RbtSegmentMap::const_iterator RbtSegmentMapConstIter;
namespace Rbt {
////////////////////////////////////////////////////////////////
// RESOURCE HANDLING FUNCTIONS
......@@ -91,9 +102,9 @@ std::string GetFileType(const std::string &strFile);
// Returns a list of files in a directory (strDir) whose names begin with
// strFilePrefix (optional) and whose type is strFileType (optional, as returned
// by GetFileType)
RbtStringList GetDirList(const std::string &strDir,
const std::string &strFilePrefix = "",
const std::string &strFileType = "");
std::vector<std::string> GetDirList(const std::string &strDir,
const std::string &strFilePrefix = "",
const std::string &strFileType = "");
//
////////////////////////////////////////////////////////////////
......@@ -116,11 +127,13 @@ RbtSegmentMap SegmentDiffMap(const RbtSegmentMap &map1,
// DM 30 Mar 1999
// Converts (comma)-delimited string to string list (similar to
// ConvertStringToSegmentMap, but returns list not map)
RBTDLL_EXPORT RbtStringList ConvertDelimitedStringToList(
const std::string &strValues, const std::string &strDelimiter = ",");
RBTDLL_EXPORT std::vector<std::string>
ConvertDelimitedStringToList(const std::string &strValues,
const std::string &strDelimiter = ",");
// Converts string list to (comma)-delimited string (inverse of above)
std::string ConvertListToDelimitedString(const RbtStringList &listOfValues,
const std::string &strDelimiter = ",");
std::string
ConvertListToDelimitedString(const std::vector<std::string> &listOfValues,
const std::string &strDelimiter = ",");
//
////////////////////////////////////////////////////////////////
......
......@@ -65,9 +65,9 @@ private:
// Private data
//////////////
RbtRand &m_rand; // keep a reference to the singleton random number generator
RbtCavityList m_cavities; // List of active site cavities to choose from
RbtIntList m_cumulSize; // Cumulative sizes, for weighted probabilities
int m_totalSize; // Total size of all cavities
RbtCavityList m_cavities; // List of active site cavities to choose from
std::vector<int> m_cumulSize; // Cumulative sizes, for weighted probabilities
int m_totalSize; // Total size of all cavities
};
// Useful typedefs
......
......@@ -35,7 +35,7 @@ public:
const RbtAnnotationList &GetAnnotationList() const;
int GetNumAnnotations() const;
void RenderAnnotationList(const std::string &strName,
RbtStringList &retVal) const;
std::vector<std::string> &retVal) const;
protected:
////////////////////////////////////////
......
......@@ -21,6 +21,8 @@
#include "RbtQuat.h"
#include "RbtTriposAtomType.h"
#include <list>
class RbtModel; // Forward declaration
class RbtBond; // Forward declaration
......@@ -1197,9 +1199,9 @@ RbtAtomList GetMatchingAtomList(const RbtAtomList &atomList,
// specifiers Returns total list (i.e. all matches OR'd). Does not remove
// duplicates.
unsigned int GetNumMatchingAtoms(const RbtAtomList &atomList,
const RbtStringList &fullNameList);
const std::vector<std::string> &fullNameList);
RbtAtomList GetMatchingAtomList(const RbtAtomList &atomList,
const RbtStringList &fullNameList);
const std::vector<std::string> &fullNameList);
/////////////////////////
// DM 07 Jan 1999
......
......@@ -90,7 +90,7 @@ private:
////////////////////////////////////////
// Private data
//////////////
RbtStringList m_lineRecs;
std::vector<std::string> m_lineRecs;
std::string m_strFileName;
std::ofstream m_fileOut;
bool m_bAppend; // If true, Write() appends to file rather than overwriting
......
......@@ -20,6 +20,8 @@
#include "RbtConfig.h"
#include "RbtCoord.h"
#include <set>
class RbtBaseGrid {
public:
// Class type string
......@@ -180,13 +182,13 @@ public:
return GetCoord(GetIX(iXYZ), GetIY(iXYZ), GetIZ(iXYZ));
}
// Returns list of real-world coordinates for given set of iXYZ indices
RbtCoordList GetCoordList(const RbtUIntSet &iXYZSet) const;
RbtCoordList GetCoordList(const std::set<unsigned int> &iXYZSet) const;
// DM 17 May 1999 - returns the set of valid grid points within a sphere of a
// given center and radius DM 17 Jul 2000 - use std::vector<RbtUInt> and
// return by reference, for performance boost
void GetSphereIndices(const RbtCoord &c, double radius,
RbtUIntList &sIndices) const;
std::vector<unsigned int> &sIndices) const;
protected:
////////////////////////////////////////
......
......@@ -55,7 +55,7 @@ public:
virtual int GetNumBonds() = 0;
virtual int GetNumSegments() = 0;
virtual RbtStringList GetTitleList() = 0;
virtual std::vector<std::string> GetTitleList() = 0;
virtual RbtAtomList GetAtomList() = 0;
virtual RbtBondList GetBondList() = 0;
virtual RbtSegmentMap GetSegmentMap() = 0;
......@@ -66,7 +66,7 @@ public:
// Get number of data fields
virtual int GetNumData() = 0;
// Get list of field names as string list
virtual RbtStringList GetDataFieldList() = 0;
virtual std::vector<std::string> GetDataFieldList() = 0;
// Get all data as map of key=field name, value=variant (double,string or
// string list)
virtual RbtStringVariantMap GetDataMap() = 0;
......
......@@ -42,7 +42,7 @@ public:
int GetNumBonds();
int GetNumSegments();
RbtStringList GetTitleList();
std::vector<std::string> GetTitleList();
RbtAtomList GetAtomList();
RbtBondList GetBondList();
RbtSegmentMap GetSegmentMap();
......@@ -51,7 +51,7 @@ public:
// Get number of data fields
virtual int GetNumData();
// Get list of field names as string list
virtual RbtStringList GetDataFieldList();
virtual std::vector<std::string> GetDataFieldList();
// Get all data as map of key=field name, value=variant (double,string or
// string list)
virtual RbtStringVariantMap GetDataMap();
......@@ -98,7 +98,7 @@ private:
protected:
// Protected data
RbtStringList m_titleList;
std::vector<std::string> m_titleList;
RbtAtomList m_atomList;
RbtBondList m_bondList;
RbtSegmentMap m_segmentMap;
......
......@@ -77,10 +77,10 @@ private:
////////////////////////////////////////
// Private data
//////////////
RbtIntStringMap m_atomTypes;
RbtStringIntMap m_implicitHydrogens;
RbtStringIntMap m_atomicNumber;
RbtStringIntMap m_formalCharge;
std::map<int, std::string> m_atomTypes;
std::map<std::string, int> m_implicitHydrogens;
std::map<std::string, int> m_atomicNumber;
std::map<std::string, int> m_formalCharge;
RbtStringHybridStateMap m_hybridState; // DM 8 Dec 1998
};
......
......@@ -41,12 +41,12 @@ public:
virtual RbtChromElement *clone() const;
virtual int GetLength() const;
virtual int GetXOverLength() const;
virtual void GetVector(RbtDoubleList &v) const;
virtual void GetVector(std::vector<double> &v) const;
virtual void GetVector(RbtXOverList &v) const;
virtual void SetVector(const RbtDoubleList &v, int &i);
virtual void SetVector(const std::vector<double> &v, int &i);
virtual void SetVector(const RbtXOverList &v, int &i);
virtual void GetStepVector(RbtDoubleList &v) const;
virtual double CompareVector(const RbtDoubleList &v, int &i) const;
virtual void GetStepVector(std::vector<double> &v) const;
virtual double CompareVector(const std::vector<double> &v, int &i) const;
virtual void Print(std::ostream &s) const;
// Aggregate methods
......
......@@ -46,12 +46,12 @@ public:
virtual RbtChromElement *clone() const;
virtual int GetLength() const { return 1; }
virtual int GetXOverLength() const { return 1; }
virtual void GetVector(RbtDoubleList &v) const;
virtual void GetVector(std::vector<double> &v) const;
virtual void GetVector(RbtXOverList &v) const;
virtual void SetVector(const RbtDoubleList &v, int &i);
virtual void SetVector(const std::vector<double> &v, int &i);
virtual void SetVector(const RbtXOverList &v, int &i);
virtual void GetStepVector(RbtDoubleList &v) const;
virtual double CompareVector(const RbtDoubleList &v, int &i) const;
virtual void GetStepVector(std::vector<double> &v) const;
virtual double CompareVector(const std::vector<double> &v, int &i) const;
virtual void Print(std::ostream &s) const;
// Returns a standardised dihedral angle in the range [-180, +180}
......
......@@ -21,7 +21,7 @@
// To prevent splitting (for example) an orientation or position vector in two
// during crossover, we convert the chromosome to a vector of vector of doubles
// An orientation vector (3 Euler angles) is a single RbtXOverElement
// GetVector(RbtDoubleList&) returns a flat vector of doubles (for use by
// GetVector(std::vector<double>&) returns a flat vector of doubles (for use by
// Simplex) GetVector(RbtXOverList&) returns a vector of RbtXOverElements (for
// use by crossover)
typedef std::vector<double> RbtXOverElement;
......@@ -80,7 +80,7 @@ public:
// Converts chromosome element to a vector of double values,
// Number of double values appended should match GetLength().
// v = vector of doubles to append to.
virtual void GetVector(RbtDoubleList &v) const = 0;
virtual void GetVector(std::vector<double> &v) const = 0;
// Converts chromosome element to a vector of XOverElements
// where each XOverElement is itself a vector of double values
// v = vector of RbtXOverElements to append to.
......@@ -89,7 +89,7 @@ public:
// Number of double values read should match GetLength().
// v = vector of doubles to extract from
// i = index of next vector element to read (should be updated by method)
virtual void SetVector(const RbtDoubleList &v, int &i) = 0;
virtual void SetVector(const std::vector<double> &v, int &i) = 0;
// Updates chromosome element from a vector of XOverElements,
// Number of XOverElements read should match GetXOverLength().
// v = vector of XOverElements to extract from
......@@ -97,14 +97,14 @@ public:
virtual void SetVector(const RbtXOverList &v, int &i) = 0;
// Gets the vector of absolute step sizes that correspond to each double
// value.
virtual void GetStepVector(RbtDoubleList &v) const = 0;
virtual void GetStepVector(std::vector<double> &v) const = 0;
// Gets the maximum relative difference between this element and another
// element as represented by the vector. Differences should be normalised by
// the step size. This method is provided to allow better comparisons between
// values that are difficult to compare by simple numerical differences. e.g.
// Dihedral angles are cyclical, therefore -180 and + 179 only differ by 1
// deg.
virtual double CompareVector(const RbtDoubleList &v, int &i) const = 0;
virtual double CompareVector(const std::vector<double> &v, int &i) const = 0;
//
// IMPLEMENTED VIRTUAL METHODS
//
......@@ -125,9 +125,9 @@ public:
// i.e. if Compare(c) < threshold
// Returns false if comparison is invalid (unequal lengths)
bool Equals(const RbtChromElement &c, double threshold) const;
// Convenience method that calls SetVector(const RbtDoubleList& v, RbtInt& i)
// with i initialised to zero
void SetVector(const RbtDoubleList &v);
// Convenience method that calls SetVector(const std::vector<double>& v,
// RbtInt& i) with i initialised to zero
void SetVector(const std::vector<double> &v);
// Convenience method that calls SetVector(const RbtXOverList& v, RbtInt& i)
// with i initialised to zero
void SetVector(const RbtXOverList &v);
......@@ -148,7 +148,7 @@ protected:
// Helper method to check that index i is in range [0,v.size()}
// and that v has sufficient elements remaining to satisfy
// GetLength()
bool VectorOK(const RbtDoubleList &v, unsigned int i) const;
bool VectorOK(const std::vector<double> &v, unsigned int i) const;
// Helper method to check that index i is in range [0,v.size()}
// and that v has sufficient elements remaining to satisfy
// GetXOverLength()
......
......@@ -35,12 +35,12 @@ public:
virtual RbtChromElement *clone() const;
virtual int GetLength() const { return 1; }
virtual int GetXOverLength() const { return 1; }
virtual void GetVector(RbtDoubleList &v) const;
virtual void GetVector(std::vector<double> &v) const;
virtual void GetVector(RbtXOverList &v) const;
virtual void SetVector(const RbtDoubleList &v, int &i);
virtual void SetVector(const std::vector<double> &v, int &i);
virtual void SetVector(const RbtXOverList &v, int &i);
virtual void GetStepVector(RbtDoubleList &v) const;
virtual double CompareVector(const RbtDoubleList &v, int &i) const;
virtual void GetStepVector(std::vector<double> &v) const;
virtual double CompareVector(const std::vector<double> &v, int &i) const;
virtual void Print(std::ostream &s) const;
// Returns a standardised occupancy value in the range [0,1]
......
......@@ -40,12 +40,12 @@ public:
virtual RbtChromElement *clone() const;
virtual int GetLength() const { return m_spRefData->GetLength(); }
virtual int GetXOverLength() const { return m_spRefData->GetXOverLength(); }
virtual void GetVector(RbtDoubleList &v) const;
virtual void GetVector(std::vector<double> &v) const;
virtual void GetVector(RbtXOverList &v) const;
virtual void SetVector(const RbtDoubleList &v, int &i);
virtual void SetVector(const std::vector<double> &v, int &i);
virtual void SetVector(const RbtXOverList &v, int &i);
virtual void GetStepVector(RbtDoubleList &v) const;
virtual double CompareVector(const RbtDoubleList &v, int &i) const;
virtual void GetStepVector(std::vector<double> &v) const;
virtual double CompareVector(const std::vector<double> &v, int &i) const;
virtual void Print(std::ostream &s) const;
// Returns a standardised rotation angle in the range [-M_PI, +M_PI}
......
......@@ -24,10 +24,6 @@
#include "RbtSmartPointer.h"
#endif //_RBTSMARTPOINTER_H_
#ifndef _RBTCONTAINERS_H_
#include "RbtContainers.h"
#endif //_RBTCONTAINERS_H_
#ifndef _RBTDEBUG_H_
#include "RbtDebug.h"
#endif //_RBTDEBUG_H_
......
/***********************************************************************
* The rDock program was developed from 1998 - 2006 by the software team
* at RiboTargets (subsequently Vernalis (R&D) Ltd).
* In 2006, the software was licensed to the University of York for
* maintenance and distribution.
* In 2012, Vernalis and the University of York agreed to release the
* program as Open Source software.
* This version is licensed under GNU-LGPL version 3.0 with support from
* the University of Barcelona.
* http://rdock.sourceforge.net/
***********************************************************************/
// Miscellaneous container typedefs etc for Rbt framework
#ifndef _RBTCONTAINERS_H_
#define _RBTCONTAINERS_H_
#include <list>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
// DM 9 Dec 1998 - add copy_if template to std namespace (not included in STL)
#if (defined(__clang__) && (__clang_major__ < 3 || \
(__clang_major__ == 3 && __clang_minor__ < 3))) || \
(!defined(__clang__) && defined(__GNUC__) && \
(__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)))
namespace std {
template <class InputIterator, class OutputIterator, class Predicate>
OutputIterator copy_if(InputIterator first, InputIterator last,
OutputIterator result, Predicate pred) {
for (; first != last; ++first)
if (pred(*first)) {
*result = *first;
++result;
}
return result;
}
} // namespace std
#endif //(defined(__clang__) ...) || (!defined(__clang__) && defined(__GNUC__)
//...)
// Container Typedefs
// double
typedef std::vector<double> RbtDoubleList;
typedef RbtDoubleList::iterator RbtDoubleListIter;
typedef RbtDoubleList::const_iterator RbtDoubleListConstIter;
// int
typedef std::vector<int> RbtIntList;
typedef RbtIntList::iterator RbtIntListIter;
typedef RbtIntList::const_iterator RbtIntListConstIter;
// uint
typedef std::vector<unsigned int> RbtUIntList;
typedef RbtUIntList::iterator RbtUIntListIter;
typedef RbtUIntList::const_iterator RbtUIntListConstIter;
// string
typedef std::vector<std::string> RbtStringList;
typedef RbtStringList::iterator RbtStringListIter;
typedef RbtStringList::const_iterator RbtStringListConstIter;
// bool
typedef std::vector<bool> RbtBoolVec; // vector of bools
typedef RbtBoolVec::iterator RbtBoolVecIter;
typedef RbtBoolVec::const_iterator RbtBoolVecConstIter;
// Segment is a named part of an RbtModel (usually an intact molecule)
// For now, a segment is defined as just an RbtString
// RbtSegmentMap holds a map of (key=unique segment name, value=number of atoms
// in segment)
typedef std::string RbtSegment;
typedef std::map<RbtSegment, unsigned int> RbtSegmentMap;
typedef RbtSegmentMap::iterator RbtSegmentMapIter;
typedef RbtSegmentMap::const_iterator RbtSegmentMapConstIter;
// Map of (key=string, value=integer)
typedef std::map<std::string, int> RbtStringIntMap;
typedef RbtStringIntMap::iterator RbtStringIntMapIter;
typedef RbtStringIntMap::const_iterator RbtStringIntMapConstIter;
// Map of (key=string, value=double)
typedef std::map<std::string, double> RbtStringDoubleMap;
typedef RbtStringDoubleMap::iterator RbtStringDoubleMapIter;
typedef RbtStringDoubleMap::const_iterator RbtStringDoubleMapConstIter;
// Added by DM, 3 Dec 1998
// Map of (key=string, value=bool)
typedef std::map<std::string, bool> RbtStringBoolMap;
typedef RbtStringBoolMap::iterator RbtStringBoolMapIter;
typedef RbtStringBoolMap::const_iterator RbtStringBoolMapConstIter;
// Map of (key=int, value=string)
typedef std::map<int, std::string> RbtIntStringMap;
typedef RbtIntStringMap::iterator RbtIntStringMapIter;
typedef RbtIntStringMap::const_iterator RbtIntStringMapConstIter;
// Set of (key=uint)
typedef std::set<unsigned int> RbtUIntSet;
typedef RbtUIntSet::iterator RbtUIntSetIter;
typedef RbtUIntSet::const_iterator RbtUIntSetConstIter;
#endif //_RBTCONTAINERS_H_
......@@ -452,7 +452,7 @@ inline RbtCoord Max(const RbtCoord &coord1, const RbtCoord &coord2) {
// DM 28 Jul 1999 - returns component-wise min coord for coord list (i.e.min x,
// min y, min z)
inline RbtCoord Min(const RbtCoordList &cl) {
RbtDoubleList cx, cy, cz;
std::vector<double> cx, cy, cz;
// Extract arrays of x,y,z components separately
std::transform(cl.begin(), cl.end(), std::back_inserter(cx), ExtractXCoord);
std::transform(cl.begin(), cl.end(), std::back_inserter(cy), ExtractYCoord);
......@@ -466,7 +466,7 @@ inline RbtCoord Min(const RbtCoordList &cl) {
// DM 28 Jul 1999 - returns component-wise max coord for coord list (i.e. max x,
// max y, max z)
inline RbtCoord Max(const RbtCoordList &cl) {
RbtDoubleList cx, cy, cz;
std::vector<double> cx, cy, cz;
// Extract arrays of x,y,z components separately
std::transform(cl.begin(), cl.end(), std::back_inserter(cx), ExtractXCoord);
std::transform(cl.begin(), cl.end(), std::back_inserter(cy), ExtractYCoord);
......
......@@ -105,10 +105,10 @@ private:
// offsets for any implicit hydrogens pAtom2 is the other central atom in the
// bond, is excluded from the returned list of bonded atoms
void CalcBondedAtoms(RbtAtom *pAtom1, RbtAtom *pAtom2,
RbtAtomList &bondedAtoms, RbtDoubleList &offsets);
RbtAtomList &bondedAtoms, std::vector<double> &offsets);
RbtParameterFileSourcePtr m_spDihedralSource;
RbtStringList m_centralPairs;
std::vector<std::string> m_centralPairs;
RbtTriposAtomType m_triposType;
};
......
......@@ -57,8 +57,8 @@ public:
RBTDLL_EXPORT std::string GetTitle();
std::string GetVersion();
unsigned int GetNumElements();
RbtStringList GetElementNameList(); // List of element names
RbtIntList GetAtomicNumberList(); // List of atomic numbers
std::vector<std::string> GetElementNameList(); // List of element names
std::vector<int> GetAtomicNumberList(); // List of atomic numbers
// Get element data for a given element name, throws error if not found
RbtElementData GetElementData(const std::string &strElementName);
// Get element data for a given atomic number, throws error if not found
......
......@@ -30,7 +30,7 @@ public:
// corresponding to displacement
double height; // Maximum value of peak
unsigned int volume; // Number of grid points in peak (=points.size())
RbtUIntSet points; // Set of iXYZ peak indices
std::set<unsigned int> points; // Set of iXYZ peak indices
};
typedef SmartPtr<RbtFFTPeak> RbtFFTPeakPtr; // Smart pointer
......
......@@ -144,9 +144,10 @@ public:
if (nullptr == pAtom)
return;
const RbtCoord &c = pAtom->GetCoords();
RbtUIntList sphereIndices;
std::vector<unsigned int> sphereIndices;
GetSphereIndices(c, radius, sphereIndices);
for (RbtUIntListConstIter sphereIter = sphereIndices.begin();
for (std::vector<unsigned int>::const_iterator sphereIter =
sphereIndices.begin();
sphereIter != sphereIndices.end(); sphereIter++) {
m_intnMap[*sphereIter].push_back(pIntn);
}
......
......@@ -88,7 +88,8 @@ private:
std::string GetMOL2Tag(const std::string &aLine);
// parse/tokenize second line (number of atoms, bonds etc) in MOLECULE
void ParseCountFields(const std::string &aLine);
void Tokenize(const std::string &aString, RbtStringList &aTokensBuf);
void Tokenize(const std::string &aString,
std::vector<std::string> &aTokensBuf);
unsigned int m_NL; // No. of lines
// data fields in MOLECULE
......
......@@ -60,7 +60,7 @@ public:
// Titles
int GetNumTitles() const { return m_titleList.size(); }
RbtStringList GetTitleList() const { return m_titleList; }
std::vector<std::string> GetTitleList() const { return m_titleList; }
// Atoms
int GetNumAtoms() const { return m_atomList.size(); }
......@@ -82,7 +82,7 @@ public:
// generated by rbdock etc) Get number of data fields
int GetNumData() const { return m_dataMap.size(); }
// Get list of field names as string list
RbtStringList GetDataFieldList() const;
std::vector<std::string> GetDataFieldList() const;
// Get all data as map of key=field name, value=variant (double,string or
// string list)
RbtStringVariantMap GetDataMap() const { return m_dataMap; }
......@@ -155,7 +155,7 @@ public:
// DM 8 Feb 1999
void SaveCoords(const std::string &coordName = "");
RBTDLL_EXPORT void RevertCoords(const std::string &coordName = "");
RbtStringIntMap GetSavedCoordNames() const { return m_coordNames; }
std::map<std::string, int> GetSavedCoordNames() const { return m_coordNames; }
int GetNumSavedCoords() const { return m_coordNames.size(); }
int GetCurrentCoords() const { return m_currentCoord; }
RBTDLL_EXPORT void RevertCoords(int);
......@@ -296,11 +296,11 @@ public:
bool bInit = true);
// Get map of (key=force field atom type string, value=no. of occurrences)
RbtStringIntMap GetAtomTypeMap();
std::map<std::string, int> GetAtomTypeMap();
// Get map of (key=force field bond type (atom type pair) string, value=no. of
// occurrences)
RbtStringIntMap GetBondTypeMap();
std::map<std::string, int> GetBondTypeMap();
protected:
//////////////////////
......@@ -321,15 +321,16 @@ private:
// Private data
//////////////////////
private:
std::string m_strName; // Model name
RbtStringList m_titleList; // Title list (read from file)
RbtAtomList m_atomList; // atom list
RbtBondList m_bondList; // bond list
std::string m_strName; // Model name
std::vector<std::string> m_titleList; // Title list (read from file)
RbtAtomList m_atomList; // atom list
RbtBondList m_bondList; // bond list
RbtSegmentMap m_segmentMap; // map of (key=segment name, value=atom count)
RbtAtomListList m_ringList; //(DM 7 Dec 1998) list of atom lists for each ring
RbtStringIntMap m_coordNames; //(DM 8 Feb 1999) map of named coord sets
//(key=name, value=index into RbtAtom coord map)
int m_currentCoord; // DM 11 Jul 2003 - which coord set is current
std::map<std::string, int>
m_coordNames; //(DM 8 Feb 1999) map of named coord sets
//(key=name, value=index into RbtAtom coord map)
int m_currentCoord; // DM 11 Jul 2003 - which coord set is current
RbtStringVariantMap m_dataMap; // DM 12 May 1999 - associated data (e.g. from
// SD file or generated by rbdock)
RbtPseudoAtomList
......
......@@ -42,7 +42,7 @@ public:
RbtNoeEndNames() {}
bool isOK() const;
// Public data
RbtStringList names;
std::vector<std::string> names;