-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.hpp
44 lines (41 loc) · 1.34 KB
/
Graph.hpp
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
#pragma once
#include <vector>
#include <iostream>
#include <stdexcept>
using namespace std;
namespace ariel
{
class Graph
{
private:
vector<vector<int>> graph;
static bool isSquare(const vector<vector<int>> &adjacencyMatrix);
size_t countVertices() const;
size_t countEdges() const;
public:
void loadGraph(const vector<vector<int>> &adjacencyMatrix);
void printGraph() const;
const vector<vector<int>> &getGraph() const;
size_t getVertices() const;
size_t getEdges() const;
Graph operator+(const Graph &other);
Graph operator-(const Graph &other);
void operator+=(int num);
void operator-=(int num);
void operator++();
void operator++(int);
void operator--();
void operator--(int);
void operator+();
void operator-();
bool operator>=(const Graph &other) const;
bool operator<=(const Graph &other) const;
bool operator==(const Graph &other) const;
bool operator!=(const Graph &other) const;
bool operator>(const Graph &other) const;
bool operator<(const Graph &other) const;
Graph operator*(int num);
Graph operator*(const Graph &other) const;
friend ostream &operator<<(ostream &os, const Graph &g);
};
} // namespace ariel