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

A couple of assertions transformed so to be used only in dbg

Speeds up RMSD quite a bit with -DNDEBUG
parent b540e765
No related branches found
No related tags found
No related merge requests found
...@@ -101,8 +101,8 @@ void ActionWithValue::setPeriodic( const std::string& min, const std::string& ma ...@@ -101,8 +101,8 @@ void ActionWithValue::setPeriodic( const std::string& min, const std::string& ma
} }
Value* ActionWithValue::getPntrToValue(){ Value* ActionWithValue::getPntrToValue(){
plumed_massert(values.size()==1,"The number of components is not equal to one"); plumed_dbg_massert(values.size()==1,"The number of components is not equal to one");
plumed_massert(values[0]->name==getLabel(), "The value you are trying to retrieve is not the default"); plumed_dbg_massert(values[0]->name==getLabel(), "The value you are trying to retrieve is not the default");
return values[0]; return values[0];
} }
...@@ -173,7 +173,7 @@ Value* ActionWithValue::getPntrToComponent( const std::string& name ){ ...@@ -173,7 +173,7 @@ Value* ActionWithValue::getPntrToComponent( const std::string& name ){
} }
Value* ActionWithValue::getPntrToComponent( int n ){ Value* ActionWithValue::getPntrToComponent( int n ){
plumed_massert(n<values.size(),"you have requested a pointer that is out of bounds"); plumed_dbg_massert(n<values.size(),"you have requested a pointer that is out of bounds");
return values[n]; return values[n];
} }
......
...@@ -205,7 +205,7 @@ unsigned Value::getNumberOfDerivatives() const { ...@@ -205,7 +205,7 @@ unsigned Value::getNumberOfDerivatives() const {
inline inline
double Value::getDerivative(const unsigned n) const { double Value::getDerivative(const unsigned n) const {
plumed_massert(n<derivatives.size(),"you are asking for a derivative that is out of bounds"); plumed_dbg_massert(n<derivatives.size(),"you are asking for a derivative that is out of bounds");
return derivatives[n]; return derivatives[n];
} }
......
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