Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit c97d398e authored by gsell's avatar gsell
Browse files

boost pointers replaced with std pointers

parent e22e0f18
No related branches found
No related tags found
1 merge request!654Resolve "replace boost::scoped_ptr with std::unique_ptr"
......@@ -468,7 +468,7 @@ void SampleCmd::execute() {
try {
CmdArguments_t args(new CmdArguments(argv.size(), &argv[0]));
boost::shared_ptr<Comm_t> comm(new Comm_t(args, MPI_COMM_WORLD));
std::shared_ptr<Comm_t> comm(new Comm_t(args, MPI_COMM_WORLD));
if (comm->isWorker())
stashEnvironment();
......@@ -480,7 +480,7 @@ void SampleCmd::execute() {
}
}
boost::scoped_ptr<pilot_t> pi(new pilot_t(args, comm, funcs, dvars,
const std::unique_ptr<pilot_t> pi(new pilot_t(args, comm, funcs, dvars,
objectives, sampleMethods,
storeobjstr, filesToKeep, userVariables));
if (comm->isWorker())
......
......@@ -52,7 +52,7 @@ public:
}
}
void create(boost::shared_ptr<SampleIndividual>& ind, size_t i) {
void create(std::shared_ptr<SampleIndividual>& ind, size_t i) {
ind->genes[i] = getNext(ind->id);
}
......
......@@ -51,7 +51,7 @@ class SamplePilot : protected Pilot<Opt_t,
public:
SamplePilot(CmdArguments_t args, boost::shared_ptr<Comm_t> comm,
SamplePilot(CmdArguments_t args, std::shared_ptr<Comm_t> comm,
functionDictionary_t known_expr_funcs,
const DVarContainer_t &dvar,
const Expressions::Named_t &obj,
......@@ -124,7 +124,7 @@ protected:
<< "\e[0m" << std::endl;
std::cout << os.str() << std::flush;
boost::scoped_ptr<Opt_t> opt(
const std::unique_ptr<Opt_t> opt(
new Opt_t(sampleMethods_m, this->objectives_, this->dvars_,
this->comm_->getBundle(), this->cmd_args_));
opt->initialize();
......@@ -149,7 +149,7 @@ protected:
pos = tmplfile.find(".");
std::string simName = tmplfile.substr(0,pos);
boost::scoped_ptr< SampleWorker<Sim_t> > w(
const std::unique_ptr< SampleWorker<Sim_t> > w(
new SampleWorker<Sim_t>(this->objectives_, this->constraints_, simName,
this->comm_->getBundle(), this->cmd_args_,
storeobjstr, filesToKeep, userVariables));
......
......@@ -42,7 +42,7 @@ public:
, step_m(step)
{ }
void create(boost::shared_ptr<SampleIndividual>& ind, size_t i) {
void create(std::shared_ptr<SampleIndividual>& ind, size_t i) {
size_t idx = unif_m.getNext();
ind->genes[i] = static_cast<T>(lower_m + idx * step_m);
}
......
......@@ -37,7 +37,7 @@ public:
, volumeLowerDimensions_m(modulo)
{ }
void create(boost::shared_ptr<SampleIndividual>& ind, size_t i) {
void create(std::shared_ptr<SampleIndividual>& ind, size_t i) {
unsigned int id = ind->id;
......
......@@ -134,7 +134,7 @@ bool Sampler::onMessage(MPI_Status status, size_t length) {
switch(tag) {
case REQUEST_FINISHED: {
unsigned int jid = static_cast<unsigned int>(length);
typename std::map<size_t, boost::shared_ptr<Individual_t> >::iterator it;
typename std::map<size_t, std::shared_ptr<Individual_t> >::iterator it;
it = jobmapping_m.find(jid);
if(it == jobmapping_m.end()) {
......@@ -144,7 +144,7 @@ bool Sampler::onMessage(MPI_Status status, size_t length) {
}
boost::shared_ptr<Individual_t> ind = it->second;
std::shared_ptr<Individual_t> ind = it->second;
reqVarContainer_t res;
MPI_Recv_reqvars(res, status.MPI_SOURCE, comms_.opt);
......@@ -200,7 +200,7 @@ void Sampler::createNewIndividual() {
dNames.push_back(dName);
}
boost::shared_ptr<Individual_t> ind = boost::shared_ptr<Individual_t>( new Individual_t(dNames));
std::shared_ptr<Individual_t> ind = std::shared_ptr<Individual_t>( new Individual_t(dNames));
ind->id = gid++;
......@@ -292,7 +292,7 @@ void Sampler::dumpIndividualsToJSON() {
}
void Sampler::addIndividualToJSON(const boost::shared_ptr<Individual_t>& ind) {
void Sampler::addIndividualToJSON(const std::shared_ptr<Individual_t>& ind) {
individualsToDump_m.push_back(*ind);
if (jsonDumpFreq_m <= individualsToDump_m.size()) {
......@@ -340,7 +340,7 @@ void Sampler::runStateMachine() {
void Sampler::dispatch_forward_solves() {
while ( !individuals_m.empty() ) {
boost::shared_ptr<Individual_t> ind = individuals_m.front();
std::shared_ptr<Individual_t> ind = individuals_m.front();
individuals_m.pop();
......@@ -367,6 +367,6 @@ void Sampler::dispatch_forward_solves() {
MPI_Send_params(params, pilot_rank, comms_.opt);
jobmapping_m.insert(
std::pair<size_t, boost::shared_ptr<Individual_t> >(jid, ind));
std::pair<size_t, std::shared_ptr<Individual_t> >(jid, ind));
}
}
\ No newline at end of file
......@@ -119,9 +119,9 @@ private:
Comm::Bundle_t comms_;
/// mapping from unique job ID to individual
std::map<size_t, boost::shared_ptr<Individual_t> > jobmapping_m;
std::map<size_t, std::shared_ptr<Individual_t> > jobmapping_m;
std::queue<boost::shared_ptr<Individual_t> > individuals_m;
std::queue<std::shared_ptr<Individual_t> > individuals_m;
/// bounds on each specified gene
bounds_t dVarBounds_m;
......@@ -158,7 +158,7 @@ private:
std::list<Individual_t> individualsToDump_m;
void dumpIndividualsToJSON();
void addIndividualToJSON(const boost::shared_ptr<Individual_t>& ind);
void addIndividualToJSON(const std::shared_ptr<Individual_t>& ind);
void runStateMachine();
......
......@@ -34,7 +34,7 @@ class SamplingMethod
public:
virtual ~SamplingMethod() {};
virtual void create(boost::shared_ptr<SampleIndividual>& ind, size_t i) = 0;
virtual void create(std::shared_ptr<SampleIndividual>& ind, size_t i) = 0;
/*!
* Allocate memory for sampling. Not every sampling method
......
......@@ -54,7 +54,7 @@ public:
RNGStream::deleteInstance(RNGInstance_m);
}
void create(boost::shared_ptr<SampleIndividual>& ind, size_t i) {
void create(std::shared_ptr<SampleIndividual>& ind, size_t i) {
ind->genes[i] = RNGInstance_m->getNext(dist_m);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment