Orbiter 2022
Combinatorial Objects
graph_modification_description.cpp
Go to the documentation of this file.
1/*
2 * graph_modification_description.cpp
3 *
4 * Created on: Oct 13, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_graph_theory {
18
19
20
22{
24
26}
27
29{
30}
31
32
34 int argc, int &i, std::string *argv,
35 int verbose_level)
36{
37 int f_v = (verbose_level >= 1);
39
40 if (f_v) {
41 cout << "graph_modification_description::check_and_parse_argument" << endl;
42 }
43 if (ST.stringcmp(argv[i], "-complement") == 0) {
45 i++;
46 if (f_v) {
47 cout << "-complement " << endl;
48 }
49 return TRUE;
50 }
51 else if (ST.stringcmp(argv[i], "-distance_2") == 0) {
53 i++;
54 if (f_v) {
55 cout << "-distance_2 " << endl;
56 }
57 return TRUE;
58 }
59 if (f_v) {
60 cout << "graph_modification_description::read_arguments done" << endl;
61 }
62 return FALSE;
63}
64
66 int argc, std::string *argv,
67 int verbose_level)
68{
69 int f_v = (verbose_level >= 1);
70 int i;
72
73 if (f_v) {
74 cout << "graph_modification_description::read_arguments" << endl;
75 }
76 for (i = 0; i < argc; i++) {
77
78 if (ST.stringcmp(argv[i], "-complement") == 0) {
80 if (f_v) {
81 cout << "-complement " << endl;
82 }
83 }
84
85 else if (ST.stringcmp(argv[i], "-distance_2") == 0) {
87 if (f_v) {
88 cout << "-distance_2 " << endl;
89 }
90 }
91
92 else if (ST.stringcmp(argv[i], "-end") == 0) {
93 if (f_v) {
94 cout << "-end" << endl;
95 }
96 break;
97 }
98 else {
99 cout << "graph_modification_description::read_arguments "
100 "unrecognized option " << argv[i] << endl;
101 }
102 } // next i
103 if (f_v) {
104 cout << "graph_modification_description::read_arguments done" << endl;
105 }
106 return i + 1;
107}
108
110{
111 if (f_complement) {
112 cout << "-complement " << endl;
113 }
114 if (f_distance_2) {
115 cout << "-distance_2 " << endl;
116 }
117}
118
120{
121 int f_v = (verbose_level >= 1);
122
123 if (f_v) {
124 cout << "graph_modification_description::apply" << endl;
125 }
126 if (f_complement) {
127 CG->complement(verbose_level);
128 }
129 if (f_distance_2) {
130 CG->distance_2(verbose_level);
131 }
132 if (f_v) {
133 cout << "graph_modification_description::apply done" << endl;
134 }
135}
136
137
138
139}}}
140
functions related to strings and character arrays
int check_and_parse_argument(int argc, int &i, std::string *argv, int verbose_level)
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects