Skip to content
Snippets Groups Projects
Commit 79508696 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

pn,pv aka FK01,2 have no effect when j would exceed the allowed range

parent c09bea16
No related branches found
No related tags found
No related merge requests found
......@@ -89,15 +89,16 @@ vector<size_t> triv::sorted_indices(vector<double> const& V)
}
//! Increments all members, or deletes them if they exceed the range 0...siz.
//! Increments all members, provided they remain in the range 0...siz.
void triv::increment_indices( vector<int>& v, int incr, int siz )
{
vector<int> ret;
for( int k: v ){
int kout = k+incr;
if ( 0<=kout && kout<siz )
ret.push_back( kout );
if ( kout<0 || kout>=siz )
return; // leave v unchanged
ret.push_back( kout );
}
v = ret;
}
......
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