mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-13 23:03:57 +01:00
feat(modules): migrate to go modules and bump go version 1.14.4
- migrate to go module - bump go version 1.14.4 Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
This commit is contained in:
parent
f5ae3ff476
commit
fa76b346a0
837 changed files with 104140 additions and 158314 deletions
72
vendor/gonum.org/v1/gonum/graph/simple/simple.go
generated
vendored
Normal file
72
vendor/gonum.org/v1/gonum/graph/simple/simple.go
generated
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
// Copyright ©2014 The Gonum Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package simple
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"gonum.org/v1/gonum/graph"
|
||||
)
|
||||
|
||||
// Node is a simple graph node.
|
||||
type Node int64
|
||||
|
||||
// ID returns the ID number of the node.
|
||||
func (n Node) ID() int64 {
|
||||
return int64(n)
|
||||
}
|
||||
|
||||
func newSimpleNode(id int) graph.Node {
|
||||
return Node(id)
|
||||
}
|
||||
|
||||
// Edge is a simple graph edge.
|
||||
type Edge struct {
|
||||
F, T graph.Node
|
||||
}
|
||||
|
||||
// From returns the from-node of the edge.
|
||||
func (e Edge) From() graph.Node { return e.F }
|
||||
|
||||
// To returns the to-node of the edge.
|
||||
func (e Edge) To() graph.Node { return e.T }
|
||||
|
||||
// ReversedLine returns a new Edge with the F and T fields
|
||||
// swapped.
|
||||
func (e Edge) ReversedEdge() graph.Edge { return Edge{F: e.T, T: e.F} }
|
||||
|
||||
// WeightedEdge is a simple weighted graph edge.
|
||||
type WeightedEdge struct {
|
||||
F, T graph.Node
|
||||
W float64
|
||||
}
|
||||
|
||||
// From returns the from-node of the edge.
|
||||
func (e WeightedEdge) From() graph.Node { return e.F }
|
||||
|
||||
// To returns the to-node of the edge.
|
||||
func (e WeightedEdge) To() graph.Node { return e.T }
|
||||
|
||||
// ReversedLine returns a new Edge with the F and T fields
|
||||
// swapped. The weight of the new Edge is the same as
|
||||
// the weight of the receiver.
|
||||
func (e WeightedEdge) ReversedEdge() graph.Edge { return WeightedEdge{F: e.T, T: e.F, W: e.W} }
|
||||
|
||||
// Weight returns the weight of the edge.
|
||||
func (e WeightedEdge) Weight() float64 { return e.W }
|
||||
|
||||
// isSame returns whether two float64 values are the same where NaN values
|
||||
// are equalable.
|
||||
func isSame(a, b float64) bool {
|
||||
return a == b || (math.IsNaN(a) && math.IsNaN(b))
|
||||
}
|
||||
|
||||
type edgeSetter interface {
|
||||
SetEdge(e graph.Edge)
|
||||
}
|
||||
|
||||
type weightedEdgeSetter interface {
|
||||
SetWeightedEdge(e graph.WeightedEdge)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue