diff options
| author | Paul Zabelin | 2016-04-17 03:22:31 -0700 |
|---|---|---|
| committer | Paul Zabelin | 2016-04-17 03:22:31 -0700 |
| commit | b5eb2866cfceb69b0d4dd4948273d679a884fbb2 (patch) | |
| tree | 1fdb61a7138642a1612bb201434e8ebda141cc8a /vendor/github.com/soniakeys/graph/bits32.go | |
| parent | 8de8e05c483c6b5f23b14742315f1860211dcef7 (diff) | |
| download | gdrive-b5eb2866cfceb69b0d4dd4948273d679a884fbb2.tar.bz2 | |
add Go dependencies by godep
see https://github.com/tools/godep
Diffstat (limited to 'vendor/github.com/soniakeys/graph/bits32.go')
| -rw-r--r-- | vendor/github.com/soniakeys/graph/bits32.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/soniakeys/graph/bits32.go b/vendor/github.com/soniakeys/graph/bits32.go new file mode 100644 index 0000000..18e07f9 --- /dev/null +++ b/vendor/github.com/soniakeys/graph/bits32.go @@ -0,0 +1,23 @@ +// Copyright 2014 Sonia Keys +// License MIT: http://opensource.org/licenses/MIT + +// +build 386 arm + +package graph + +// "word" here is math/big.Word +const ( + wordSize = 32 + wordExp = 5 // 2^5 = 32 +) + +// deBruijn magic numbers used in trailingZeros() +// +// reference: http://graphics.stanford.edu/~seander/bithacks.html +const deBruijnMultiple = 0x077CB531 +const deBruijnShift = 27 + +var deBruijnBits = []int{ + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9, +} |
