Doxygen Generated Documentation of Ben-Jose Trainable SAT Solver Library
dbg_sortor.h
1 
2 
3 /*************************************************************
4 
5 This file is part of ben-jose.
6 
7 ben-jose is free software: you can redistribute it and/or modify
8 it under the terms of the version 3 of the GNU General Public
9 License as published by the Free Software Foundation.
10 
11 ben-jose is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with ben-jose. If not, see <http://www.gnu.org/licenses/>.
18 
19 ------------------------------------------------------------
20 
21 Copyright (C) 2007-2012, 2014-2016. QUIROGA BELTRAN, Jose Luis.
22 Id (cedula): 79523732 de Bogota - Colombia.
23 See https://github.com/joseluisquiroga/ben-jose
24 
25 ben-jose is free software thanks to The Glory of Our Lord
26  Yashua Melej Hamashiaj.
27 Our Resurrected and Living, both in Body and Spirit,
28  Prince of Peace.
29 
30 ------------------------------------------------------------
31 
32 dbg_sortor.h
33 
34 Declaration of functions to read and parse config files.
35 
36 --------------------------------------------------------------*/
37 
38 #ifndef TEST_SORTOR_H
39 #define TEST_SORTOR_H
40 
41 // test sortor
42 
43 #define _XOPEN_SOURCE 500
44 #include <ftw.h>
45 
46 #include <cstring>
47 #include <set>
48 #include <map>
49 #include <iterator>
50 
51 #include <iostream>
52 #include <gmpxx.h>
53 
54 #include "math.h"
55 
56 // g++ t1.cpp -lgmpxx -lgmp -o tt.exe
57 
58 #include "unistd.h"
59 #include "limits.h"
60 
61 #include "util_funcs.h"
62 #include "sortor.h"
63 #include "tak_mak.h"
64 
65 
66 class elem_sor;
67 DECLARE_PRINT_FUNCS(elem_sor);
68 
69 class elem_sor {
70 public:
71  static
72  std::string CL_NAME;
73 
74  virtual
75  std::string& get_cls_name(){
76  return elem_sor::CL_NAME;
77  }
78 
79  std::string es_id;
80  sortee es_srt_bdr;
81  row_sort_id_t es_ids;
82 
83  elem_sor(std::string id = "??"){
84  init_elem_sor(id);
85  }
86 
87  ~elem_sor(){
88  }
89 
90  void init_elem_sor(std::string id = "??"){
91  es_id = id;
92  es_srt_bdr.so_me = this;
93  }
94 
95  void add(long id){
96  es_ids.push(id);
97  }
98 
99  std::ostream& print_elem_sor(std::ostream& os, bool from_pt = false){
100  MARK_USED(from_pt);
101  for(long aa = 0; aa < es_ids.size(); aa++){
102  sort_id_t id = es_ids[aa];
103  os << id;
104  os << ".";
105  }
106  os << " " << es_id;
107  os << es_srt_bdr;
108  os.flush();
109  return os;
110  }
111 };
112 
113 class op_sor {
114 public:
115  elem_sor* op_elem;
116  long op_id;
117 
118  op_sor(){
119  init_op_sor();
120  }
121 
122  ~op_sor(){
123  }
124 
125  void init_op_sor(){
126  op_elem = NULL_PT;
127  op_id = 0;
128  }
129 };
130 
131 DEFINE_PRINT_FUNCS(elem_sor);
132 
133 #endif // TEST_SORTOR_H
134 
Class that is an item to be stabilized.
Definition: sortor.h:152