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

unique_ptr: MultiDomainRMSD

parent 93618442
No related branches found
No related tags found
No related merge requests found
...@@ -35,10 +35,6 @@ MultiDomainRMSD::MultiDomainRMSD( const ReferenceConfigurationOptions& ro ): ...@@ -35,10 +35,6 @@ MultiDomainRMSD::MultiDomainRMSD( const ReferenceConfigurationOptions& ro ):
{ {
} }
MultiDomainRMSD::~MultiDomainRMSD() {
for(unsigned i=0; i<domains.size(); ++i) delete domains[i];
}
void MultiDomainRMSD::read( const PDB& pdb ) { void MultiDomainRMSD::read( const PDB& pdb ) {
unsigned nblocks = pdb.getNumberOfAtomBlocks(); unsigned nblocks = pdb.getNumberOfAtomBlocks();
if( nblocks<2 ) error("multidomain RMSD only has one block of atoms"); if( nblocks<2 ) error("multidomain RMSD only has one block of atoms");
...@@ -60,7 +56,7 @@ void MultiDomainRMSD::read( const PDB& pdb ) { ...@@ -60,7 +56,7 @@ void MultiDomainRMSD::read( const PDB& pdb ) {
parse("UPPER_CUTOFF"+num,upper,true); parse("UPPER_CUTOFF"+num,upper,true);
nopbc=false; parseFlag("NOPBC"+num,nopbc); nopbc=false; parseFlag("NOPBC"+num,nopbc);
} }
domains.push_back( metricRegister().create<SingleDomainRMSD>( ftype ) ); domains.emplace_back( metricRegister().create<SingleDomainRMSD>( ftype ) );
positions.resize( blocks[i] - blocks[i-1] ); positions.resize( blocks[i] - blocks[i-1] );
align.resize( blocks[i] - blocks[i-1] ); align.resize( blocks[i] - blocks[i-1] );
displace.resize( blocks[i] - blocks[i-1] ); displace.resize( blocks[i] - blocks[i-1] );
......
...@@ -37,10 +37,9 @@ private: ...@@ -37,10 +37,9 @@ private:
/// Blocks containing start and end points for all the domains /// Blocks containing start and end points for all the domains
std::vector<unsigned> blocks; std::vector<unsigned> blocks;
/// Each of the domains we are calculating the distance from /// Each of the domains we are calculating the distance from
std::vector<SingleDomainRMSD*> domains; std::vector<std::unique_ptr<SingleDomainRMSD>> domains;
public: public:
explicit MultiDomainRMSD( const ReferenceConfigurationOptions& ro ); explicit MultiDomainRMSD( const ReferenceConfigurationOptions& ro );
~MultiDomainRMSD();
/// Read in the input from a pdb /// Read in the input from a pdb
void read( const PDB& ); void read( const PDB& );
/// Set the input from an analysis object (don't know how this will work yet so currently just a plumed_error) /// Set the input from an analysis object (don't know how this will work yet so currently just a plumed_error)
......
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