From 3b40d598c6e1fd7856dfe53f0be1a4b237fc9683 Mon Sep 17 00:00:00 2001 From: Dimitrii Lopanov Date: Sat, 20 Feb 2021 11:59:00 +0300 Subject: [PATCH 1/4] remove unnecessary method --- vertex.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vertex.go b/vertex.go index f915b49..ab2b132 100644 --- a/vertex.go +++ b/vertex.go @@ -1,7 +1,6 @@ package ch import ( - "fmt" "math" ) @@ -24,9 +23,9 @@ type Vertex struct { importance int } -// PrintInOut Print infromation about out and in edges -func (vertex *Vertex) PrintInOut() { - fmt.Println(vertex.outEdges, vertex.inEdges) +// Importance Returns importance (in term of contraction hierarchies) of vertex +func (vertex *Vertex) Importance() int { + return vertex.importance } // MakeVertex Create vertex with label From 34183173efc2d0b920e99bee683fc5734a4959bb Mon Sep 17 00:00:00 2001 From: Dimitrii Lopanov Date: Sat, 20 Feb 2021 11:59:46 +0300 Subject: [PATCH 2/4] add Importance and OrderPos methods --- vertex.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vertex.go b/vertex.go index ab2b132..2fabe17 100644 --- a/vertex.go +++ b/vertex.go @@ -23,11 +23,16 @@ type Vertex struct { importance int } -// Importance Returns importance (in term of contraction hierarchies) of vertex +// Importance Returns importance (in terms of contraction hierarchies) of vertex func (vertex *Vertex) Importance() int { return vertex.importance } +// OrderPos Returns order position (in terms of contraction hierarchies) of vertex +func (vertex *Vertex) OrderPos() int { + return vertex.orderPos +} + // MakeVertex Create vertex with label func MakeVertex(label int64) *Vertex { return &Vertex{ From dd93bfcabe54e9664f51d4cb4298e73cf9a967d7 Mon Sep 17 00:00:00 2001 From: Dimitrii Lopanov Date: Sat, 20 Feb 2021 12:19:27 +0300 Subject: [PATCH 3/4] fmt --- vertex.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vertex.go b/vertex.go index 2fabe17..4ce1602 100644 --- a/vertex.go +++ b/vertex.go @@ -23,16 +23,16 @@ type Vertex struct { importance int } -// Importance Returns importance (in terms of contraction hierarchies) of vertex -func (vertex *Vertex) Importance() int { - return vertex.importance -} - // OrderPos Returns order position (in terms of contraction hierarchies) of vertex func (vertex *Vertex) OrderPos() int { return vertex.orderPos } +// Importance Returns importance (in terms of contraction hierarchies) of vertex +func (vertex *Vertex) Importance() int { + return vertex.importance +} + // MakeVertex Create vertex with label func MakeVertex(label int64) *Vertex { return &Vertex{ From 6a80304bb65dccb0625b76a8532a1028bf1b9b61 Mon Sep 17 00:00:00 2001 From: Dimitrii Lopanov Date: Sat, 20 Feb 2021 12:22:39 +0300 Subject: [PATCH 4/4] setters --- vertex.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vertex.go b/vertex.go index 4ce1602..7897d75 100644 --- a/vertex.go +++ b/vertex.go @@ -28,11 +28,21 @@ func (vertex *Vertex) OrderPos() int { return vertex.orderPos } +// SetOrderPos Sets order position (in terms of contraction hierarchies) for vertex +func (vertex *Vertex) SetOrderPos(orderPos int) { + vertex.orderPos = orderPos +} + // Importance Returns importance (in terms of contraction hierarchies) of vertex func (vertex *Vertex) Importance() int { return vertex.importance } +// SetImportance Sets order position (in terms of contraction hierarchies) for vertex +func (vertex *Vertex) SetImportance(importance int) { + vertex.importance = importance +} + // MakeVertex Create vertex with label func MakeVertex(label int64) *Vertex { return &Vertex{