source: src/Graph/Graph6Writer.hpp@ bcc29ca

Candidate_v1.7.0 stable
Last change on this file since bcc29ca was 5a479d, checked in by Frederik Heber <frederik.heber@…>, 21 months ago

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.
  • Property mode set to 100644
File size: 1.1 KB
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#include "types.hpp"
21
22class atom;
23
24/** This functor prints a set of atoms as a graph6 formatted strings and returns
25 * all elements as a vector in the same order as the nodes in the graph6
26 * representation.
27 *
28 * This is inspired by https://github.com/adrianN/graph6/, only I found the code
29 * there quite ugly and unnecessarily complicated: inheriting from std::iterator,
30 * overriding all the operators (++, *, ...) for no apparent reason instead of
31 * adding normal functions, ...
32 *
33 */
34 struct Graph6Writer
35{
36 const std::vector<const atom *> _atoms;
37
38 Graph6Writer(const std::vector<const atom *> atoms);
39
40 void write_n(std::ostream& out);
41
42 void write_graph6(std::ostream& out);
43
44 void write_elementlist(std::ostream& out);
45
46 void write_simple_elementlist(std::ostream& out);
47
48private:
49 atomId_t getBoundaryNonHydrogen() const;
50};
51
52
53#endif /* GRAPH_GRAPH6WRITER_HPP_ */
Note: See TracBrowser for help on using the repository browser.