-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstTypes.h
60 lines (50 loc) · 940 Bytes
/
ConstTypes.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// this file has definitions for constants,enums ,structures and other global rellevant fields.
#pragma once
#define NO_PARENT -1
namespace AlgoGraph
{
enum class Result
{
SUCCESS = 0,
NEGATIVE_CYCLE = 1,
INFINITY_PATH = 2,
};
enum class QueueType
{
MinHeap = 0,
Array = 1,
};
struct Weight
{
float weight;
bool infinity;
bool operator <(const Weight& other)
{
if(this->infinity && other.infinity) //both inf
{
return false;
}
else if (this->infinity && !other.infinity) // inf < not inf ---> false cause bigger
{
return false;
}
else if (!this->infinity && other.infinity) // not inf < inf ---> true cause smaller
{
return true;
}
else
{
return this->weight < other.weight;
}
}
};
struct VertexDV
{
Weight VertexWeight;
int Vertex;
bool operator <(const VertexDV& other)
{
return this->VertexWeight < other.VertexWeight;
}
};
}