--- MeasureSymmetry.C.orig 2013-11-22 14:08:24.000000000 +0100 +++ MeasureSymmetry.C 2013-11-22 14:07:39.000000000 +0100 @@ -1103,8 +1103,8 @@ void Symmetry::find_planes() { for (i=0; iselected; i++) { // If we have more than maxnatoms atoms in the selection then pick - // only approximately maxnatoms random atoms for the comparision. - if (sel->selected>maxnatoms && vmd_random()>maxnatoms/sel->selected) + // only approximately maxnatoms random atoms for the comparison. + if (sel->selected > maxnatoms && vmd_random() % sel->selected > maxnatoms) continue; vec_sub(posA, coor+3*i, rcom); @@ -1163,8 +1163,8 @@ void Symmetry::find_C2axes() { // Loop over all atoms for (i=0; iselected; i++) { // If we have more than maxnatoms atoms in the selection then pick - // only approximately maxnatoms random atoms for the comparision. - if (sel->selected>maxnatoms && vmd_random()>maxnatoms/sel->selected) + // only approximately maxnatoms random atoms for the comparison. + if (sel->selected > maxnatoms && vmd_random() % sel->selected > maxnatoms) continue; vec_sub(posA, coor+3*i, rcom); @@ -1177,10 +1177,6 @@ void Symmetry::find_C2axes() { if (rA < sigma || rA < sel->num_atoms/7.0*sigma) continue; for (j=i+1; jselected; j++) { - // If we have more than maxnatoms atoms in the selection then pick - // only approximately maxnatoms random atoms for the comparision. - if (sel->selected>maxnatoms && vmd_random()>maxnatoms/sel->selected) continue; - vec_sub(posB, coor+3*j, rcom); rB = sqrtf(posB[0]*posB[0] + posB[1]*posB[1] + posB[2]*posB[2]); @@ -1305,8 +1301,8 @@ void Symmetry::find_axes(int order) { // Loop over all atoms for (i=0; iselected; i++) { // If we have more than maxnatoms atoms in the selection then pick - // only approximately maxnatoms random atoms for the comparision. - if (sel->selected>maxnatoms && vmd_random()>maxnatoms/sel->selected) + // only approximately maxnatoms random atoms for the comparison. + if (sel->selected > maxnatoms && vmd_random() % sel->selected > maxnatoms) continue; vec_sub(posA, coor+3*i, rcom); @@ -1325,10 +1321,8 @@ void Symmetry::find_axes(int order) { // If we have more than maxnatoms atoms in the selection // then pick only approximately maxnatoms random atoms // for the comparison. - if (sel->selected>maxnatoms && - vmd_random()>maxnatoms/sel->selected) { + if (sel->selected > maxnatoms && vmd_random() % sel->selected > maxnatoms) continue; - } // Consider only pairs with identical atom types if (atomtype[j]!=atomtype[i]) continue; @@ -4280,10 +4274,6 @@ static float trans_overlap(int *atomtype // generate transformed coordinates int i, ncompare=0; for(i=0; imaxnatoms && vmd_random()>maxnatoms/numcoor) continue; - trans->multpoint3d(posA+3*i, posB+3*i); // Depending on the flag skip atoms that underwent an almost