Skip to content
Snippets Groups Projects
Commit 293d2d2a authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

unique_ptr: removed delete

parent c23bae39
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@
#include "tools/KernelFunctions.h"
#include "tools/SwitchingFunction.h"
#include "ActionVolume.h"
#include <memory>
//+PLUMEDOC VOLUMES INENVELOPE
/*
......@@ -63,7 +64,7 @@ namespace multicolvar {
class VolumeInEnvelope : public ActionVolume {
private:
LinkCells mylinks;
KernelFunctions* kernel;
std::unique_ptr<KernelFunctions> kernel;
std::vector<Value*> pos;
std::vector<Vector> ltmp_pos;
std::vector<unsigned> ltmp_ind;
......@@ -104,7 +105,7 @@ VolumeInEnvelope::VolumeInEnvelope(const ActionOptions& ao):
std::vector<double> pp(3,0.0), bandwidth(3); parseVector("BANDWIDTH",bandwidth);
log.printf(" using %s kernel with bandwidths %f %f %f \n",getKernelType().c_str(),bandwidth[0],bandwidth[1],bandwidth[2] );
kernel = new KernelFunctions( pp, bandwidth, getKernelType(), "DIAGONAL", 1.0 );
kernel.reset( new KernelFunctions( pp, bandwidth, getKernelType(), "DIAGONAL", 1.0 ) );
for(unsigned i=0; i<3; ++i) { pos.push_back(new Value()); pos[i]->setNotPeriodic(); }
std::vector<double> csupport( kernel->getContinuousSupport() );
double maxs = csupport[0];
......@@ -115,7 +116,7 @@ VolumeInEnvelope::VolumeInEnvelope(const ActionOptions& ao):
}
VolumeInEnvelope::~VolumeInEnvelope() {
delete kernel; for(unsigned j=0; j<3; ++j) delete pos[j];
for(unsigned j=0; j<3; ++j) delete pos[j];
}
void VolumeInEnvelope::setupRegions() {
......
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