-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlittle.hpp
More file actions
75 lines (66 loc) · 2.18 KB
/
little.hpp
File metadata and controls
75 lines (66 loc) · 2.18 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* glowna klasa, posiada:
* zmienne:
* kara - wyliczane z bilansu zer w kroku 2
* h - wyliczane w kroku 5
* *head - wskaznik na poczatek grafu
* *next - wskaznik pomocniczy na kolejne elementy grafu
*
* ta klasa posiada 9 metod które robią to co kroki algorytmu opisane w ksiazce
* sa tutaj metody do wyswietlania elementow na ekranie, takie jak:
* wypiszKrok1Wegierski() - wyswietla macierz z elementami ktore sie odejmuje, nic nie oblicza
* wypiszKrok2Wegierski() - dokladnie to samo co wyzej
* showData() - aktualnie nie uzywane, mozna napisac na nowo zeby wyswietlac co sie dzieje na kazdym etapie programu
* showArray() - wyswietla aktualna macierz, nic nie oblicza
* showGraph() - pokazuje drzewko grafu
*
* metodaWegierskaKrok1() - oblicza nowa macierz i zwraca sume odjetych liczb
* metodaWegierskaKrok2() - identycznie co wyzej
*
*/
#ifndef LITTLE_HPP
#define LITTLE_HPP
#include "macierz.hpp"
#include "nodeBT.hpp"
#include "global.hpp"
using namespace std;
class little{
public:
little();
little(int row, int col);
little(vector<vector<double>> Tab);
~little();
void stepOne();
void stepTwo();
void stepTree();
void stepFour();
void stepFive();
void stepSix();
void stepSeven();
void stepEight();
void stepNine();
void result2(bool showCities);
double metodaWegierskaKrok1(nodeBT &_node);
double metodaWegierskaKrok2(nodeBT &_node);
void wypiszKrok1Wegierski(nodeBT &_node);
void wypiszKrok2Wegierski(nodeBT &_node);
nodeBT* addNode(char& row, char& col, double& limit);
void showData();
void showArray(bool showCities);
void showArray(const nodeBT &_node,bool showCities);
void showGraph(const string &prefix, const nodeBT *node, bool isLeft, bool showCities);
void showGraph(bool showCities);
static string city(char key);
string city(string key);
void set(vector<vector<double>> &_set);
void set(macierz &_set);
void setStepByStep(const bool &_set){stepByStep = _set;}
bool& getStepByStep(){return stepByStep;};
private:
double kara, h;
nodeBT *head;
nodeBT *next;
list<char> result,savePath;
bool stepByStep;
};
#endif // LITTLE_HPP