InputSet.h

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include <string>
#include <set>
#include <map>
class InputSet {
protected :
static std::set<long> universe;
static std::set<InputSet*> allSets;
static std::map<long, std::set<InputSet*> > matrix;
InputSet() {}
~InputSet() {}
public :
static void deleteAll();
static InputSet* parse(std::string filePath, std::string setName);
static void globalAdd(InputSet *set, long el);
static size_t getMinCoverage();
static InputSet* getTheBiggest(long el);
static InputSet* getCandidateSet();
static bool removeChildsOfChosen(InputSet* chosen);
static bool removeFromAllSets(long el);
static bool algoStep();
static void printSets(std::set<InputSet*> &iSet, FILE *outFile = NULL);
static std::set<InputSet*> chosen; // the chosen sets <- solution
//---
std::set<long> elems;
std::string fileName;
};