mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Fix and test sf.net bug 1719831 (http://sourceforge.net/tracker/index.php?func=detail&aid=1719831&group_id=160139&atid=814650)
Cleanup similar issues in UniformGrid3D MolOps.cpp: docs patch
This commit is contained in:
@@ -29,14 +29,18 @@ namespace RDKit {
|
||||
}
|
||||
|
||||
unsigned int DiscreteValueVect::getVal(unsigned int i) const {
|
||||
RANGE_CHECK(0, i, d_length-1);
|
||||
if(i >= d_length){
|
||||
throw IndexErrorException(i);
|
||||
}
|
||||
unsigned int shift = d_bitsPerVal*(i%d_valsPerInt);
|
||||
unsigned int intId = i/d_valsPerInt;
|
||||
return ( (d_data[intId] >> shift) & d_mask);
|
||||
}
|
||||
|
||||
void DiscreteValueVect::setVal(unsigned int i, unsigned int val) {
|
||||
RANGE_CHECK(0, i, d_length-1);
|
||||
if(i >= d_length){
|
||||
throw IndexErrorException(i);
|
||||
}
|
||||
if ((val & d_mask) != val) {
|
||||
throw ValueErrorException("Value out of range");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user