Skip to content

Commit

Permalink
Merge pull request #204 from mach3-software/patches/hwallace/more_wer…
Browse files Browse the repository at this point in the history
…ror_fixes

More fixes to werror
  • Loading branch information
dbarrow257 authored Nov 5, 2024
2 parents f5eb7a4 + 9e60ce9 commit 03a351f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mcmc/MCMCProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3156,8 +3156,10 @@ void MCMCProcessor::ParameterEvolution(const std::vector<std::string>& Names,

const int IntervalsSize = nSteps/NIntervals[k];
// ROOT won't overwrite gifs so we need to delete the file if it's there already
system(fmt::format("rm {}.gif",Names[k]).c_str());

int ret = system(fmt::format("rm {}.gif",Names[k]).c_str());
if (ret != 0){
MACH3LOG_WARN("Error: system call to delete {} failed with code {}", Names[k], ret);
}
// This holds the posterior density
const double maxi = Chain->GetMaximum(BranchNames[ParamNo]);
const double mini = Chain->GetMinimum(BranchNames[ParamNo]);
Expand Down
5 changes: 4 additions & 1 deletion mcmc/PSO.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ class PSO : public LikelihoodFit {
double swarmIterate();

std::vector<double> vector_multiply(std::vector<double> velocity, double mul){
transform(velocity.begin(),velocity.end(),velocity.begin(),std::bind1st(std::multiplies<double>(),mul));
// std::bind1st deprecated since C++11, removed in c++17
// transform(velocity.begin(),velocity.end(),velocity.begin(),std::bind1st(std::multiplies<double>(),mul));
std::transform(velocity.begin(), velocity.end(), velocity.begin(),
std::bind(std::multiplies<double>(), mul, std::placeholders::_1));
return velocity;
};

Expand Down

0 comments on commit 03a351f

Please sign in to comment.