Commit 46d130bc authored by Jens Wehner's avatar Jens Wehner

conversion errors

parent 116765e6
Pipeline #91800349 passed with stages
in 562 minutes and 29 seconds
......@@ -46,10 +46,10 @@ class BaseBead {
virtual ~BaseBead() = default;
/// Gets the id of the bead
long int getId() const { return id_.getId(); }
long getId() const { return id_.getId(); }
/// Sets the id of the bead
void setId(long int id) { id_.setId(id); }
void setId(long id) { id_.setId(id); }
/// Gets the name of the bead
std::string getName() const { return name_.getName(); }
......@@ -127,7 +127,7 @@ class BaseBead {
TopologyItem topology_item_;
MoleculeItem molecule_item_;
TOOLS::Identity<long int> id_;
TOOLS::Identity<long> id_;
TOOLS::Name name_;
TOOLS::Name type_;
......
......@@ -54,7 +54,7 @@ class Bead : public BaseBead {
* get the residu number of the bead
* \return residue id
*/
const long int &getResnr() const { return residue_number_; }
const long &getResnr() const { return residue_number_; }
/**
* get the charge of the bead
......@@ -257,7 +257,7 @@ class Bead : public BaseBead {
* If it is a mapped beads, returns te bead id the cg bead was created from
* \return vector of bead ids of reference atoms
*/
const std::vector<long int> &ParentBeads() { return parent_beads_; };
const std::vector<long> &ParentBeads() { return parent_beads_; };
/**
* \brief Clears out all parent beads
......@@ -267,17 +267,17 @@ class Bead : public BaseBead {
/**
* \brief Adds the id of a parent bead
**/
void AddParentBead(long int parent_bead_id) {
void AddParentBead(long parent_bead_id) {
parent_beads_.push_back(parent_bead_id);
}
protected:
std::vector<long int> parent_beads_;
std::vector<long> parent_beads_;
tools::byte_t symmetry_;
double charge_;
long int residue_number_;
long residue_number_;
Eigen::Vector3d velocity_, bead_force_, u_, v_, w_;
......@@ -288,8 +288,8 @@ class Bead : public BaseBead {
bool bead_force_set_;
/// constructor
Bead(Topology *owner, long int id, std::string type, tools::byte_t symmetry,
std::string name, long int resnr, double m, double q)
Bead(Topology *owner, long id, std::string type, tools::byte_t symmetry,
std::string name, long resnr, double m, double q)
: symmetry_(symmetry), charge_(q), residue_number_(resnr) {
topology_item_._parent = owner;
setId(id);
......
......@@ -38,14 +38,13 @@ class Bead;
class BeadList {
public:
/// \brief Select all beads of type <select>
long int Generate(Topology &top, const std::string &select);
long Generate(Topology &top, const std::string &select);
/// \brief Select all beads of type <select> withn a radius <radius> of
/// reference vector <ref>
long int GenerateInSphericalSubvolume(Topology &top,
const std::string &select,
Eigen::Vector3d ref, double radius);
long GenerateInSphericalSubvolume(Topology &top, const std::string &select,
Eigen::Vector3d ref, double radius);
long int size() const { return _beads.size(); }
long size() const { return _beads.size(); }
bool empty() const { return _beads.empty(); }
......
......@@ -154,14 +154,14 @@ class BeadMotif : public BeadStructure<BaseBead> {
*
* \param[in] - id of the first and second beads that are connected
**/
void ConnectBeads(long int bead1_id, long int bead2_id);
void ConnectBeads(long bead1_id, long bead2_id);
private:
MotifType type_ = MotifType::undefined;
bool junctionsUpToDate_ = false;
bool type_up_to_date_ = false;
std::vector<long int> junctions_;
std::vector<long> junctions_;
TOOLS::ReducedGraph reduced_graph_;
void InitializeGraph_();
......
......@@ -81,7 +81,7 @@ class BeadStructure {
/**
* \brief Get the bead with the specified id
**/
T *getBead(long int id);
T *getBead(long id);
/**
* \brief Create a connection between two beads in the structure
......@@ -89,7 +89,7 @@ class BeadStructure {
* A bead cannot be connected to itself. It also may not be connected to a
* bead that has not yet been added to the structure.
**/
void ConnectBeads(long int bead1_id, long int bead2_id);
void ConnectBeads(long bead1_id, long bead2_id);
/**
* \brief Return a vector of all the beads neighboring the index
......@@ -109,7 +109,7 @@ class BeadStructure {
**/
bool isStructureEquivalent(BeadStructure<T> &beadstructure);
bool BeadExist(long int bead_id) const { return beads_.count(bead_id); }
bool BeadExist(long bead_id) const { return beads_.count(bead_id); }
protected:
void InitializeGraph_();
......@@ -198,7 +198,7 @@ void BeadStructure<T>::AddBead(T *bead) {
}
template <class T>
void BeadStructure<T>::ConnectBeads(long int bead1_id, long int bead2_id) {
void BeadStructure<T>::ConnectBeads(long bead1_id, long bead2_id) {
if (!(beads_.count(bead1_id)) || !(beads_.count(bead2_id))) {
std::string err =
"Cannot connect beads in bead structure that do not exist";
......@@ -228,7 +228,7 @@ bool BeadStructure<T>::isSingleStructure() {
InitializeGraph_();
if (single_structureUpToDate_ == false) {
std::vector<long int> vertices = graph_.getVertices();
std::vector<long> vertices = graph_.getVertices();
if (vertices.size() == 0) {
single_structure_ = false;
return single_structure_;
......@@ -270,16 +270,16 @@ std::vector<T *> BeadStructure<T>::getNeighBeads(int index) {
if (!graphUpToDate) {
InitializeGraph_();
}
std::vector<long int> neighbor_ids = graph_.getNeighVertices(index);
std::vector<long> neighbor_ids = graph_.getNeighVertices(index);
std::vector<T *> neighbeads;
for (long int &node_id : neighbor_ids) {
for (long &node_id : neighbor_ids) {
neighbeads.push_back(beads_[node_id]);
}
return neighbeads;
}
template <class T>
T *BeadStructure<T>::getBead(long int index) {
T *BeadStructure<T>::getBead(long index) {
assert(beads_.count(index));
return beads_[index];
}
......
......@@ -54,44 +54,44 @@ class Interaction {
// the group id is set by topology, when interaction is added to it
// \todo if the group name is changed later, group id should be updated by
// topology
long int getGroupId() {
long getGroupId() {
assert(_group_id != -1);
return _group_id;
}
void setGroupId(long int id) { _group_id = id; }
void setGroupId(long id) { _group_id = id; }
void setIndex(const long int &index) {
void setIndex(const long &index) {
_index = index;
RebuildName();
}
const long int &getIndex() const {
const long &getIndex() const {
assert(_index != -1);
return _index;
}
void setMolecule(const long int &mol) {
void setMolecule(const long &mol) {
_mol = mol;
RebuildName();
}
const long int &getMolecule() const {
const long &getMolecule() const {
assert(_mol != -1);
return _mol;
}
virtual Eigen::Vector3d Grad(const Topology &top, long int bead) = 0;
long int BeadCount() { return _beads.size(); }
long int getBeadId(long int bead) {
virtual Eigen::Vector3d Grad(const Topology &top, long bead) = 0;
long BeadCount() { return _beads.size(); }
long getBeadId(long bead) {
assert(bead > -1 && boost::lexical_cast<size_t>(bead) < _beads.size());
return _beads[bead];
}
protected:
long int _index = -1;
long _index = -1;
std::string _group = "";
long int _group_id = -1;
long _group_id = -1;
std::string _name = "";
long int _mol = -1;
std::vector<long int> _beads;
long _mol = -1;
std::vector<long> _beads;
void RebuildName();
};
......@@ -122,22 +122,22 @@ inline void Interaction::RebuildName() {
*/
class IBond : public Interaction {
public:
IBond(long int bead1, long int bead2) {
IBond(long bead1, long bead2) {
_beads.resize(2);
_beads[0] = bead1;
_beads[1] = bead2;
}
IBond(std::list<long int> &beads) {
IBond(std::list<long> &beads) {
assert(beads.size() >= 2);
_beads.resize(2);
for (long int i = 0; i < 2; ++i) {
for (long i = 0; i < 2; ++i) {
_beads[i] = beads.front();
beads.pop_front();
}
}
double EvaluateVar(const Topology &top) override;
Eigen::Vector3d Grad(const Topology &top, long int bead) override;
Eigen::Vector3d Grad(const Topology &top, long bead) override;
private:
};
......@@ -147,23 +147,23 @@ class IBond : public Interaction {
*/
class IAngle : public Interaction {
public:
IAngle(long int bead1, long int bead2, long int bead3) {
IAngle(long bead1, long bead2, long bead3) {
_beads.resize(3);
_beads[0] = bead1;
_beads[1] = bead2;
_beads[2] = bead3;
}
IAngle(std::list<long int> &beads) {
IAngle(std::list<long> &beads) {
assert(beads.size() >= 3);
_beads.resize(3);
for (long int i = 0; i < 3; ++i) {
for (long i = 0; i < 3; ++i) {
_beads[i] = beads.front();
beads.pop_front();
}
}
double EvaluateVar(const Topology &top) override;
Eigen::Vector3d Grad(const Topology &top, long int bead) override;
Eigen::Vector3d Grad(const Topology &top, long bead) override;
private:
};
......@@ -173,24 +173,24 @@ class IAngle : public Interaction {
*/
class IDihedral : public Interaction {
public:
IDihedral(long int bead1, long int bead2, long int bead3, long int bead4) {
IDihedral(long bead1, long bead2, long bead3, long bead4) {
_beads.resize(4);
_beads[0] = bead1;
_beads[1] = bead2;
_beads[2] = bead3;
_beads[3] = bead4;
}
IDihedral(std::list<long int> &beads) {
IDihedral(std::list<long> &beads) {
assert(beads.size() >= 4);
_beads.resize(4);
for (long int i = 0; i < 4; ++i) {
for (long i = 0; i < 4; ++i) {
_beads[i] = beads.front();
beads.pop_front();
}
}
double EvaluateVar(const Topology &top) override;
Eigen::Vector3d Grad(const Topology &top, long int bead) override;
Eigen::Vector3d Grad(const Topology &top, long bead) override;
private:
};
......@@ -199,7 +199,7 @@ inline double IBond::EvaluateVar(const Topology &top) {
return top.getDist(_beads[0], _beads[1]).norm();
}
inline Eigen::Vector3d IBond::Grad(const Topology &top, long int bead) {
inline Eigen::Vector3d IBond::Grad(const Topology &top, long bead) {
Eigen::Vector3d r = top.getDist(_beads[0], _beads[1]);
r.normalize();
return (bead == 0) ? -r : r;
......@@ -211,7 +211,7 @@ inline double IAngle::EvaluateVar(const Topology &top) {
return std::acos(v1.dot(v2) / sqrt(v1.squaredNorm() * v2.squaredNorm()));
}
inline Eigen::Vector3d IAngle::Grad(const Topology &top, long int bead) {
inline Eigen::Vector3d IAngle::Grad(const Topology &top, long bead) {
Eigen::Vector3d v1(top.getDist(_beads[1], _beads[0]));
Eigen::Vector3d v2(top.getDist(_beads[1], _beads[2]));
......@@ -251,7 +251,7 @@ inline double IDihedral::EvaluateVar(const Topology &top) {
std::acos(n1.dot(n2) / sqrt(n1.squaredNorm() * n2.squaredNorm()));
}
inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long int bead) {
inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long bead) {
Eigen::Vector3d v1(top.getDist(_beads[0], _beads[1]));
Eigen::Vector3d v2(top.getDist(_beads[1], _beads[2]));
Eigen::Vector3d v3(top.getDist(_beads[2], _beads[3]));
......@@ -268,7 +268,7 @@ inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long int bead) {
(n1.squaredNorm() * n2.squaredNorm()))));
switch (bead) {
case (0): {
for (long int i = 0; i < 3; i++) {
for (long i = 0; i < 3; i++) {
returnvec[i] = n2.dot(v2.cross(e.col(i))) / (n1.norm() * n2.norm()) -
n1.dot(n2) * n1.dot(v2.cross(e.col(i))) /
(n2.norm() * std::pow(n1.norm(), 3));
......@@ -277,7 +277,7 @@ inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long int bead) {
break;
}
case (1): {
for (long int i = 0; i < 3; i++) {
for (long i = 0; i < 3; i++) {
returnvec[i] =
(n1.dot(v3.cross(e.col(i))) +
n2.dot(e.col(i).cross(v1) + e.col(i).cross(v2))) /
......@@ -291,7 +291,7 @@ inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long int bead) {
break;
};
case (2): {
for (long int i = 0; i < 3; i++) {
for (long i = 0; i < 3; i++) {
returnvec[i] =
(n1.dot(e.col(i).cross(v2) + e.col(i).cross(v3)) +
n2.dot(v1.cross(e.col(i)))) /
......@@ -305,7 +305,7 @@ inline Eigen::Vector3d IDihedral::Grad(const Topology &top, long int bead) {
break;
};
case (3): { //
for (long int i = 0; i < 3; i++) {
for (long i = 0; i < 3; i++) {
returnvec[i] = n1.dot(v2.cross(e.col(i))) / (n1.norm() * n2.norm()) -
n1.dot(n2) * n2.dot(v2.cross(e.col(i))) /
(n1.norm() * std::pow(n2.norm(), 3));
......
......@@ -42,7 +42,7 @@ class Interaction;
class Molecule : public TopologyItem {
public:
/// get the molecule ID
long int getId() const { return _id; }
long getId() const { return _id; }
/// get the name of the molecule
const std::string &getName() const { return _name; }
......@@ -53,17 +53,17 @@ class Molecule : public TopologyItem {
/// Add a bead to the molecule
void AddBead(Bead *bead, const std::string &name);
/// get the id of a bead in the molecule
Bead *getBead(long int bead) { return _beads[bead]; }
long int getBeadId(int bead) { return _beads[bead]->getId(); }
long int getBeadIdByName(const std::string &name);
Bead *getBead(long bead) { return _beads[bead]; }
long getBeadId(int bead) { return _beads[bead]->getId(); }
long getBeadIdByName(const std::string &name);
/// get the number of beads in the molecule
long int BeadCount() const { return _beads.size(); }
long BeadCount() const { return _beads.size(); }
const std::vector<Bead *> &Beads() const { return _beads; }
std::vector<Bead *> &Beads() { return _beads; }
/// find a bead by it's name
long int getBeadByName(const std::string &name);
long getBeadByName(const std::string &name);
std::string getBeadName(int bead) { return _bead_names[bead]; }
/// Add an interaction to the molecule
......@@ -83,11 +83,11 @@ class Molecule : public TopologyItem {
private:
// maps a name to a bead id
std::map<std::string, long int> _beadmap;
std::map<std::string, long> _beadmap;
std::vector<Interaction *> _interactions;
// id of the molecules
long int _id;
long _id;
// name of the molecule
std::string _name;
......@@ -98,14 +98,14 @@ class Molecule : public TopologyItem {
void *_userdata;
/// constructor
Molecule(Topology *parent, long int id, std::string name)
Molecule(Topology *parent, long id, std::string name)
: TopologyItem(parent), _id(id), _name(name) {}
friend class Topology;
};
inline long int Molecule::getBeadIdByName(const std::string &name) {
long int i = getBeadByName(name);
inline long Molecule::getBeadIdByName(const std::string &name) {
long i = getBeadByName(name);
if (i < 0) {
{
return i;
......
......@@ -46,7 +46,7 @@ class PairList {
pair_type *back() { return _pairs.back(); }
bool empty() const { return _pairs.empty(); }
int size() const { return _pairs.size(); }
long size() const { return long(_pairs.size()); }
void Cleanup();
......
......@@ -55,16 +55,16 @@ class PDBWriter : public TrajectoryWriter {
std::string getResname(Topology &conf, Bead *bead);
template <class Atom>
int getId(Atom &atom) {
long getId(Atom &atom) {
return atom.getId();
}
long int getId(Bead *bead) { return bead->getId(); }
long getId(Bead *bead) { return bead->getId(); }
template <class T, class Atom>
int getResId(T &container, Atom &) {
long getResId(T &container, Atom &) {
return container.getId();
}
long int getResId(Topology &, Bead *bead) { return bead->getResnr() + 1; }
long getResId(Topology &, Bead *bead) { return bead->getResnr() + 1; }
template <class Atom>
void writeSymmetry(Atom &) {
......
......@@ -38,9 +38,9 @@ class PotentialFunction {
// set all parameters
void setParam(const Eigen::VectorXd &param) { _lam = param; }
// set ith parameter
void setParam(long int i, double val) { _lam(i) = val; }
void setParam(long i, double val) { _lam(i) = val; }
// set ith parameter among those to be optimized
virtual void setOptParam(long int i, double val) { setParam(i, val); }
virtual void setOptParam(long i, double val) { setParam(i, val); }
// set minimum r value to avoid large values
void setMinDist(double min) { _min = min; }
// set cut-off value
......@@ -48,19 +48,19 @@ class PotentialFunction {
// calculate function
virtual double CalculateF(double r) const = 0;
// calculate first derivative w.r.t. ith parameter
virtual double CalculateDF(long int i, double r) const = 0;
virtual double CalculateDF(long i, double r) const = 0;
// calculate second derivative w.r.t. ith parameter
virtual double CalculateD2F(long int i, long int j, double r) const = 0;
virtual double CalculateD2F(long i, long j, double r) const = 0;
// return parameter
Eigen::VectorXd &Params() { return _lam; }
// return ith parameter
double getParam(long int i) const { return _lam(i); }
double getParam(long i) const { return _lam(i); }
// return ith parameter among those to be optimized
virtual double getOptParam(long int i) const { return getParam(i); }
virtual double getOptParam(long i) const { return getParam(i); }
// return size of parameters
long int getParamSize() const { return _lam.size(); }
long getParamSize() const { return _lam.size(); }
// return size of parameters to be optimized
virtual long int getOptParamSize() const { return getParamSize(); }
virtual long getOptParamSize() const { return getParamSize(); }
// return cut-off value
double getCutOff() const { return _cut_off; }
double getMinDist() const { return _min; }
......
......@@ -33,12 +33,12 @@ class PotentialFunctionCBSPL : public PotentialFunction {
// calculate function value for given r
double CalculateF(const double r) const override;
// calculate first derivative w.r.t. ith parameter
double CalculateDF(const long int i, const double r) const override;
double CalculateDF(const long i, const double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(const long int i, const long int j,
double CalculateD2F(const long i, const long j,
const double r) const override;
long int getOptParamSize() const override;
long getOptParamSize() const override;
void setParam(std::string filename) override;
......@@ -48,9 +48,9 @@ class PotentialFunctionCBSPL : public PotentialFunction {
void SavePotTab(const std::string &filename, const double step,
const double rmin, const double rcut) override;
void setOptParam(const long int i, const double val) override;
void setOptParam(const long i, const double val) override;
double getOptParam(const long int i) const override;
double getOptParam(const long i) const override;
void extrapolExclParam();
......@@ -58,12 +58,12 @@ class PotentialFunctionCBSPL : public PotentialFunction {
// exclude these many first coefficients from optimization
// since the region relevant to these coefficients is not sampled
// the value of _nexcl is determined from rmin
long int _nexcl;
long _nexcl;
// fix these many coeff near the cut-off to zero to ensure
// zero potential and force values near cut-off
int _ncutcoeff;
long int _nbreak;
long _nbreak;
double _dr;
Eigen::VectorXd _rbreak;
......
......@@ -34,9 +34,9 @@ class PotentialFunctionLJ126 : public PotentialFunction {
// calculate function value for given r
double CalculateF(double r) const override;
// calculate first derivative w.r.t. ith parameter
double CalculateDF(long int i, double r) const override;
double CalculateDF(long i, double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(long int i, long int j, double r) const override;
double CalculateD2F(long i, long j, double r) const override;
};
} // namespace csg
} // namespace votca
......
......@@ -31,9 +31,9 @@ class PotentialFunctionLJG : public PotentialFunction {
// calculate function value for given r
double CalculateF(double r) const override;
// calculate first derivative w.r.t. ith parameter
double CalculateDF(long int i, double r) const override;
double CalculateDF(long i, double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(long int i, long int j, double r) const override;
double CalculateD2F(long i, long j, double r) const override;
};
} // namespace csg
} // namespace votca
......
......@@ -38,15 +38,15 @@ class Residue : public TopologyItem {
const std::string &getName();
/// get the name of the residue
const long int &getId() const { return _id; }
const long &getId() const { return _id; }
private:
long int _id;
long _id;
std::string _name;
private:
/// constructor
Residue(Topology *parent, long int id, const std::string &name)
Residue(Topology *parent, long id, const std::string &name)
: TopologyItem(parent), _id(id), _name(name) {}
friend class Topology;
};
......
......@@ -77,8 +77,7 @@ class Topology {
* The function creates a new bead and adds it to the list of beads.
*/
virtual Bead *CreateBead(tools::byte_t symmetry, std::string name,
std::string type, long int resnr, double m,
double q);
std::string type, long resnr, double m, double q);
/**
* \brief Creates a new molecule
......@@ -100,7 +99,7 @@ class Topology {
* @return created residue
*/
virtual Residue *CreateResidue(std::string name);
virtual Residue *CreateResidue(std::string name, long int id);
virtual Residue *CreateResidue(std::string name, long id);
/**
* \brief Create molecules based on the residue.
......@@ -125,33 +124,33 @@ class Topology {
* \param[in] nbeads number of beads per molecule
* \param[in] nmolecules number of molecules
*/
void CreateMoleculesByRange(std::string name, long int first, long int nbeads,
long int nmolecules);
void CreateMoleculesByRange(std::string name, long first, long nbeads,
long nmolecules);
/**
* \brief number of molecules in the system
* @return number of molecule in topology
*/
long int MoleculeCount() const { return _molecules.size(); }
long MoleculeCount() const { return _molecules.size(); }
/**
* number of beads in the system
* @return number of beads in the system
*/
long int BeadCount() const { return _beads.size(); }
long BeadCount() const { return _beads.size(); }
/**
* number of residues in the system
* \return number of residues
*/
long int ResidueCount() const { return _residues.size(); }
long ResidueCount() const { return _residues.size(); }
/**
* get molecule by index
* @param index molecule number
* @return pointer to molecule
*/
Molecule *MoleculeByIndex(long int index);
Molecule *MoleculeByIndex(long index);
/**
* access containter with all beads
......@@ -203,7 +202,7 @@ class Topology {
* @param[in] string name of the type
* @return int the id of the type
**/
long int getBeadTypeId(std::string type) const;
long getBeadTypeId(std::string type) const;
/**
* \brief Returns a pointer to the bead with index i
......@@ -211,9 +210,9 @@ class Topology {
* @param[in] int i is the id of the bead
* @return Bead * is a pointer to the bead
**/
Bead *getBead(const long int i) const { return _beads[i]; }
Residue *getResidue(const long int i) const { return _residues[i]; }
Molecule *getMolecule(const long int i) const { return _molecules[i]; }
Bead *getBead(const long i) const { return _beads[i]; }
Residue *getResidue(const long i) const { return _residues[i]; }
Molecule *getMolecule(const long i) const { return _molecules[i]; }
/**
* delete all molecule information
......@@ -306,13 +305,13 @@ class Topology {
* set the step number of current frame
* \param s step number
*/
void setStep(long int s) { _step = s; };
void setStep(long s) { _step = s; };
/**