Changeset 5a479d for src/Graph


Ignore:
Timestamp:
Jan 24, 2024, 4:53:03 PM (22 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
d203d1e
Parents:
d083cc
git-author:
Frederik Heber <frederik.heber@…> (01/22/24 22:21:29)
git-committer:
Frederik Heber <frederik.heber@…> (01/24/24 16:53:03)
Message:

Added python actions to generate all graph6 strings.

  • graph6 strings don't take permutations in the adjacency matrix into account. Hence, we are going through every permutation of non-hydrogens and generate the respective graph6 string.
Location:
src/Graph
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/Graph6Writer.cpp

    rd083cc r5a479d  
    158158bool OnlyNonHydrogens(const bond &_bond) {
    159159  return _bond.HydrogenBond == 0;
     160}
     161
     162void Graph6Writer::write_simple_elementlist(std::ostream& out) {
     163  bool isFirst = true;
     164  for(std::vector<const atom *>::const_iterator iter = _atoms.begin();
     165      iter != _atoms.end(); ++iter) {
     166    const atom *walker = *iter;
     167    if (walker->getElement().getAtomicNumber() != (atomicNumber_t)1) {
     168      if (!isFirst)
     169        out << ' ';
     170      isFirst = false;
     171      out << walker->getElement().getSymbol();
     172    }
     173  }
    160174}
    161175
  • src/Graph/Graph6Writer.hpp

    rd083cc r5a479d  
    4444   void write_elementlist(std::ostream& out);
    4545
     46   void write_simple_elementlist(std::ostream& out);
     47
    4648private:
    4749   atomId_t getBoundaryNonHydrogen() const;
Note: See TracChangeset for help on using the changeset viewer.