Commit dbd789ff authored by Christoph Junghans's avatar Christoph Junghans

fixed for -Wconversion

parent cb8c4bf5
Pipeline #91049070 failed with stages
in 8 minutes and 4 seconds
......@@ -61,13 +61,13 @@ class PDBWriter : public TrajectoryWriter {
int getId(Atom &atom) {
return atom.getId();
}
int getId(Bead *bead) { return bead->getId(); }
long int getId(Bead *bead) { return bead->getId(); }
template <class T, class Atom>
int getResId(T &container, Atom &atom) {
return container.getId();
}
int getResId(Topology &conf, Bead *bead) { return bead->getResnr() + 1; }
long int getResId(Topology &conf, Bead *bead) { return bead->getResnr() + 1; }
template <class Atom>
void writeSymmetry(Atom &atom) {
......
......@@ -38,9 +38,9 @@ class PotentialFunction {
// set all parameters
void setParam(const Eigen::VectorXd &param) { _lam = param; }
// set ith parameter
void setParam(const int i, const double val) { _lam(i) = val; }
void setParam(const long int i, const double val) { _lam(i) = val; }
// set ith parameter among those to be optimized
virtual void setOptParam(const int i, const double val) { setParam(i, val); }
virtual void setOptParam(const long int i, const double val) { setParam(i, val); }
// set minimum r value to avoid large values
void setMinDist(const double min) { _min = min; }
// set cut-off value
......@@ -48,16 +48,16 @@ class PotentialFunction {
// calculate function
virtual double CalculateF(const double r) const = 0;
// calculate first derivative w.r.t. ith parameter
virtual double CalculateDF(const int i, const double r) const = 0;
virtual double CalculateDF(const long int i, const double r) const = 0;
// calculate second derivative w.r.t. ith parameter
virtual double CalculateD2F(const int i, const int j,
virtual double CalculateD2F(const long int i, const long int j,
const double r) const = 0;
// return parameter
Eigen::VectorXd &Params() { return _lam; }
// return ith parameter
double getParam(const int i) const { return _lam(i); }
double getParam(const long int i) const { return _lam(i); }
// return ith parameter among those to be optimized
virtual double getOptParam(const int i) const { return getParam(i); }
virtual double getOptParam(const long int i) const { return getParam(i); }
// return size of parameters
long int getParamSize() const { return _lam.size(); }
// return size of parameters to be optimized
......
......@@ -33,9 +33,9 @@ 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 int i, const double r) const override;
double CalculateDF(const long int i, const double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(const int i, const int j, const double r) const override;
double CalculateD2F(const long int i, const long int j, const double r) const override;
long int getOptParamSize() const override;
......@@ -47,9 +47,9 @@ class PotentialFunctionCBSPL : public PotentialFunction {
void SavePotTab(const std::string &filename, const double step,
const double rmin, const double rcut) override;
void setOptParam(const int i, const double val) override;
void setOptParam(const long int i, const double val) override;
double getOptParam(const int i) const override;
double getOptParam(const long int i) const override;
void extrapolExclParam();
......
......@@ -34,9 +34,9 @@ class PotentialFunctionLJ126 : 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 int i, const double r) const override;
double CalculateDF(const long int i, const double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(const int i, const int j, const double r) const override;
double CalculateD2F(const long int i, const long int j, const double r) const override;
};
} // namespace csg
} // namespace votca
......
......@@ -31,9 +31,9 @@ class PotentialFunctionLJG : 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 int i, const double r) const override;
double CalculateDF(const long int i, const double r) const override;
// calculate second derivative w.r.t. ith parameter
double CalculateD2F(const int i, const int j, const double r) const override;
double CalculateD2F(const long int i, const long int j, const double r) const override;
};
} // namespace csg
} // namespace votca
......
......@@ -66,7 +66,7 @@ class XYZReader : public TrajectoryReader, public TopologyReader {
return container.size();
}
int getContainerSize(Topology &container) { return container.BeadCount(); }
long int getContainerSize(Topology &container) { return container.BeadCount(); }
template <bool topology, class T>
void AddAtom(T &container, std::string name, int id,
......
......@@ -41,7 +41,7 @@ class XYZWriter : public TrajectoryWriter {
private:
template <class T>
int getSize(T &container) {
long int getSize(T &container) {
return getIterable(container).size();
}
......
......@@ -119,7 +119,7 @@ ExclusionList *CsgBoltzmann::CreateExclusionList(Molecule &atomistic,
const vector<long int> &parent_beads = cg.getBead(i)->ParentBeads();
list<Bead *> excl_list;
for (const int &parent_bead_id : parent_beads) {
for (const long int &parent_bead_id : parent_beads) {
excl_list.push_back(at_top->getBead(parent_bead_id));
}
ex->Remove(excl_list);
......
......@@ -309,7 +309,7 @@ void TabulatedPotential::CalcForce_(vector<double> &U, vector<double> &F,
void TabulatedPotential::Smooth_(vector<double> &data, bool bPeriodic) {
double old[3];
int n = data.size();
long int n = data.size();
if (bPeriodic) {
old[0] = data[n - 3];
old[1] = data[n - 2];
......
......@@ -61,7 +61,7 @@ string DLPOLYTopologyReader::_NextKeyline(ifstream &fs, const char *wspace)
}
string DLPOLYTopologyReader::_NextKeyInt(ifstream &fs, const char *wspace,
const string &word, int &ival)
const string &word, long int &ival)
// function to read the next line containing only a given keyword and an integer
// value after it (only skipping comments!) NOTE: this function must only be
// called when the next directive line has to contain the given keyword and an
......@@ -140,8 +140,8 @@ bool DLPOLYTopologyReader::_isKeyInt(const string &line, const char *wspace,
bool DLPOLYTopologyReader::ReadTopology(string file, Topology &top) {
const char *WhiteSpace = " \t";
int matoms = 0;
int natoms = 0;
long int matoms = 0;
long int natoms = 0;
std::ifstream fl;
boost::filesystem::path filepath(file.c_str());
......@@ -203,7 +203,7 @@ bool DLPOLYTopologyReader::ReadTopology(string file, Topology &top) {
mol_name = _NextKeyline(fl, WhiteSpace);
Molecule *mi = top.CreateMolecule(mol_name);
int nreplica = 1;
long int nreplica = 1;
line = _NextKeyInt(fl, WhiteSpace, "NUMMOL", nreplica);
#ifdef DEBUG
......@@ -219,7 +219,7 @@ bool DLPOLYTopologyReader::ReadTopology(string file, Topology &top) {
#endif
// read molecule
int *id_map = new int[natoms];
unique_ptr<long int[]> id_map = unique_ptr<long int[]>{new long int[natoms]};
for (int i = 0; i < natoms;) { // i is altered in repeater loop
stringstream sl(_NextKeyline(fl, WhiteSpace));
......@@ -353,7 +353,7 @@ bool DLPOLYTopologyReader::ReadTopology(string file, Topology &top) {
InteractionContainer ics = mi->Interactions();
for (auto &ic : ics) {
Interaction *ic_replica = nullptr;
int offset =
long int offset =
mi_replica->getBead(0)->getId() - mi->getBead(0)->getId();
if (ic->BeadCount() == 2) {
ic_replica =
......@@ -376,7 +376,6 @@ bool DLPOLYTopologyReader::ReadTopology(string file, Topology &top) {
mi_replica->AddInteraction(ic_replica);
}
}
delete[] id_map;
}
top.RebuildExclusions();
}
......
......@@ -56,7 +56,7 @@ class DLPOLYTopologyReader : public TopologyReader {
/// function to read the next line containing only a given keyword and an
/// integer value after it (only skipping comments!)
std::string _NextKeyInt(std::ifstream &fs, const char *wsp,
const std::string &word, int &ival);
const std::string &word, long int &ival);
/// function to check if the given (last read) directive line starts with a
/// given keyword and has an integer value at the end
bool _isKeyInt(const std::string &line, const char *wsp,
......
......@@ -66,7 +66,7 @@ bool GMXTopologyReader::ReadTopology(string file, Topology &top) {
string molname = *(mol->name);
int res_offset = top.ResidueCount();
long int res_offset = top.ResidueCount();
t_atoms *atoms = &(mol->atoms);
......
......@@ -32,14 +32,14 @@ void GMXTrajectoryWriter::Close() { close_trx(_file); }
void GMXTrajectoryWriter::Write(Topology *conf) {
static int step = 0;
int N = conf->BeadCount();
long int N = conf->BeadCount();
t_trxframe frame;
rvec *x = new rvec[N];
rvec *v = nullptr;
rvec *f = nullptr;
Eigen::Matrix3d box = conf->getBox();
frame.natoms = N;
frame.natoms = (int)N;
frame.bTime = true;
frame.time = conf->getTime();
frame.bStep = true;
......
......@@ -32,7 +32,8 @@ void GROWriter::Close() { fclose(_out); }
void GROWriter::Write(Topology *conf) {
char format[100];
int i, resnr, l, vpr;
int i, l, vpr;
long int resnr;
Topology *top = conf;
fprintf(_out, "%s\n", "what a nice title");
......@@ -61,7 +62,7 @@ void GROWriter::Write(Topology *conf) {
string resname = top->getResidue(resnr)->getName();
string atomname = top->getBead(i)->getName();
fprintf(_out, "%5d%-5.5s%5.5s%5d", (resnr + 1) % 100000, resname.c_str(),
fprintf(_out, "%5ld%-5.5s%5.5s%5d", (resnr + 1) % 100000, resname.c_str(),
atomname.c_str(), (i + 1) % 100000);
/* next fprintf uses built format string */
Eigen::Vector3d r = conf->getBead(i)->getPos();
......
......@@ -190,7 +190,7 @@ void H5MDTrajectoryReader::Initialize(Topology &top) {
hsize_t dims[3];
rank_ = H5Sget_simple_extent_dims(fs_atom_position_, dims, nullptr);
N_particles_ = dims[1];
vec_components_ = dims[2];
vec_components_ =(int) dims[2];
max_idx_frame_ = dims[0] - 1;
// TODO: reads mass, charge and particle type.
......@@ -268,7 +268,7 @@ bool H5MDTrajectoryReader::NextFrame(Topology &top) { // NOLINT const reference
// Process atoms.
for (int at_idx = 0; at_idx < N_particles_; at_idx++) {
double x, y, z;
int array_index = at_idx * vec_components_;
long int array_index = at_idx * vec_components_;
x = positions[array_index];
y = positions[array_index + 1];
z = positions[array_index + 2];
......
......@@ -170,10 +170,10 @@ class H5MDTrajectoryReader : public TrajectoryReader {
// Current frame indicator.
int idx_frame_;
int max_idx_frame_;
long int max_idx_frame_;
// Number of particles. This is static among time.
int N_particles_;
long int N_particles_;
//
int vec_components_;
......
......@@ -446,7 +446,7 @@ void LAMMPSDataReader::ReadAtoms_(Topology &top) {
} else {
mol = molecules_[moleculeId];
}
int symmetry = 1; // spherical
votca::tools::byte_t symmetry = 1; // spherical
double mass = stod(data_["Masses"].at(atomTypeId).at(1));
......
......@@ -56,9 +56,9 @@ void LAMMPSDumpWriter::Write(Topology *conf) {
iter != conf->Beads().end(); ++iter) {
Bead *bi = *iter;
int type_id = conf->getBeadTypeId(bi->getType());
long int type_id = conf->getBeadTypeId(bi->getType());
fprintf(_out, "%ld %i", bi->getId() + 1, type_id);
fprintf(_out, "%ld %li", bi->getId() + 1, type_id);
fprintf(_out, " %f %f %f", bi->getPos().x() * conv::nm2ang,
bi->getPos().y() * conv::nm2ang, bi->getPos().z() * conv::nm2ang);
if (v) {
......
......@@ -502,8 +502,8 @@ bool PDBReader::NextFrame(Topology &top) {
Molecule *mi = mol_map[mol_ind];
// Grab the id of the bead associated with the atom
// It may be the case that the atom id's and bead id's are different
int bead_id1 = bead_vec.at(atm_id1 - 1)->getId();
int bead_id2 = bead_vec.at(atm_id2 - 1)->getId();
long int bead_id1 = bead_vec.at(atm_id1 - 1)->getId();
long int bead_id2 = bead_vec.at(atm_id2 - 1)->getId();
Interaction *ic = new IBond(bead_id1, bead_id2);
ic->setGroup("BONDS");
ic->setIndex(bond_indx);
......
......@@ -187,7 +187,7 @@ void XMLTopologyReader::ParseMolecule(tools::Property &p, string molname,
"identical");
}
// Create molecule in topology. Replicate data.
int resnr = _top->ResidueCount();
long int resnr = _top->ResidueCount();
if (!xmlResidues.empty()) {
if (xmlResidues.front() != resnr + 1 && xmlResidues.front() != -1) {
throw std::runtime_error(
......
......@@ -53,7 +53,7 @@ class XMLBead {
: name(_name), type(_type), mass(_mass), q(_q){};
XMLBead() = default;
int pid;
long int pid;
std::string name;
std::string type;
double mass;
......@@ -65,7 +65,7 @@ class XMLMolecule {
XMLMolecule(std::string _name, int _nmols) : name(_name), nmols(_nmols) {}
std::string name;
int nmols;
int pid;
long int pid;
std::vector<XMLBead *> beads;
std::map<std::string, XMLBead *> name2beads;
Molecule *mi;
......
......@@ -198,12 +198,12 @@ void PotentialFunctionCBSPL::extrapolExclParam() {
}
}
void PotentialFunctionCBSPL::setOptParam(const int i, const double val) {
void PotentialFunctionCBSPL::setOptParam(const long int i, const double val) {
_lam(i + _nexcl) = val;
}
double PotentialFunctionCBSPL::getOptParam(const int i) const {
double PotentialFunctionCBSPL::getOptParam(const long int i) const {
return _lam(i + _nexcl);
}
......@@ -214,9 +214,7 @@ double PotentialFunctionCBSPL::CalculateF(const double r) const {
double u = 0.0;
long int indx = min((long int)(r / _dr), _nbreak - 2);
;
double rk = indx * _dr;
;
double rk = (double)indx * _dr;
double t = (r - rk) / _dr;
Eigen::VectorXd R = Eigen::VectorXd::Zero(4);
......@@ -234,7 +232,7 @@ double PotentialFunctionCBSPL::CalculateF(const double r) const {
}
// calculate first derivative w.r.t. ith parameter
double PotentialFunctionCBSPL::CalculateDF(const int i, const double r) const {
double PotentialFunctionCBSPL::CalculateDF(const long int i, const double r) const {
// since first _nexcl parameters are not optimized for stability reasons
......@@ -245,7 +243,7 @@ double PotentialFunctionCBSPL::CalculateDF(const int i, const double r) const {
double rk;
indx = min((long int)(r / _dr), _nbreak - 2);
rk = indx * _dr;
rk = (double)indx * _dr;
if (i_opt >= indx && i_opt <= indx + 3) {
......@@ -272,7 +270,7 @@ double PotentialFunctionCBSPL::CalculateDF(const int i, const double r) const {
}
// calculate second derivative w.r.t. ith parameter
double PotentialFunctionCBSPL::CalculateD2F(const int i, const int j,
double PotentialFunctionCBSPL::CalculateD2F(const long int i, const long int j,
const double r) const {
return 0.0;
......
......@@ -36,7 +36,7 @@ double PotentialFunctionLJ126::CalculateF(const double r) const {
}
// calculate first derivative w.r.t. ith parameter
double PotentialFunctionLJ126::CalculateDF(const int i, const double r) const {
double PotentialFunctionLJ126::CalculateDF(const long int i, const double r) const {
if (r >= _min && r <= _cut_off) {
......@@ -51,7 +51,7 @@ double PotentialFunctionLJ126::CalculateDF(const int i, const double r) const {
}
// calculate second derivative w.r.t. ith and jth parameters
double PotentialFunctionLJ126::CalculateD2F(const int i, const int j,
double PotentialFunctionLJ126::CalculateD2F(const long int i, const long int j,
const double r) const {
return 0.0;
......
......@@ -38,7 +38,7 @@ double PotentialFunctionLJG::CalculateF(const double r) const {
}
// calculate first derivative w.r.t. ith parameter
double PotentialFunctionLJG::CalculateDF(const int i, const double r) const {
double PotentialFunctionLJG::CalculateDF(const long int i, const double r) const {
if (r >= _min && r <= _cut_off) {
......@@ -61,7 +61,7 @@ double PotentialFunctionLJG::CalculateDF(const int i, const double r) const {
}
// calculate second derivative w.r.t. ith parameter
double PotentialFunctionLJG::CalculateD2F(const int i, const int j,
double PotentialFunctionLJG::CalculateD2F(const long int i, const long int j,
const double r) const {
if (r >= _min && r <= _cut_off) {
......
......@@ -155,7 +155,7 @@ void Topology::Add(Topology *top) {
ResidueContainer::iterator res;
MoleculeContainer::iterator mol;
int res0 = ResidueCount();
long int res0 = ResidueCount();
for (bead = top->_beads.begin(); bead != top->_beads.end(); ++bead) {
Bead *bi = *bead;
......@@ -208,7 +208,7 @@ void Topology::CopyTopologyData(Topology *top) {
++it_mol) {
Molecule *mi = CreateMolecule((*it_mol)->getName());
for (int i = 0; i < (*it_mol)->BeadCount(); i++) {
int beadid = (*it_mol)->getBead(i)->getId();
long int beadid = (*it_mol)->getBead(i)->getId();
mi->AddBead(_beads[beadid], (*it_mol)->getBeadName(i));
}
}
......@@ -251,10 +251,10 @@ void Topology::SetBeadTypeMass(string name, double value) {
}
void Topology::CheckMoleculeNaming(void) {
map<string, int> nbeads;
map<string, long int> nbeads;
for (Molecule *mol : _molecules) {
map<string, int>::iterator entry = nbeads.find(mol->getName());
map<string, long int>::iterator entry = nbeads.find(mol->getName());
if (entry != nbeads.end()) {
if (entry->second != mol->BeadCount()) {
throw runtime_error(
......@@ -275,7 +275,7 @@ void Topology::AddBondedInteraction(Interaction *ic) {
if (iter != _interaction_groups.end()) {
ic->setGroupId((*iter).second);
} else {
int i = _interaction_groups.size();
long int i = _interaction_groups.size();
_interaction_groups[ic->getGroup()] = i;
ic->setGroupId(i);
}
......
......@@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(test_bead_constructor) {
Topology top;
string bead_type_name = "C1";
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy";
int resnr = 0;
double mass = 1.21;
......@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(test_bead_getters) {
string bead_type_name = "C1";
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy";
int resnr = 0;
double mass = 1.21;
......@@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(test_bead_setters) {
string bead_type_name = "C1";
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy";
int resnr = 0;
double mass = 1.21;
......
......@@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE(test_beadtriple_constructor) {
string bead_type_name = "CG";
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy1";
int resnr = 0;
double mass = 1.0;
......
......@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(test_nblist_3body_generate_list) {
string bead_type_name = "CG";
top.RegisterBeadType(bead_type_name);
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy1";
int resnr = 0;
double mass = 1.0;
......
......@@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(test_nblist_3body_generate_list) {
string bead_type_name = "CG";
top.RegisterBeadType(bead_type_name);
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy1";
int resnr = 0;
double mass = 1.0;
......
......@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(triplelist_add_triple) {
string bead_type_name = "CG";
top.RegisterBeadType(bead_type_name);
int symmetry = 1;
votca::tools::byte_t symmetry = 1;
string name = "dummy1";
int resnr = 0;
double mass = 1.0;
......
......@@ -142,8 +142,8 @@ void CsgDensityApp::EvalConfiguration(Topology *top, Topology *top_ref) {
if (!votca::tools::wildcmp(_molname.c_str(), mol->getName().c_str())) {
continue;
}
int N = mol->BeadCount();
for (int i = 0; i < N; i++) {
long int N = mol->BeadCount();
for (long int i = 0; i < N; i++) {
Bead *b = mol->getBead(i);
if (!votca::tools::wildcmp(_filter.c_str(), b->getName().c_str())) {
continue;
......
......@@ -248,7 +248,7 @@ void DLPTopolApp::WriteMoleculeInteractions(ostream &out, Molecule &cg) {
stringstream sout;
int n_entries = 0;
int nb = -1;
long int nb = -1;
for (iter = ics.begin(); iter != ics.end(); ++iter) {
Interaction *ic = *iter;
......
......@@ -81,7 +81,7 @@ bool CsgDumpApp::EvaluateTopology(Topology *top, Topology *top_ref) {
cout << "molecule: " << (*mol)->getId() + 1 << " " << (*mol)->getName()
<< " beads: " << (*mol)->BeadCount() << endl;
for (int i = 0; i < (*mol)->BeadCount(); ++i) {
int resnr = (*mol)->getBead(i)->getResnr();
long int resnr = (*mol)->getBead(i)->getResnr();
cout << (*mol)->getBeadId(i) << " Name " << (*mol)->getBeadName(i)
<< " Type " << (*mol)->getBead(i)->getType() << " Mass "
......
......@@ -164,7 +164,7 @@ void CGForceMatching::BeginEvaluate(Topology *top, Topology *top_atom) {
}
}
CGForceMatching::SplineInfo::SplineInfo(int index, bool bonded_, int matr_pos_,
CGForceMatching::SplineInfo::SplineInfo(long int index, bool bonded_, long int matr_pos_,
votca::tools::Property *options) {
// initialize standard data
splineIndex = index;
......@@ -472,7 +472,7 @@ void CGForceMatching::FmatchAccumulateData() {
// FM residual is initially calculated in (kJ/(mol*nm))^2
double fm_resid = residual.cwiseAbs2().sum();
fm_resid /= 3 * _nbeads * _frame_counter;
fm_resid /= (double)(3 * _nbeads * _frame_counter);
cout << endl;
cout << "#### Force matching residual ####" << endl;
......@@ -482,8 +482,8 @@ void CGForceMatching::FmatchAccumulateData() {
}
for (SplineInfo *sinfo : _splines) {
int mp = sinfo->matr_pos;
int ngp = sinfo->num_gridpoints;
long int mp = sinfo->matr_pos;
long int ngp = sinfo->num_gridpoints;
// _x contains results for all splines. Here we cut the results for one
// spline
......@@ -535,8 +535,8 @@ void CGForceMatching::FmatchAssignSmoothCondsToMatrix(Eigen::MatrixXd &Matrix) {
// For constrained least squares - for Eigen::Matrix3d _B_constr
Matrix.setZero();
int line_tmp = 0;
int col_tmp = 0;
long int line_tmp = 0;
long int col_tmp = 0;
for (SplineInfo *sinfo : _splines) {
......@@ -549,7 +549,7 @@ void CGForceMatching::FmatchAssignSmoothCondsToMatrix(Eigen::MatrixXd &Matrix) {
line_tmp += 1;
}
// update counters
int sfnum = sinfo->num_splinefun;
long int sfnum = sinfo->num_splinefun;
line_tmp += sfnum + 1;
col_tmp += 2 * (sfnum + 1);
}
......@@ -568,18 +568,18 @@ void CGForceMatching::EvalBonded(Topology *conf, SplineInfo *sinfo) {
for (Interaction *inter : interList) {
int beads_in_int = inter->BeadCount(); // 2 for bonds, 3 for angles, 4 for
long int beads_in_int = inter->BeadCount(); // 2 for bonds, 3 for angles, 4 for
// dihedrals
votca::tools::CubicSpline &SP = sinfo->Spline;
int mpos = sinfo->matr_pos;
long int mpos = sinfo->matr_pos;
double var = inter->EvaluateVar(*conf); // value of bond, angle,
// or dihedral
for (int loop = 0; loop < beads_in_int; loop++) {
int ii = inter->getBeadId(loop);
long int ii = inter->getBeadId(loop);
Eigen::Vector3d gradient = inter->Grad(*conf, loop);
SP.AddToFitMatrix(_A, var,
......@@ -638,15 +638,15 @@ void CGForceMatching::EvalNonbonded(Topology *conf, SplineInfo *sinfo) {
}
for (BeadPair *pair : *nb) {
int iatom = pair->first()->getId();
int jatom = pair->second()->getId();
long int iatom = pair->first()->getId();
long int jatom = pair->second()->getId();
double var = pair->dist();
Eigen::Vector3d gradient = pair->r();
gradient.normalize();
votca::tools::CubicSpline &SP = sinfo->Spline;
int mpos = sinfo->matr_pos;
long int mpos = sinfo->matr_pos;
// add iatom
SP.AddToFitMatrix(_A, var,
......@@ -744,9 +744,9 @@ void CGForceMatching::EvalNonbonded_Threebody(Topology *conf,
}
for (BeadTriple *triple : *nb) {
int iatom = triple->bead1()->getId();
int jatom = triple->bead2()->getId();
int katom = triple->bead3()->getId();
long int iatom = triple->bead1()->getId();
long int jatom = triple->bead2()->getId();
long int katom = triple->bead3()->getId();
double distij = triple->dist12();
double distik = triple->dist13();
Eigen::Vector3d rij = triple->r12();
......@@ -760,7 +760,7 @@ void CGForceMatching::EvalNonbonded_Threebody(Topology *conf,
votca::tools::CubicSpline &SP = sinfo->Spline;
int mpos = sinfo->matr_pos;
long int mpos = sinfo->matr_pos;
double var =
std::acos(rij.dot(rik) / sqrt(rij.squaredNorm() * rik.squaredNorm()));
......
......@@ -65,16 +65,16 @@ class CGForceMatching : public CsgApplication {
/// parameters
struct SplineInfo {
/// \brief constructor
SplineInfo(int index, bool bonded_, int matr_pos_,
SplineInfo(long int index, bool bonded_, long int matr_pos_,