21 CompareFunc compare_vertices;
22 CompareFunc compare_data;
23 DestroyFunc destroy_data;
26 Graph(CompareFunc compare, DestroyFunc vecDestroy);
31 void removeVertex(Pointer vertex);
32 void insertEdge(Pointer vertex1, Pointer vertex2);
33 void removeEdge(Pointer vertex1, Pointer vertex2);
34 Vector* getAdjacentV(Pointer vertex);
35 Vector* getReverseAdjacentV(Pointer vertex);
37 bool isNeighborVertex(Pointer v1, Pointer v2);
38 CompareFunc getCompareData() {
return this->compare_data; };
39 CompareFunc getCompareVertices() {
return this->compare_vertices; };
40 DestroyFunc getDestroyData() {
return this->destroy_data; };
41 Vector* getVec() {
return this->vec; };
57 void setPos(
int pos) { this->posInGraphVector = pos; };
58 int getPos() {
return this->posInGraphVector; };
59 void addNeighbor(Pointer neighbor) { this->neighbors->
insert(neighbor); };
60 void addReverse(Pointer reverse) { this->reverse->insert(reverse); };
61 void removeNeighbor(Pointer neighbor, CompareFunc compare) {
62 this->neighbors->
remove(neighbor, compare);
64 void removeReverse(Pointer reverse, CompareFunc compare) {
65 this->reverse->
remove(reverse, compare);
67 PQueue* getNeighbors() {
return this->neighbors; };
68 PQueue* getReverse() {
return this->reverse; };
69 Pointer getData() {
return this->data; };
70 Graph* getOwner() {
return this->owner; };
71 void check() { this->hasBeenChecked =
true; };
72 bool checked() {
return this->hasBeenChecked; };
73 void setNorm(
double norm) { this->norm = norm; };
74 double getNorm() {
return this->norm; };
80 : flag(
true), vertex1(vertex1), vertex2(vertex2), owner(owner){};
81 Pointer getVertex1() {
return this->vertex1; };
82 Pointer getVertex2() {
return this->vertex2; };
83 Graph* getOwner() {
return this->owner; };
84 void setFalse() { this->flag =
false; };
85 bool getFlag() {
return this->flag; };
ADTVector implementation using a dynamic array.
Definition ADTGraph.hpp:77
Definition ADTGraph.hpp:44
Definition ADTGraph.hpp:17
Vector * getGeneralNeighborsV(Pointer vertex)
Returns a vector where the K first elements are the direct neighbors of the vertex and the rest are t...
Definition ADTGraph.cpp:167
void insertVertex(Pointer vertex)
Insert a vertex to the graph (if it doesn't already exist).
Definition ADTGraph.cpp:70
ADT Priority Queue.
Definition ADTPQueue.hpp:19
void insert(Pointer value)
Insert a new element to the queue.
Definition ADTPQueue.cpp:112
void remove(Pointer value, CompareFunc compare)
Finds (using the given compare function) and removes the node with the given value.
Definition ADTPQueue.cpp:145
ADT Vector.
Definition ADTVector.hpp:58