Commit a3b1f33e authored by Luka Vretenar's avatar Luka Vretenar Committed by Vedran Miletić

Fixed all signed comparison warnings

parent cbc11633
......@@ -90,11 +90,11 @@ void RbtChromTest::setupWorkSpace() {
// RMSD calculation between two coordinate lists
double RbtChromTest::rmsd(const RbtCoordList &rc, const RbtCoordList &c) {
double retVal(0.0);
int nCoords = rc.size();
unsigned int nCoords = rc.size();
if (c.size() != nCoords) {
retVal = 999.9;
} else {
for (int i = 0; i < nCoords; i++) {
for (unsigned int i = 0; i < nCoords; i++) {
retVal += Rbt::Length2(rc[i], c[i]);
}
retVal = sqrt(retVal / float(nCoords));
......
......@@ -64,11 +64,11 @@ void SearchTest::tearDown() {
// RMSD calculation between two coordinate lists
double SearchTest::rmsd(const RbtCoordList &rc, const RbtCoordList &c) {
double retVal(0.0);
int nCoords = rc.size();
unsigned int nCoords = rc.size();
if (c.size() != nCoords) {
retVal = 999.9;
} else {
for (int i = 0; i < nCoords; i++) {
for (unsigned int i = 0; i < nCoords; i++) {
retVal += Rbt::Length2(rc[i], c[i]);
}
retVal = sqrt(retVal / float(nCoords));
......
......@@ -207,7 +207,7 @@ void NMSearch::ReplaceSimplexPoint(int index, const vector<double>& newPoint)
void NMSearch::CalculateFunctionValue(int index)
{
for (int i = 0 ; i < scratch->size() ; i++)
for (unsigned int i = 0 ; i < scratch->size() ; i++)
(*scratch)[i] = (*simplex).row(index)[i];
int success;
fcnCall(dimensions, scratch, simplexValues[index], success);
......@@ -378,7 +378,7 @@ void NMSearch::InitGeneralSimplex(const RbtMatrix *plex)
int success;
for( int i = 0; i <= dimensions; i++ ) {
for (int j = 0 ; j < scratch->size() ; j++)
for (unsigned int j = 0 ; j < scratch->size() ; j++)
(*scratch)[j] = (*plex).row(i)[j];
fcnCall(dimensions, scratch, simplexValues[i], success);
if(!success) std::cerr << "Error with point #"<<i<<" in initial simplex.\n";
......@@ -496,23 +496,23 @@ int NMSearch::SecondHighestPtIndex()
void NMSearch::FindCentroid()
{
for (int i = 0 ; i < centroid->size() ; i++)
for (unsigned int i = 0 ; i < centroid->size() ; i++)
(*centroid)[i] = 0.0;
for( int i = 0; i <= dimensions; i++ ) {
if( i != maxIndex ) {
for (int j = 0 ; j < centroid->size() ; j++)
for (unsigned int j = 0 ; j < centroid->size() ; j++)
(*centroid)[j] = (*centroid)[j] + (*simplex).row(i)[j];
} // if
} // for
for (int i = 0 ; i < centroid->size() ; i++)
for (unsigned int i = 0 ; i < centroid->size() ; i++)
(*centroid)[i] = (*centroid)[i] * ( 1.0 / (double)dimensions );
} // FindCentroid()
void NMSearch::FindReflectionPt()
{
for (int i = 0 ; i < reflectionPt->size() ; i++)
for (unsigned int i = 0 ; i < reflectionPt->size() ; i++)
(*reflectionPt)[i] = 0.0;
for (int i = 0 ; i < centroid->size() ; i++)
for (unsigned int i = 0 ; i < centroid->size() ; i++)
(*reflectionPt)[i] = ( (*centroid)[i] * (1.0 + alpha) ) -
( alpha * (*simplex).row(maxIndex)[i] );
int success;
......@@ -525,9 +525,9 @@ void NMSearch::FindReflectionPt()
void NMSearch::FindExpansionPt()
{
for (int i = 0 ; i < expansionPt->size() ; i++)
for (unsigned int i = 0 ; i < expansionPt->size() ; i++)
(*expansionPt)[i] = 0.0;
for (int i = 0 ; i < centroid->size() ; i++)
for (unsigned int i = 0 ; i < centroid->size() ; i++)
(*expansionPt)[i] = ( (*centroid)[i] * (1.0 - gamma) ) +
( gamma * (*reflectionPt)[i] );
int success;
......@@ -551,7 +551,7 @@ void NMSearch::FindContractionPt()
if(simplexValues[maxIndex] <= reflectionPtValue) {
tmpPt = new vector<double>(*scratch); //->size());
maxPrimePt = tmpPt;
for (int i = 0 ; i < scratch->size() ; i++)
for (unsigned int i = 0 ; i < scratch->size() ; i++)
(*maxPrimePt)[i] = (*simplex).row(maxIndex)[i];
maxPrimePtValue = simplexValues[maxIndex];
maxPrimePtId = 1;
......@@ -562,7 +562,7 @@ void NMSearch::FindContractionPt()
maxPrimePtId = 0;
} // else
for (int i = 0 ; i < centroid->size() ; i++)
for (unsigned int i = 0 ; i < centroid->size() ; i++)
(*contractionPt)[i] = ( (*centroid)[i] * (1.0 - beta) ) +
( beta * (*maxPrimePt)[i] );
......@@ -583,7 +583,7 @@ void NMSearch::ShrinkSimplex()
&& (functionCalls >= maxCalls) ) {return;}
vector<double> *lowestPt= scratch;
for (int i = 0 ; i < scratch->size() ; i++)
for (unsigned int i = 0 ; i < scratch->size() ; i++)
(*lowestPt)[i] = (*simplex).row(minIndex)[i];
vector<double> *tempPt = scratch2;
int success;
......
......@@ -821,27 +821,28 @@ class isCoordinationNumber_eq : public std::unary_function<RbtAtom *, bool> {
ATNO,
FFTYPE,
HYBRID
} eCNType; // Type of coordination number to check
int n; // Coordination number value to check
} eCNType; // Type of coordination number to check
unsigned int n; // Coordination number value to check
int atNo;
std::string ffType;
RbtAtom::eHybridState hybrid;
public:
// Total coordination number
explicit isCoordinationNumber_eq(int nn)
explicit isCoordinationNumber_eq(unsigned int nn)
: eCNType(TOTAL), n(nn), atNo(0), ffType(""), hybrid(RbtAtom::UNDEFINED) {
}
// Atomic number coordination number
explicit isCoordinationNumber_eq(int nn, int nAt)
explicit isCoordinationNumber_eq(unsigned int nn, int nAt)
: eCNType(ATNO), n(nn), atNo(nAt), ffType(""),
hybrid(RbtAtom::UNDEFINED) {}
// Force field type coordination number
explicit isCoordinationNumber_eq(int nn, const std::string &strType)
explicit isCoordinationNumber_eq(unsigned int nn, const std::string &strType)
: eCNType(FFTYPE), n(nn), atNo(0), ffType(strType),
hybrid(RbtAtom::UNDEFINED) {}
// Hybridisation state coordination number
explicit isCoordinationNumber_eq(int nn, RbtAtom::eHybridState eState)
explicit isCoordinationNumber_eq(unsigned int nn,
RbtAtom::eHybridState eState)
: eCNType(HYBRID), n(nn), atNo(0), ffType(""), hybrid(eState) {}
bool operator()(RbtAtom *pAtom) const {
switch (eCNType) {
......
......@@ -143,11 +143,11 @@ 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, int i) const;
bool VectorOK(const RbtDoubleList &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()
bool VectorOK(const RbtXOverList &v, int i) const;
bool VectorOK(const RbtXOverList &v, unsigned int i) const;
private:
RbtRand &m_rand; // Reference to singleton random number generator
......
......@@ -85,63 +85,63 @@ class RbtHeavyConstraint : public RbtConstraint {
public:
RbtHeavyConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtHBAConstraint : public RbtConstraint {
public:
RbtHBAConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtHBDConstraint : public RbtConstraint {
public:
RbtHBDConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtHydroConstraint : public RbtConstraint {
public:
RbtHydroConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtHydroAliphaticConstraint : public RbtConstraint {
public:
RbtHydroAliphaticConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtHydroAromaticConstraint : public RbtConstraint {
public:
RbtHydroAromaticConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtNegChargeConstraint : public RbtConstraint {
public:
RbtNegChargeConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtPosChargeConstraint : public RbtConstraint {
public:
RbtPosChargeConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
class RbtRingAromaticConstraint : public RbtConstraint {
public:
RbtRingAromaticConstraint(RbtCoord c, double t) : RbtConstraint(c, t) {}
void AddAtomList(RbtModelPtr, bool bCheck = true);
static int counter;
static unsigned int counter;
};
#endif //_RbtConstraint_H_
......@@ -47,7 +47,7 @@ public:
static std::string _CT;
// record delimiter strings
static std::string _TRIPOS_DELIM;
static int _TRIPOS_DELIM_SIZE;
static unsigned int _TRIPOS_DELIM_SIZE;
static std::string _IDS_MOL2_RECDELIM;
RbtMOL2FileSource(const std::string &fileName, bool bImplHydrogens = true);
......@@ -90,13 +90,13 @@ private:
void ParseCountFields(const std::string &aLine);
void Tokenize(const std::string &aString, RbtStringList &aTokensBuf);
int m_NL; // No. of lines
unsigned int m_NL; // No. of lines
// data fields in MOLECULE
int nAtoms; // number of atoms
int nBonds; // bonds
int nSubstructures; // substructures
int nFeatures; // features
int nSets; // sets
unsigned int nAtoms; // number of atoms
unsigned int nBonds; // bonds
unsigned int nSubstructures; // substructures
unsigned int nFeatures; // features
unsigned int nSets; // sets
// helper data structures used to lookup chain names for each substructure
// and to sort atom list into a more sensible order (ordered by substructure
......
......@@ -85,7 +85,7 @@ private:
RbtPopulation &operator=(const RbtPopulation &); // Disable
RbtGenomeList m_pop; // The population of genomes
int m_size; // The maximum size of the population
unsigned int m_size; // The maximum size of the population
double m_c; // Sigma Truncation Multiplier
RbtBaseSF *m_pSF; // The scoring function
RbtRand &m_rand; // reference to the singleton random number generator
......
......@@ -109,6 +109,7 @@ public:
// Conversion operators to convert back to basic types
operator int() const { return int(Double()); }
operator unsigned int() const { return (unsigned int)(Double()); }
operator double() const { return Double(); }
operator std::string() const { return String(); }
operator RbtStringList() const { return StringList(); }
......
......@@ -36,9 +36,9 @@ RbtGPChromosome::RbtGPChromosome(int npi, int nfi, int nn, int no, int nr,
RbtGPChromosome::RbtGPChromosome(const RbtGPChromosome &c) {
chrom = RbtIntList(c.chrom.size());
cells = RbtCellList(c.cells.size());
for (int i = 0; i < cells.size(); i++)
for (unsigned int i = 0; i < cells.size(); i++)
cells[i] = c.cells[i];
for (int i = 0; i < chrom.size(); i++)
for (unsigned int i = 0; i < chrom.size(); i++)
chrom[i] = c.chrom[i];
nProgramInputs = c.nProgramInputs;
nFunctionsInputs = c.nFunctionsInputs;
......@@ -51,14 +51,14 @@ RbtGPChromosome::RbtGPChromosome(const RbtGPChromosome &c) {
RbtGPChromosome::~RbtGPChromosome() {}
void RbtGPChromosome::Clear() {
for (int i = 0; i < cells.size(); i++)
for (unsigned int i = 0; i < cells.size(); i++)
cells[i]->Clear();
RbtCommand::Clear();
}
RbtGPChromosome &RbtGPChromosome::operator=(const RbtGPChromosome &c) {
for (int i = 0; i < cells.size(); i++)
for (unsigned int i = 0; i < cells.size(); i++)
*(cells[i]) = *(c.cells[i]);
for (int i = 0; i < chrom.size(); i++)
for (unsigned int i = 0; i < chrom.size(); i++)
chrom[i] = c.chrom[i];
nProgramInputs = c.nProgramInputs;
nFunctionsInputs = c.nFunctionsInputs;
......@@ -66,7 +66,7 @@ RbtGPChromosome &RbtGPChromosome::operator=(const RbtGPChromosome &c) {
}
std::istream &operator>>(std::istream &s, RbtGPChromosome &p) {
for (int i = 0; i < p.chrom.size(); i++)
for (unsigned int i = 0; i < p.chrom.size(); i++)
s >> p.chrom[i];
int cell;
RbtReturnType value;
......@@ -89,7 +89,7 @@ std::ostream &RbtGPChromosome::Print(std::ostream &s) const {
for (int i = 0; i < nProgramOutputs; i++)
s << chrom[g++] << " ";
s << std::endl;
for (int i = 0; i < cells.size(); i++)
for (unsigned int i = 0; i < cells.size(); i++)
if (cells[i]->Constant())
s << i << "\t" << cells[i]->GetResult() << std::endl;
return s;
......
......@@ -83,10 +83,10 @@ double RbtGPFFCHK1::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
RbtFilterExpressionPtr fe(parse.Parse(tokenIter, contextp));
double actualOutput, predictedOutput;
double hitlimit = 0.0;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
RbtReturnType pred;
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
actualOutput = *(SFValues[SFValues.size() - 1]);
......@@ -132,10 +132,10 @@ double RbtGPFFCHK1::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
RbtCellTokenIterPtr tokenIter(new RbtCellTokenIter(c, contextp));
RbtFilterExpressionPtr fe(parse.Parse(tokenIter, contextp));
double actualOutput, predictedOutput;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
RbtReturnType pred;
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
actualOutput = *(SFValues[SFValues.size() - 1]);
......
......@@ -83,7 +83,7 @@ double RbtGPFFCrossDock::CalculateFitness(RbtGPGenomePtr g,
RbtReturnTypeList inputs;
RbtReturnTypeList SFValues;
double hit;
int i = 0;
unsigned int i = 0;
while (i < it.size()) {
inputs = it[i];
SFValues = sft[i];
......@@ -144,7 +144,7 @@ double RbtGPFFCrossDock::CalculateFitness(RbtGPGenomePtr g,
RbtReturnTypeList inputs;
RbtReturnTypeList SFValues;
double hit;
int i = 0;
unsigned int i = 0;
while (i < it.size()) {
inputs = it[i];
SFValues = sft[i];
......
......@@ -60,7 +60,7 @@ double RbtGPFFGold::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
double good = 0.0;
double bad = 0.0;
double hitlimit = 2.0;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
RbtReturnTypeList SFValues = sft[i];
double scoreM = *(SFValues[0]);
......@@ -109,7 +109,7 @@ double RbtGPFFGold::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
double falsehits = 0.0;
double truemisses = 0.0;
double falsemisses = 0.0;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs = it[i];
RbtReturnTypeList SFValues = sft[i];
double scoreM = *(SFValues[0]);
......
......@@ -92,11 +92,11 @@ double RbtGPFFHSP90::CalculateFitness(
RbtCellTokenIterPtr ti(new RbtCellTokenIter(c, contextp));
RbtFilterExpressionPtr fe(p2.Parse(ti, contextp));
double meanReal = 0.0, meanPred = 0.0;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
RbtReturnTypeList pred;
pred.clear();
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
double hit = *(SFValues[SFValues.size() - 1]);
......@@ -148,11 +148,11 @@ double RbtGPFFHSP90::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
RbtCellTokenIterPtr ti(new RbtCellTokenIter(c, contextp));
RbtFilterExpressionPtr fe(p2.Parse(ti, contextp));
double meanReal = 0.0, meanPred = 0.0;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
RbtReturnTypeList pred;
pred.clear();
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
double hit = *(SFValues[SFValues.size() - 1]);
......@@ -169,7 +169,7 @@ double RbtGPFFHSP90::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
meanReal = meanReal / it.size();
meanPred = meanPred / it.size();
// std::cout << std::endl;
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
double t1 = *sft[i][0] - meanReal;
double t2 = *o[i][0] - meanPred;
sumDiff += t1 * t2;
......
......@@ -88,9 +88,9 @@ double RbtGPFFSpike::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
RbtCellTokenIterPtr ti(new RbtCellTokenIter(c, contextp));
RbtFilterExpressionPtr fe(p2.Parse(ti, contextp));
// RbtCellTokenIterPtr ti(new RbtCellTokenIter(c, contextp));
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs(it[i]);
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
double hit = *(SFValues[SFValues.size() - 1]);
......@@ -140,9 +140,9 @@ double RbtGPFFSpike::CalculateFitness(RbtGPGenomePtr g, RbtReturnTypeArray &it,
RbtParser p2;
RbtTokenIterPtr ti(new RbtCellTokenIter(c, contextp));
RbtFilterExpressionPtr fe(p2.Parse(ti, contextp));
for (int i = 0; i < it.size(); i++) {
for (unsigned int i = 0; i < it.size(); i++) {
RbtReturnTypeList inputs = it[i];
for (int j = 0; j < inputs.size(); j++)
for (unsigned int j = 0; j < inputs.size(); j++)
contextp->Assign(j, *(inputs[j]));
RbtReturnTypeList SFValues = sft[i];
double hit = *(SFValues[SFValues.size() - 1]);
......
......@@ -56,7 +56,7 @@ RbtGPPopulation::RbtGPPopulation(const RbtGPPopulation &p)
for (int i = 0; i < p.popsize; i++)
pop[i] = p.pop[i];
newpop = RbtGPGenomeList(p.newpop.size());
for (int i = 0; i < p.newpop.size(); i++)
for (unsigned int i = 0; i < p.newpop.size(); i++)
newpop[i] = p.newpop[i];
psum = new double[popsize];
_RBTOBJECTCOUNTER_COPYCONSTR_(_CT);
......@@ -146,7 +146,7 @@ void RbtGPPopulation::GAstep(std::string selector, double pcross, double pmut,
// calculate the objective values and
// sort newpop newpop = RbtGPGenomeList (p.newpop.size());
double bestFitness = -FLT_MAX, fit;
for (int i = 0; i < newpop.size(); i++) {
for (unsigned int i = 0; i < newpop.size(); i++) {
*(pop[i]) = *(newpop[i]);
fit = ff->CalculateFitness(pop[i], ittrain, sfttrain, function);
if (fit > bestFitness) {
......@@ -168,7 +168,7 @@ void RbtGPPopulation::EPstep(std::string selector, double pcross, double pmut,
// calculate the objective values and
// sort newpop newpop = RbtGPGenomeList (p.newpop.size());
double bestFitness = -FLT_MAX, fit;
for (int i = 0; i < newpop.size(); i++) {
for (unsigned int i = 0; i < newpop.size(); i++) {
*(pop[i]) = *(newpop[i]);
fit = ff->CalculateFitness(pop[i], ittrain, sfttrain, function);
if (fit >= bestFitness) {
......@@ -182,7 +182,7 @@ void RbtGPPopulation::EPstep(std::string selector, double pcross, double pmut,
RbtGPGenomePtr RbtGPPopulation::Best() const { return (pop[bestInd]); }
std::ostream &RbtGPPopulation::Print(std::ostream &s) const {
for (int i = 0; i < pop.size(); i++) {
for (unsigned int i = 0; i < pop.size(); i++) {
pop[i]->Print(s);
s << pop[i]->GetFitness() << std::endl;
}
......
......@@ -272,7 +272,7 @@ int main(int argc, char *argv[]) {
// Write an ASCII InsightII grid file for each defined cavity
if (bDump) {
RbtCavityList cavList = spDockSite->GetCavityList();
for (int i = 0; i < cavList.size(); i++) {
for (unsigned int i = 0; i < cavList.size(); i++) {
std::ostringstream filename;
filename << wsName << "_cav" << i + 1 << ".grd";
std::ofstream dumpFile(filename.str());
......
......@@ -144,12 +144,12 @@ void EnumerateSymCoords::Setup() {
// RMSD calculation between two coordinate lists
double rmsd(const RbtCoordList &rc, const RbtCoordList &c) {
int nCoords = rc.size();
unsigned int nCoords = rc.size();
if (c.size() != nCoords) {
return 0.0;
} else {
double rms(0.0);
for (int i = 0; i < nCoords; i++) {
for (unsigned int i = 0; i < nCoords; i++) {
rms += Rbt::Length2(rc[i], c[i]);
}
rms = std::sqrt(rms / float(nCoords));
......@@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
RbtCoordListList cll;
EnumerateSymCoords symEnumerator(spRefModel);
symEnumerator.GetSymCoords(cll);
int nCoords = cll.front().size();
unsigned int nCoords = cll.front().size();
std::cout << "molv_ rms rms rmc rmc"
<< std::endl; // Dummy header line to be like do_anal
......@@ -267,7 +267,8 @@ int main(int argc, char *argv[]) {
bool bIsUnique(true);
// Duplicate check
if (bRemoveDups) {
for (int i = 0; i < previousModels.size() && bIsUnique; i++) {
for (unsigned int i = 0; i < previousModels.size() && bIsUnique;
i++) {
RbtCoordList prevCoords;
Rbt::GetCoordList(
Rbt::GetAtomList(previousModels[i]->GetAtomList(),
......
......@@ -394,7 +394,7 @@ void RbtBaseMolecularFileSource::SetupPartialIonicGroups(
std::string mandatory =
spParamSource->GetParameterValueAsString(_MANDATORY);
RbtStringList mandAtoms = Rbt::ConvertDelimitedStringToList(mandatory);
int nPresent = Rbt::GetNumMatchingAtoms(atoms, mandAtoms);
unsigned int nPresent = Rbt::GetNumMatchingAtoms(atoms, mandAtoms);
if (nPresent != mandAtoms.size()) {
#ifdef _DEBUG
std::cout << "INFO SetupPartialIonicGroups: Only " << nPresent
......
......@@ -78,7 +78,7 @@ void RbtBiMolWorkSpace::UpdateModelCoordsFromChromRecords(
if (spModel.Ptr()) {
RbtChromElementPtr spChrom = spModel->GetChrom();
if (spChrom.Ptr()) {
int chromLength = spChrom->GetLength();
unsigned int chromLength = spChrom->GetLength();
if (chromLength > 0) {
std::ostringstream ostr;
ostr << "CHROM." << iModel;
......
......@@ -65,15 +65,15 @@ void RbtChromElement::Add(RbtChromElement *pChromElement) {
"Add(RbtChromElement*) invalid for non-aggregate chromosome element");
}
bool RbtChromElement::VectorOK(const RbtDoubleList &v, int i) const {
int length = GetLength();
bool RbtChromElement::VectorOK(const RbtDoubleList &v, unsigned int i) const {
unsigned int length = GetLength();
// if the element is empty then any vector is valid
return (length == 0) ||
((i >= 0) && (i < v.size()) && (length <= (v.size() - i)));
}
bool RbtChromElement::VectorOK(const RbtXOverList &v, int i) const {
int length = GetXOverLength();
bool RbtChromElement::VectorOK(const RbtXOverList &v, unsigned int i) const {
unsigned int length = GetXOverLength();
// if the element is empty then any vector is valid
return (length == 0) ||
((i >= 0) && (i < v.size()) && (length <= (v.size() - i)));
......
......@@ -16,15 +16,16 @@
// initialization of the static data of RbtConstraint
std::string RbtConstraint::_CT("RbtConstraint");
int RbtHeavyConstraint::counter = 0; // 7 Feb 2005 (DM) new constraint type
int RbtHBAConstraint::counter = 0;
int RbtHBDConstraint::counter = 0;
int RbtHydroConstraint::counter = 0;
int RbtHydroAliphaticConstraint::counter = 0;
int RbtHydroAromaticConstraint::counter = 0;
int RbtNegChargeConstraint::counter = 0;
int RbtPosChargeConstraint::counter = 0;
int RbtRingAromaticConstraint::counter = 0;
unsigned int RbtHeavyConstraint::counter =
0; // 7 Feb 2005 (DM) new constraint type
unsigned int RbtHBAConstraint::counter = 0;
unsigned int RbtHBDConstraint::counter = 0;
unsigned int RbtHydroConstraint::counter = 0;
unsigned int RbtHydroAliphaticConstraint::counter = 0;
unsigned int RbtHydroAromaticConstraint::counter = 0;
unsigned int RbtNegChargeConstraint::counter = 0;
unsigned int RbtPosChargeConstraint::counter = 0;
unsigned int RbtRingAromaticConstraint::counter = 0;
RbtConstraint::RbtConstraint(RbtCoord c, double t) {
m_atomList.clear();
......
......@@ -58,7 +58,7 @@ void RbtCrdFileSource::Parse() {
//////////////////////////////////////////////////////////
// 3a. Read number of atoms
int nAtomRec;
unsigned int nAtomRec;
fileIter++;
std::istringstream(*fileIter) >> nAtomRec;
......
......@@ -26,7 +26,7 @@ double RbtDihedral::operator()() const {
// std::cout.setf(std::ios_base::right,ios_base::adjustfield);
double dih = Rbt::BondDihedral(m_pAtom1, m_pAtom2, m_pAtom3, m_pAtom4);
double score(0.0);
for (int i = 0; i != m_prms.size(); ++i) {
for (unsigned int i = 0; i != m_prms.size(); ++i) {
// Subtract the implicit hydrogen offset from the actual dihedral angle
double dih1 = dih - m_prms[i].offset;
score +=
......@@ -99,7 +99,7 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
// Add all the ghost dihedral combinations for implicit Hs on pAtom2
// but only for the first time through the outer loop
if (iter1 == bondedAtoms2.begin()) {
for (int i1 = 0; i1 != offset2.size(); i1++) {
for (unsigned int i1 = 0; i1 != offset2.size(); i1++) {
dihprms = FindDihedralParams(RbtTriposAtomType::H, t2, t3, t4);
dihprms.offset = offset2[i1];
if (iTrace > 1) {
......@@ -114,7 +114,7 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
// pAtom2 AND on pAtom3 but only for the first time through the
// outer loop AND inner loop
if (iter4 == bondedAtoms3.begin()) {
for (int i4 = 0; i4 != offset3.size(); i4++) {
for (unsigned int i4 = 0; i4 != offset3.size(); i4++) {
dihprms = FindDihedralParams(RbtTriposAtomType::H, t2, t3,
RbtTriposAtomType::H);
// Combined offset should be offset2 - offset3
......@@ -139,7 +139,7 @@ RbtDihedralList RbtDihedralSF::CreateDihedralList(const RbtBondList &bondList) {
// Add all the ghost dihedral combinations for implicit Hs on pAtom3
// but only for the first time through the inner loop
if (iter4 == bondedAtoms3.begin()) {
for (int i4 = 0; i4 != offset3.size(); i4++) {
for (unsigned int i4 = 0; i4 != offset3.size(); i4++) {
dihprms = FindDihedralParams(t1, t2, t3, RbtTriposAtomType::H);
// Offset should be -offset3
// Remember offset3 was determined looking the other way along the
......
......@@ -80,7 +80,7 @@ std::ostream &operator<<(std::ostream &s, const RbtDockingSite &site) {
// Derived classes can override if required
void RbtDockingSite::Print(std::ostream &s) const {
s << "Total volume " << GetVolume() << " A^3" << std::endl;
for (int i = 0; i < m_cavityList.size(); i++) {
for (unsigned int i = 0; i < m_cavityList.size(); i++) {
s << "Cavity #" << i + 1 << "\t" << *(m_cavityList[i]) << std::endl;
}
}
......
......@@ -60,7 +60,7 @@ RbtCavityList RbtLigandSiteMapper::operator()() {
double step = GetParameter(_GRIDSTEP);
double radius = GetParameter(_RADIUS);
double minVol = GetParameter(_MIN_VOLUME);
int maxCavities = GetParameter(_MAX_CAVITIES);
unsigned int maxCavities = GetParameter(_MAX_CAVITIES);
int iTrace = GetTrace();
// Grid values
......
......@@ -22,7 +22,7 @@
std::string RbtMOL2FileSource::_CT("RbtMOL2FileSource");
// record delimiter strings
std::string RbtMOL2FileSource::_TRIPOS_DELIM("@<TRIPOS>");
int RbtMOL2FileSource::_TRIPOS_DELIM_SIZE(
unsigned int RbtMOL2FileSource::_TRIPOS_DELIM_SIZE(
RbtMOL2FileSource::_TRIPOS_DELIM.size());
std::string RbtMOL2FileSource::_IDS_MOL2_RECDELIM("@<TRIPOS>MOLECULE");
......@@ -328,9 +328,9 @@ void RbtMOL2FileSource::ParseRecordBOND(const std::string &aLine) {
"Corrupted MOL2 file: not enough fields in BOND");