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

Fixed std::floor

std::floor should only be used with double. With int it makes no sense
and do not compile on blue gene
parent 9a253715
No related branches found
No related tags found
No related merge requests found
......@@ -354,9 +354,9 @@ void MultiColvar::threeBodyNeighborList( const SwitchingFunction& sf ){
if( w<getNLTolerance() ){
// Deactivate all tasks involving i and j
for(unsigned k=0;k<getCurrentNumberOfActiveTasks();++k){
unsigned ind=std::floor( getActiveTask(k) / decoder[0] );
unsigned ind=( getActiveTask(k) / decoder[0] );
if( ind!=i ) continue;
unsigned ind2=std::floor( (getActiveTask(k) - ind*decoder[0]) / decoder[1] );
unsigned ind2=( (getActiveTask(k) - ind*decoder[0]) / decoder[1] );
if( ind2!=j ) continue;
inactive_tasks[k] = 1;
}
......
......@@ -182,7 +182,7 @@ bool MultiColvarBase::setupCurrentAtomList( const unsigned& taskCode ){
natomsper=current_atoms.size();
unsigned scode = taskCode;
for(unsigned i=0;i<ablocks.size();++i){
unsigned ind=std::floor( scode / decoder[i] );
unsigned ind=( scode / decoder[i] );
current_atoms[i]=getBaseQuantityIndex( ablocks[i][ind] );
scode -= ind*decoder[i];
}
......
......@@ -234,7 +234,7 @@ void MultiColvarFunction::addStoredDerivative( const unsigned& jout, const unsig
unsigned jindex = offset + base_index;
plumed_dbg_assert( jindex<3*getNumberOfAtoms() );
addElementDerivative( jout*getNumberOfDerivatives() + jindex, der );
unsigned iatom = std::floor( jindex / 3 );
unsigned iatom = ( jindex / 3 );
atoms_with_derivatives.activate( iatom );
}
}
......
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