aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/soniakeys/graph/bits64.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-04-17 13:11:19 +0200
committerPetter Rasmussen2016-04-17 13:11:19 +0200
commit97981f7fd205353907135eacfc0e0ade24b88269 (patch)
tree1fdb61a7138642a1612bb201434e8ebda141cc8a /vendor/github.com/soniakeys/graph/bits64.go
parent8de8e05c483c6b5f23b14742315f1860211dcef7 (diff)
parentb5eb2866cfceb69b0d4dd4948273d679a884fbb2 (diff)
downloadgdrive-97981f7fd205353907135eacfc0e0ade24b88269.tar.bz2
Merge pull request #140 from paulz/godep
add Go dependencies by godep
Diffstat (limited to 'vendor/github.com/soniakeys/graph/bits64.go')
-rw-r--r--vendor/github.com/soniakeys/graph/bits64.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/soniakeys/graph/bits64.go b/vendor/github.com/soniakeys/graph/bits64.go
new file mode 100644
index 0000000..ab601dd
--- /dev/null
+++ b/vendor/github.com/soniakeys/graph/bits64.go
@@ -0,0 +1,22 @@
+// Copyright 2014 Sonia Keys
+// License MIT: http://opensource.org/licenses/MIT
+
+// +build !386,!arm
+
+package graph
+
+const (
+ wordSize = 64
+ wordExp = 6 // 2^6 = 64
+)
+
+// reference: http://graphics.stanford.edu/~seander/bithacks.html
+const deBruijnMultiple = 0x03f79d71b4ca8b09
+const deBruijnShift = 58
+
+var deBruijnBits = []int{
+ 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4,
+ 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5,
+ 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11,
+ 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6,
+}