diff --git a/src/tools/csg_fmatch.cc b/src/tools/csg_fmatch.cc index 30be8efb11a97271618e4eefc6069f96f296d40e..d2344c56562d866e40333705b55ed2bd0d92b300 100644 --- a/src/tools/csg_fmatch.cc +++ b/src/tools/csg_fmatch.cc @@ -463,14 +463,14 @@ void CGForceMatching::EvalConfiguration(Topology *conf, Topology *) { void CGForceMatching::FmatchAccumulateData() { if (_constr_least_sq) { // Constrained Least Squares // Solving linear equations system - votca::tools::linalg_constrained_qrsolve(_x, _A, _b, _B_constr); + _x = votca::tools::linalg_constrained_qrsolve(_A, _b, _B_constr); } else { // Simple Least Squares Eigen::HouseholderQR dec(_A); _x = dec.solve(_b); Eigen::VectorXd residual = _b - _A * _x; // calculate FM residual - quality of FM - // FM residual is initially calculated in (kJ/(mol*nm))^2 + // FM residual is calculated in (kJ/(mol*nm))^2 double fm_resid = residual.cwiseAbs2().sum(); fm_resid /= (double)(3 * _nbeads * _frame_counter); @@ -492,7 +492,7 @@ void CGForceMatching::FmatchAccumulateData() { sinfo->block_res_f[i] = _x[i + mp]; sinfo->block_res_f2[i] = _x[i + mp + ngp]; } - // result cutted before is assigned to the corresponding spline + // result cut before is assigned to the corresponding spline sinfo->Spline.setSplineData(sinfo->block_res_f, sinfo->block_res_f2); // first output point = first grid point diff --git a/src/tools/csg_resample.cc b/src/tools/csg_resample.cc index 3fed00c3c2f7a2f59f1c0902c3b6b06f35a672b9..6c8b6242a3175a8a2ee26bc6fbcbbc5213517d15 100644 --- a/src/tools/csg_resample.cc +++ b/src/tools/csg_resample.cc @@ -230,7 +230,7 @@ int main(int argc, char **argv) { } out.GenerateGridSpacing(min, max, step); - spline->Calculate(out.x(), out.y()); + out.y() = spline->Calculate(out.x()); // store a comment line if (vm.count("comment")) { @@ -264,7 +264,7 @@ int main(int argc, char **argv) { out.Save(out_file); if (vm.count("derivative")) { - spline->CalculateDerivative(der.x(), der.y()); + der.y() = spline->CalculateDerivative(der.x()); der.Save(vm["derivative"].as()); }