520 |
|
//return the position of joint atom apears in rigidbody's definition |
521 |
|
//for the time being, we will use the most inefficient algorithm, the complexity is O(N2) |
522 |
|
//actually we could improve the complexity to O(NlgN) by sorting the atom index in rigid body first |
523 |
< |
std::vector<pair<int, int> > MoleculeStamp::getJointAtoms(int rb1, int rb2){ |
523 |
> |
std::vector<std::pair<int, int> > MoleculeStamp::getJointAtoms(int rb1, int rb2){ |
524 |
|
RigidBodyStamp* rbStamp1; |
525 |
|
RigidBodyStamp* rbStamp2; |
526 |
|
int natomInRb1; |
527 |
|
int natomInRb2; |
528 |
|
int atomIndex1; |
529 |
|
int atomIndex2; |
530 |
< |
std::vector<pair<int, int> > jointAtomIndexPair; |
530 |
> |
std::vector<std::pair<int, int> > jointAtomIndexPair; |
531 |
|
|
532 |
|
rbStamp1 = this->getRigidBody(rb1); |
533 |
|
natomInRb1 =rbStamp1->getNMembers(); |
542 |
|
atomIndex2 = rbStamp2->getMember(j); |
543 |
|
|
544 |
|
if(atomIndex1 == atomIndex2){ |
545 |
< |
jointAtomIndexPair.push_back(make_pair(i, j)); |
545 |
> |
jointAtomIndexPair.push_back(std::make_pair(i, j)); |
546 |
|
break; |
547 |
|
} |
548 |
|
|