Candidate_v1.7.0
        stable
      
      
        
          | 
            Last change
 on this file since fc38cb was             5061d9, checked in by Frederik Heber <frederik.heber@…>, 5 years ago           | 
        
        
          | 
             
Added action to print selected atoms as graph6 string. 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1014 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | /*
 | 
|---|
| 2 |  * Graph6Writer.hpp
 | 
|---|
| 3 |  *
 | 
|---|
| 4 |  *  Created on: Apr 2, 2021
 | 
|---|
| 5 |  *      Author: heber
 | 
|---|
| 6 |  */
 | 
|---|
| 7 | 
 | 
|---|
| 8 | 
 | 
|---|
| 9 | #ifndef GRAPH_GRAPH6WRITER_HPP_
 | 
|---|
| 10 | #define GRAPH_GRAPH6WRITER_HPP_
 | 
|---|
| 11 | 
 | 
|---|
| 12 | // include config.h
 | 
|---|
| 13 | #ifdef HAVE_CONFIG_H
 | 
|---|
| 14 | #include <config.h>
 | 
|---|
| 15 | #endif
 | 
|---|
| 16 | 
 | 
|---|
| 17 | #include <iosfwd>
 | 
|---|
| 18 | #include <vector>
 | 
|---|
| 19 | 
 | 
|---|
| 20 | class atom;
 | 
|---|
| 21 | 
 | 
|---|
| 22 | /** This functor prints a set of atoms as a graph6 formatted strings and returns
 | 
|---|
| 23 |  * all elements as a vector in the same order as the nodes in the graph6
 | 
|---|
| 24 |  * representation.
 | 
|---|
| 25 |  *
 | 
|---|
| 26 |  * This is inspired by https://github.com/adrianN/graph6/, only I found the code
 | 
|---|
| 27 |  * there quite ugly and unnecessarily complicated: inheriting from std::iterator,
 | 
|---|
| 28 |  * overriding all the operators (++, *, ...) for no apparent reason instead of
 | 
|---|
| 29 |  * adding normal functions, ...
 | 
|---|
| 30 |  *
 | 
|---|
| 31 |  */
 | 
|---|
| 32 |  struct Graph6Writer
 | 
|---|
| 33 | {
 | 
|---|
| 34 |    const std::vector<const atom *> _atoms;
 | 
|---|
| 35 | 
 | 
|---|
| 36 |    Graph6Writer(const std::vector<const atom *> atoms);
 | 
|---|
| 37 | 
 | 
|---|
| 38 |    void write_n(std::ostream& out);
 | 
|---|
| 39 | 
 | 
|---|
| 40 |    void write_graph6(std::ostream& out);
 | 
|---|
| 41 | 
 | 
|---|
| 42 |    void write_elementlist(std::ostream& out);
 | 
|---|
| 43 | };
 | 
|---|
| 44 | 
 | 
|---|
| 45 | 
 | 
|---|
| 46 | #endif /* GRAPH_GRAPH6WRITER_HPP_ */
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.