Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for Swap (0.18 sec)

  1. guava-tests/test/com/google/common/math/QuantilesAlgorithm.java

              swap(array, from, to);
            }
            if (array[from + 1] > array[to]) {
              swap(array, from + 1, to);
            }
            if (array[from] > array[from + 1]) {
              swap(array, from, from + 1);
            }
    
            // Perform a partition with the selected median.
            int low = from + 1, high = to; // Indexes for partitioning.
            double partition = array[from + 1]; // Choose partitioning element.
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 01 16:30:37 GMT 2022
    - 7.1K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/math/QuantilesAlgorithm.java

              swap(array, from, to);
            }
            if (array[from + 1] > array[to]) {
              swap(array, from + 1, to);
            }
            if (array[from] > array[from + 1]) {
              swap(array, from, from + 1);
            }
    
            // Perform a partition with the selected median.
            int low = from + 1, high = to; // Indexes for partitioning.
            double partition = array[from + 1]; // Choose partitioning element.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 01 16:30:37 GMT 2022
    - 7.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/math/Quantiles.java

        for (int i = to; i > from; i--) {
          if (array[i] > pivot) {
            swap(array, partitionPoint, i);
            partitionPoint--;
          }
        }
    
        // We now know that all elements with indexes in (from, partitionPoint] are less than or equal
        // to the pivot at from, and all elements with indexes in (partitionPoint, to] are greater than
        // it. We swap the pivot into partitionPoint and we know the array is partitioned around that.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri May 12 17:02:53 GMT 2023
    - 29.9K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java

        },
        ALMOST_SORTED {
          @Override
          void arrange(List<Integer> list) {
            Collections.sort(list);
            if (list.size() > 1) {
              int i = (list.size() - 1) / 2;
              Collections.swap(list, i, i + 1);
            }
          }
        },
        RANDOM {
          @Override
          void arrange(List<Integer> list) {}
        };
    
        abstract void arrange(List<Integer> list);
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/FakeTimeLimiter.java

     * desirable to use in some unit tests. More importantly, attempting to debug a call which is
     * time-limited would be extremely annoying, so this gives you a time-limiter you can easily swap in
     * for your real time-limiter while you're debugging.
     *
     * @author Kevin Bourrillion
     * @author Jens Nyman
     * @since 1.0
     */
    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 14 20:35:03 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  6. guava-tests/benchmark/com/google/common/collect/SortedCopyBenchmark.java

        },
        ALMOST_SORTED {
          @Override
          void arrange(List<Integer> list) {
            Collections.sort(list);
            if (list.size() > 1) {
              int i = (list.size() - 1) / 2;
              Collections.swap(list, i, i + 1);
            }
          }
        },
        RANDOM {
          @Override
          void arrange(List<Integer> list) {}
        };
    
        abstract void arrange(List<Integer> list);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/primitives/Ints.java

        //     [abc]de|[fgh] -> [fgh]de|[abc]. Now [fgh] is in the right place, but we need to swap [de]
        //     with [abc]: fgh[de]|a[bc] -> fgh[bc]|a[de]. Now we need to swap [a] with [bc]:
        //     fgh[b]c|[a]de -> fgh[a]c|[b]de. Finally we need to swap [c] with [b]:
        //     fgha[c]|[b]de -> fgha[b]|[c]de. Because these two blocks are the same size, we are done.
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 29.7K bytes
    - Viewed (0)
  8. guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java

          RunnableExecutorPair(Runnable runnable, Executor executor) {
            this.runnable = runnable;
            this.executor = executor;
          }
        }
      }
    
      // A version of the list that uses compare and swap to manage the stack without locks.
      private static final class ExecutionListCAS {
        static final Logger log = Logger.getLogger(ExecutionListCAS.class.getName());
    
        private static final sun.misc.Unsafe UNSAFE;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 15:19:38 GMT 2023
    - 20.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/Collections2.java

           * requireNonNull is safe because we don't clear nextPermutation until we're done calling this
           * method.
           */
          requireNonNull(nextPermutation);
    
          int l = findNextL(j);
          Collections.swap(nextPermutation, j, l);
          int n = nextPermutation.size();
          Collections.reverse(nextPermutation.subList(j + 1, n));
        }
    
        int findNextJ() {
          /*
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 22.8K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/TopKSelector.java

          if (comparator.compare(uncheckedCastNullableTToT(buffer[i]), pivotValue) < 0) {
            swap(pivotNewIndex, i);
            pivotNewIndex++;
          }
        }
        buffer[right] = buffer[pivotNewIndex];
        buffer[pivotNewIndex] = pivotValue;
        return pivotNewIndex;
      }
    
      private void swap(int i, int j) {
        T tmp = buffer[i];
        buffer[i] = buffer[j];
        buffer[j] = tmp;
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 11.2K bytes
    - Viewed (0)
Back to top