Logo Search packages:      
Sourcecode: cdk version File versions  Download package

void org::openscience::cdk::graph::invariant::CanonicalLabeler::breakTies ( ArrayList  v  )  [inline, private]

Break ties. Corresponds to step 7

Parameters:
v the invariance pair vector

Definition at line 235 of file CanonicalLabeler.java.

References org::openscience::cdk::smiles::InvPair::getCurr(), org::openscience::cdk::smiles::InvPair::setCurr(), and org::openscience::cdk::smiles::InvPair::setPrime().

Referenced by step3().

                                      {
    Iterator it = v.iterator();
    InvPair curr;
    InvPair last = null;
    int tie = 0;
    boolean found = false;
    for (int x = 0; it.hasNext(); x++) {
      curr = (InvPair) it.next();
      curr.setCurr(curr.getCurr() * 2);
      curr.setPrime();
      if (x != 0 && !found && curr.getCurr() == last.getCurr()) {
        tie = x - 1;
        found = true;
      }
      last = curr;
    }
    curr = (InvPair) v.get(tie);
    curr.setCurr(curr.getCurr() - 1);
    curr.setPrime();
  }


Generated by  Doxygen 1.6.0   Back to index