Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for countBits (0.17 sec)

  1. pkg/registry/core/service/allocator/utils.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package allocator
    
    import (
    	"math/big"
    	"math/bits"
    )
    
    // countBits returns the number of set bits in n
    func countBits(n *big.Int) int {
    	var count int = 0
    	for _, w := range n.Bits() {
    		count += bits.OnesCount64(uint64(w))
    	}
    	return count
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 01 15:09:56 UTC 2021
    - 816 bytes
    - Viewed (0)
  2. pkg/registry/core/service/allocator/utils_test.go

    		n        *big.Int
    		expected int
    	}{
    		{n: big.NewInt(int64(0)), expected: 0},
    		{n: big.NewInt(int64(0xffffffffff)), expected: 40},
    		{n: bigN, expected: 1},
    	}
    	for _, test := range tests {
    		actual := countBits(test.n)
    		if test.expected != actual {
    			t.Errorf("%s should have %d bits but recorded as %d", test.n, test.expected, actual)
    		}
    	}
    }
    
    func BenchmarkCountBits(b *testing.B) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 01 15:08:36 UTC 2021
    - 1.5K bytes
    - Viewed (0)
  3. src/internal/fuzz/coverage.go

    // also set in base.
    func hasCoverageBit(base, snapshot []byte) bool {
    	for i := range snapshot {
    		if snapshot[i]&base[i] != 0 {
    			return true
    		}
    	}
    	return false
    }
    
    func countBits(cov []byte) int {
    	n := 0
    	for _, c := range cov {
    		n += bits.OnesCount8(c)
    	}
    	return n
    }
    
    var (
    	coverageEnabled  = len(coverage()) > 0
    	coverageSnapshot = make([]byte, len(coverage()))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. pkg/registry/core/service/allocator/bitmap.go

    	r.lock.Lock()
    	defer r.lock.Unlock()
    
    	if r.rangeSpec != rangeSpec {
    		return errors.New("the provided range does not match the current range")
    	}
    
    	r.allocated = big.NewInt(0).SetBytes(data)
    	r.count = countBits(r.allocated)
    
    	return nil
    }
    
    // Destroy cleans up everything on shutdown.
    func (r *AllocationBitmap) Destroy() {
    }
    
    // randomScanStrategy chooses a random address from the provided big.Int, and then
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  5. src/internal/fuzz/fuzz.go

    								result.entry.Path,
    								result.entry.Parent,
    								result.entry.Generation,
    								countBits(keepCoverage),
    								countBits(c.coverageMask),
    								inputSize,
    								result.entryDuration,
    							)
    						}
    					}
    				} else {
    					if shouldPrintDebugInfo() {
    						c.debugLogf(
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  6. tests/error_translator_test.go

    		return
    	}
    
    	DB.Migrator().DropTable(&City{}, &Museum{})
    
    	if err = db.AutoMigrate(&City{}, &Museum{}); err != nil {
    		t.Fatalf("failed to migrate countries & cities tables, got error: %v", err)
    	}
    
    	city := City{Name: "Amsterdam"}
    
    	err = db.Create(&city).Error
    	if err != nil {
    		t.Fatalf("failed to create city: %v", err)
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jul 12 13:21:22 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  7. apache-maven/src/main/appended-resources/licenses/CDDL+GPLv2-with-classpath-exception.txt

    8. If the distribution and/or use of the Program is restricted in
    certain countries either by patents or by copyrighted interfaces, the
    original copyright holder who places the Program under this License may
    add an explicit geographical distribution limitation excluding those
    countries, so that distribution is permitted only in or among countries
    not thus excluded. In such case, this License incorporates the
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Fri May 17 19:14:22 UTC 2024
    - 38.5K bytes
    - Viewed (0)
  8. tensorflow/c/eager/tape.h

          continue;
        }
        CHECK(result.op_tape.emplace(op_id, op_it->second).second);
        for (auto it : op_it->second.input_tensor_id) {
          auto count_it = result.tensor_usage_counts.find(it);
          if (count_it != result.tensor_usage_counts.end()) {
            count_it->second++;
          } else {
            result.tensor_usage_counts[it] = 1;
            if (tensor_tape.find(it) != tensor_tape.end()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Apr 02 12:40:29 UTC 2024
    - 47.2K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/text/language/language.go

    // IsPrivateUse reports whether this script code is reserved for private use.
    func (s Script) IsPrivateUse() bool {
    	return s.scriptID.IsPrivateUse()
    }
    
    // Region is an ISO 3166-1 or UN M.49 code for representing countries and regions.
    type Region struct {
    	regionID language.Region
    }
    
    // EncodeM49 returns the Region for the given UN M.49 code.
    // It returns an error if r is not a valid code.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 24 13:01:26 UTC 2024
    - 18.9K bytes
    - Viewed (0)
  10. CREDITS

    infringement under applicable copyright law, except executing it on a
    computer or modifying a private copy.  Propagation includes copying,
    distribution (with or without modification), making available to the
    public, and in some countries other activities as well.
    
      To "convey" a work means any kind of propagation that enables other
    parties to make or receive copies.  Mere interaction with a user through
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jun 13 15:34:20 UTC 2024
    - 1.7M bytes
    - Viewed (0)
Back to top