- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for nextPowerOfTwo (0.4 sec)
-
guava/src/com/google/common/math/BigIntegerMath.java
// Check for the next power of two boundary, to save us a CLZ operation. int nextPowerOfTwo = 1 << (bits - 1); // Iteratively multiply the longs as big as they can go. for (long num = startingNumber; num <= n; num++) { // Check to see if the floor(log2(num)) + 1 has changed. if ((num & nextPowerOfTwo) != 0) { nextPowerOfTwo <<= 1; bits++; } // Get rid of the 2s in num.
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 18.9K bytes - Viewed (0) -
android/guava/src/com/google/common/math/BigIntegerMath.java
// Check for the next power of two boundary, to save us a CLZ operation. int nextPowerOfTwo = 1 << (bits - 1); // Iteratively multiply the longs as big as they can go. for (long num = startingNumber; num <= n; num++) { // Check to see if the floor(log2(num)) + 1 has changed. if ((num & nextPowerOfTwo) != 0) { nextPowerOfTwo <<= 1; bits++; } // Get rid of the 2s in num.
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Feb 07 17:50:39 UTC 2024 - 18.9K bytes - Viewed (0) -
src/slices/sort.go
type xorshift uint64 func (r *xorshift) Next() uint64 { *r ^= *r << 13 *r ^= *r >> 17 *r ^= *r << 5 return uint64(*r) } func nextPowerOfTwo(length int) uint { return 1 << bits.Len(uint(length)) } // isNaN reports whether x is a NaN without requiring the math package. // This will always return false if T is not floating-point.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 07 23:54:41 UTC 2024 - 5.8K bytes - Viewed (0) -
src/sort/sort.go
type xorshift uint64 func (r *xorshift) Next() uint64 { *r ^= *r << 13 *r ^= *r >> 17 *r ^= *r << 5 return uint64(*r) } func nextPowerOfTwo(length int) uint { shift := uint(bits.Len(uint(length))) return uint(1 << shift) } // lessSwap is a pair of Less and Swap function for use with the // auto-generated func-optimized variant of sort.go in
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 28 16:40:32 UTC 2023 - 10.1K bytes - Viewed (0) -
src/sort/zsortinterface.go
// that might cause imbalanced partitions in quicksort. func breakPatterns(data Interface, a, b int) { length := b - a if length >= 8 { random := xorshift(length) modulus := nextPowerOfTwo(length) for idx := a + (length/4)*2 - 1; idx <= a+(length/4)*2+1; idx++ { other := int(uint(random.Next()) & (modulus - 1)) if other >= length { other -= length } data.Swap(idx, a+other)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 13 20:16:24 UTC 2022 - 11.2K bytes - Viewed (0) -
src/sort/zsortfunc.go
// that might cause imbalanced partitions in quicksort. func breakPatterns_func(data lessSwap, a, b int) { length := b - a if length >= 8 { random := xorshift(length) modulus := nextPowerOfTwo(length) for idx := a + (length/4)*2 - 1; idx <= a+(length/4)*2+1; idx++ { other := int(uint(random.Next()) & (modulus - 1)) if other >= length { other -= length } data.Swap(idx, a+other)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 13 20:16:24 UTC 2022 - 11.5K bytes - Viewed (0) -
src/slices/zsortanyfunc.go
// that might cause imbalanced partitions in quicksort. func breakPatternsCmpFunc[E any](data []E, a, b int, cmp func(a, b E) int) { length := b - a if length >= 8 { random := xorshift(length) modulus := nextPowerOfTwo(length) for idx := a + (length/4)*2 - 1; idx <= a+(length/4)*2+1; idx++ { other := int(uint(random.Next()) & (modulus - 1)) if other >= length { other -= length }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 23 23:33:29 UTC 2023 - 12.8K bytes - Viewed (0) -
src/slices/zsortordered.go
// that might cause imbalanced partitions in quicksort. func breakPatternsOrdered[E cmp.Ordered](data []E, a, b int) { length := b - a if length >= 8 { random := xorshift(length) modulus := nextPowerOfTwo(length) for idx := a + (length/4)*2 - 1; idx <= a+(length/4)*2+1; idx++ { other := int(uint(random.Next()) & (modulus - 1)) if other >= length { other -= length }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 23 23:33:29 UTC 2023 - 12.4K bytes - Viewed (0) -
src/sort/gen_sort_variants.go
func breakPatterns{{.FuncSuffix}}{{.TypeParam}}(data {{.DataType}}, a, b int {{.ExtraParam}}) { length := b - a if length >= 8 { random := xorshift(length) modulus := nextPowerOfTwo(length) for idx := a + (length/4)*2 - 1; idx <= a + (length/4)*2 + 1; idx++ { other := int(uint(random.Next()) & (modulus - 1)) if other >= length { other -= length }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:27 UTC 2023 - 19.6K bytes - Viewed (0)