Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for shuffled (0.22 sec)

  1. cmd/erasure-metadata-utils.go

    	return shuffledPartsMetadata
    }
    
    // shuffleDisks - shuffle input disks slice depending on the
    // erasure distribution. Return shuffled slice of disks with
    // their expected distribution.
    func shuffleDisks(disks []StorageAPI, distribution []int) (shuffledDisks []StorageAPI) {
    	if distribution == nil {
    		return disks
    	}
    	shuffledDisks = make([]StorageAPI, len(disks))
    	// Shuffle disks for expected distribution.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  2. src/compress/bzip2/bzip2.go

    // first pass over the data. It's an argument here because we merge the first
    // pass with the Huffman decoding.
    //
    // This also implements the “single array” method from the bzip2 source code
    // which leaves the output, still shuffled, in the bottom 8 bits of tt with the
    // index of the next byte in the top 24-bits. The index of the first byte is
    // returned.
    func inverseBWT(tt []uint32, origPtr uint, c []uint) uint32 {
    	sum := uint(0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 13:32:40 UTC 2024
    - 13K bytes
    - Viewed (0)
  3. src/cmd/internal/obj/sym.go

    		// symbols reliably. Sort by name but use a stable sort, so that
    		// any original entries with the same name (all DWARFVAR symbols
    		// have empty names but different relocation sets) are not shuffled.
    		// TODO: Find a better place and optimize to only sort TOC symbols.
    		sort.SliceStable(ctxt.Data, func(i, j int) bool {
    			return ctxt.Data[i].Name < ctxt.Data[j].Name
    		})
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 14:41:10 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  4. src/math/rand/v2/rand.go

    	for i := range p {
    		p[i] = i
    	}
    	r.Shuffle(len(p), func(i, j int) { p[i], p[j] = p[j], p[i] })
    	return p
    }
    
    // Shuffle pseudo-randomizes the order of elements.
    // n is the number of elements. Shuffle panics if n < 0.
    // swap swaps the elements with indexes i and j.
    func (r *Rand) Shuffle(n int, swap func(i, j int)) {
    	if n < 0 {
    		panic("invalid argument to Shuffle")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 02:25:49 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  5. src/math/rand/rand.go

    		m[i] = m[j]
    		m[j] = i
    	}
    	return m
    }
    
    // Shuffle pseudo-randomizes the order of elements.
    // n is the number of elements. Shuffle panics if n < 0.
    // swap swaps the elements with indexes i and j.
    func (r *Rand) Shuffle(n int, swap func(i, j int)) {
    	if n < 0 {
    		panic("invalid argument to Shuffle")
    	}
    
    	// Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:09:08 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  6. src/math/rand/rand_test.go

    	if !bytes.Equal(b1, b2) {
    		t.Errorf("mismatch after re-seed:\n%x\n%x", b1, b2)
    	}
    }
    
    func TestShuffleSmall(t *testing.T) {
    	// Check that Shuffle allows n=0 and n=1, but that swap is never called for them.
    	r := New(NewSource(1))
    	for n := 0; n <= 1; n++ {
    		r.Shuffle(n, func(i, j int) { t.Fatalf("swap called, n=%d i=%d j=%d", n, i, j) })
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  7. src/math/rand/v2/rand_test.go

    			p := make([]int, n) // re-usable slice for Shuffle generator
    			tests := [...]struct {
    				name string
    				fn   func() int
    			}{
    				{name: "Int32N", fn: func() int { return int(r.Int32N(int32(nfact))) }},
    				{name: "Perm", fn: func() int { return encodePerm(r.Perm(n)) }},
    				{name: "Shuffle", fn: func() int {
    					// Generate permutation using Shuffle.
    					for i := range p {
    						p[i] = i
    					}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

                  return null;
                }
              });
        }
        assertEquals(allTasks.size() + 1, barrier.getParties());
        for (int i = 0; i < 1000; i++) {
          Collections.shuffle(allTasks);
          final AbstractFuture<String> future = new AbstractFuture<String>() {};
          currentFuture.set(future);
          for (Callable<?> task : allTasks) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 46.7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

                  return null;
                }
              });
        }
        assertEquals(allTasks.size() + 1, barrier.getParties());
        for (int i = 0; i < 1000; i++) {
          Collections.shuffle(allTasks);
          final AbstractFuture<String> future = new AbstractFuture<String>() {};
          currentFuture.set(future);
          for (Callable<?> task : allTasks) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 46.7K bytes
    - Viewed (0)
  10. cmd/global-heal.go

    		if len(disks) < er.setDriveCount/2 {
    			return fmt.Errorf("not enough drives (found=%d, healing=%d, total=%d) are available to heal `%s`", len(disks), healing, er.setDriveCount, tracker.disk.String())
    		}
    
    		rand.Shuffle(len(disks), func(i, j int) {
    			disks[i], disks[j] = disks[j], disks[i]
    		})
    
    		expectedDisks := len(disks)/2 + 1
    		fallbackDisks := disks[expectedDisks:]
    		disks = disks[:expectedDisks]
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 31 14:48:50 UTC 2024
    - 15.1K bytes
    - Viewed (0)
Back to top