Home
last modified time | relevance | path

Searched refs:comparator (Results 1 – 25 of 343) sorted by relevance

12345678910>>...14

/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DImmutableSortedSet.java66 Comparator<? super E> comparator) { in emptySet() argument
67 checkNotNull(comparator); in emptySet()
68 if (NATURAL_ORDER.equals(comparator)) { in emptySet()
71 return new EmptyImmutableSortedSet<E>(comparator); in emptySet()
120 Comparator<? super E> comparator, E... elements) { in ofInternal() argument
124 return emptySet(comparator); in ofInternal()
126 SortedSet<E> delegate = new TreeSet<E>(comparator); in ofInternal()
153 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
154 checkNotNull(comparator); in copyOf()
155 return copyOfInternal(comparator, elements, false); in copyOf()
[all …]
DImmutableSortedMap.java57 private final transient Comparator<? super K> comparator; field in ImmutableSortedMap
59 ImmutableSortedMap(SortedMap<K, V> delegate, Comparator<? super K> comparator) { in ImmutableSortedMap() argument
61 this.comparator = comparator; in ImmutableSortedMap()
66 Comparator<? super K> comparator, in create() argument
68 checkNotNull(comparator); in create()
69 SortedMap<K, V> delegate = newModifiableDelegate(comparator); in create()
73 return newView(unmodifiableSortedMap(delegate), comparator); in create()
117 Map<? extends K, ? extends V> map, Comparator<? super K> comparator) { in copyOf() argument
118 return copyOfInternal(map, checkNotNull(comparator)); in copyOf()
126 Comparator<? super K> comparator = in copyOfSorted() local
[all …]
DTreeMultiset.java86 public static <E> TreeMultiset<E> create(@Nullable Comparator<? super E> comparator) { in create() argument
87 return (comparator == null) in create()
89 : new TreeMultiset<E>(comparator); in create()
112 super(range.comparator()); in TreeMultiset()
118 TreeMultiset(Comparator<? super E> comparator) { in TreeMultiset() argument
119 super(comparator); in TreeMultiset()
120 this.range = GeneralRange.all(comparator); in TreeMultiset()
173 int cmp = comparator().compare(range.getLowerEndpoint(), node.elem); in aggregateBelowRange()
195 int cmp = comparator().compare(range.getUpperEndpoint(), node.elem); in aggregateAboveRange()
232 return root.count(comparator(), e); in count()
[all …]
DEmptyImmutableSortedMap.java28 private EmptyImmutableSortedMap(Comparator<? super K> comparator) { in EmptyImmutableSortedMap() argument
29 super(new TreeMap<K, V>(comparator), comparator); in EmptyImmutableSortedMap()
36 static <K, V> ImmutableSortedMap<K, V> forComparator(Comparator<? super K> comparator) { in forComparator() argument
37 if (comparator == NATURAL_ORDER) { in forComparator()
40 return new EmptyImmutableSortedMap<K, V>(comparator); in forComparator()
/external/hamcrest/hamcrest-library/src/main/java/org/hamcrest/comparator/
DComparatorMatcherBuilder.java1 package org.hamcrest.comparator;
13 private final Comparator<T> comparator; field in ComparatorMatcherBuilder
39 public static <T> ComparatorMatcherBuilder<T> comparedBy(Comparator<T> comparator) {
40 return new ComparatorMatcherBuilder<T>(comparator, true);
43 …private ComparatorMatcherBuilder(Comparator<T> comparator, boolean includeComparatorInDescription)…
44 this.comparator = comparator;
53 private final Comparator<T> comparator;
65 …private ComparatorMatcher(Comparator<T> comparator, T expected, int minCompare, int maxCompare, bo…
66 this.comparator = comparator;
76 int compare = signum(comparator.compare(actual, expected));
[all …]
/external/guava/guava/src/com/google/common/collect/
DImmutableSortedSet.java109 Comparator<? super E> comparator) { in emptySet() argument
110 if (NATURAL_ORDER.equals(comparator)) { in emptySet()
113 return new EmptyImmutableSortedSet<E>(comparator); in emptySet()
325 Comparator<? super E> comparator, Iterator<? extends E> elements) { in copyOf() argument
326 return new Builder<E>(comparator).addAll(elements).build(); in copyOf()
343 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
344 checkNotNull(comparator); in copyOf()
346 SortedIterables.hasSameComparator(comparator, elements); in copyOf()
357 return construct(comparator, array.length, array); in copyOf()
379 Comparator<? super E> comparator, Collection<? extends E> elements) { in copyOf() argument
[all …]
DGeneralRange.java59 static <T> GeneralRange<T> all(Comparator<? super T> comparator) { in all() argument
60 return new GeneralRange<T>(comparator, false, null, OPEN, false, null, OPEN); in all()
67 static <T> GeneralRange<T> downTo(Comparator<? super T> comparator, @Nullable T endpoint, in downTo() argument
69 return new GeneralRange<T>(comparator, true, endpoint, boundType, false, null, OPEN); in downTo()
76 static <T> GeneralRange<T> upTo(Comparator<? super T> comparator, @Nullable T endpoint, in upTo() argument
78 return new GeneralRange<T>(comparator, false, null, OPEN, true, endpoint, boundType); in upTo()
85 static <T> GeneralRange<T> range(Comparator<? super T> comparator, @Nullable T lower, in range() argument
87 return new GeneralRange<T>(comparator, true, lower, lowerType, true, upper, upperType); in range()
90 private final Comparator<? super T> comparator; field in GeneralRange
100 private GeneralRange(Comparator<? super T> comparator, boolean hasLowerBound, in GeneralRange() argument
[all …]
DImmutableSortedMap.java70 static <K, V> ImmutableSortedMap<K, V> emptyMap(Comparator<? super K> comparator) { in emptyMap() argument
71 if (Ordering.natural().equals(comparator)) { in emptyMap()
74 return new EmptyImmutableSortedMap<K, V>(comparator); in emptyMap()
79 Comparator<? super K> comparator, in fromSortedEntries() argument
83 return emptyMap(comparator); in fromSortedEntries()
95 new RegularImmutableSortedSet<K>(keyBuilder.build(), comparator), in fromSortedEntries()
102 return emptyMap(keySet.comparator()); in from()
222 Map<? extends K, ? extends V> map, Comparator<? super K> comparator) { in copyOf() argument
223 return copyOfInternal(map, checkNotNull(comparator)); in copyOf()
239 Comparator<? super K> comparator = map.comparator(); in copyOfSorted() local
[all …]
DImmutableSortedMultiset.java237 Comparator<? super E> comparator, Iterator<? extends E> elements) { in copyOf() argument
238 checkNotNull(comparator); in copyOf()
239 return new Builder<E>(comparator).addAll(elements).build(); in copyOf()
253 Comparator<? super E> comparator, Iterable<? extends E> elements) { in copyOf() argument
257 if (comparator.equals(multiset.comparator())) { in copyOf()
259 return copyOfSortedEntries(comparator, multiset.entrySet().asList()); in copyOf()
266 TreeMultiset<E> sortedCopy = TreeMultiset.create(checkNotNull(comparator)); in copyOf()
268 return copyOfSortedEntries(comparator, sortedCopy.entrySet()); in copyOf()
286 return copyOfSortedEntries(sortedMultiset.comparator(), in copyOfSorted()
291 Comparator<? super E> comparator, Collection<Entry<E>> entries) { in copyOfSortedEntries() argument
[all …]
DTreeMultiset.java90 public static <E> TreeMultiset<E> create(@Nullable Comparator<? super E> comparator) { in create() argument
91 return (comparator == null) in create()
93 : new TreeMultiset<E>(comparator); in create()
116 super(range.comparator()); in TreeMultiset()
122 TreeMultiset(Comparator<? super E> comparator) { in TreeMultiset() argument
123 super(comparator); in TreeMultiset()
124 this.range = GeneralRange.all(comparator); in TreeMultiset()
177 int cmp = comparator().compare(range.getLowerEndpoint(), node.elem); in aggregateBelowRange()
199 int cmp = comparator().compare(range.getUpperEndpoint(), node.elem); in aggregateAboveRange()
236 return root.count(comparator(), e); in count()
[all …]
DComparatorOrdering.java31 final Comparator<T> comparator; field in ComparatorOrdering
33 ComparatorOrdering(Comparator<T> comparator) { in ComparatorOrdering() argument
34 this.comparator = checkNotNull(comparator); in ComparatorOrdering()
38 return comparator.compare(a, b); in compare()
47 return this.comparator.equals(that.comparator); in equals()
53 return comparator.hashCode(); in hashCode()
57 return comparator.toString(); in toString()
DSortedLists.java56 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
66 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
74 int c = comparator.compare(list.get(middle), key); in resultIndex()
90 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
99 int c = comparator.compare(list.get(middle), key); in resultIndex()
116 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
117 return LAST_PRESENT.resultIndex(comparator, key, list, foundIndex) + 1; in resultIndex()
127 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex) { in resultIndex() argument
128 return FIRST_PRESENT.resultIndex(comparator, key, list, foundIndex) - 1; in resultIndex()
132 Comparator<? super E> comparator, E key, List<? extends E> list, int foundIndex); in resultIndex() argument
[all …]
DSortedIterables.java37 public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) { in hasSameComparator() argument
38 checkNotNull(comparator); in hasSameComparator()
42 comparator2 = comparator((SortedSet<?>) elements); in hasSameComparator()
44 comparator2 = ((SortedIterable<?>) elements).comparator(); in hasSameComparator()
48 return comparator.equals(comparator2); in hasSameComparator()
53 public static <E> Comparator<? super E> comparator(SortedSet<E> sortedSet) { in comparator() method in SortedIterables
54 Comparator<? super E> result = sortedSet.comparator(); in comparator()
/external/apache-commons-math/src/main/java/org/apache/commons/math/optimization/direct/
DNelderMead.java74 protected void iterateSimplex(final Comparator<RealPointValuePair> comparator) in iterateSimplex() argument
109 if ((comparator.compare(best, reflected) <= 0) && in iterateSimplex()
110 (comparator.compare(reflected, secondBest) < 0)) { in iterateSimplex()
113 replaceWorstPoint(reflected, comparator); in iterateSimplex()
115 } else if (comparator.compare(reflected, best) < 0) { in iterateSimplex()
124 if (comparator.compare(expanded, reflected) < 0) { in iterateSimplex()
126 replaceWorstPoint(expanded, comparator); in iterateSimplex()
129 replaceWorstPoint(reflected, comparator); in iterateSimplex()
134 if (comparator.compare(reflected, worst) < 0) { in iterateSimplex()
143 if (comparator.compare(outContracted, reflected) <= 0) { in iterateSimplex()
[all …]
DMultiDirectional.java61 protected void iterateSimplex(final Comparator<RealPointValuePair> comparator) in iterateSimplex() argument
74 final RealPointValuePair reflected = evaluateNewSimplex(original, 1.0, comparator); in iterateSimplex()
75 if (comparator.compare(reflected, best) < 0) { in iterateSimplex()
79 final RealPointValuePair expanded = evaluateNewSimplex(original, khi, comparator); in iterateSimplex()
80 if (comparator.compare(reflected, expanded) <= 0) { in iterateSimplex()
90 final RealPointValuePair contracted = evaluateNewSimplex(original, gamma, comparator); in iterateSimplex()
91 if (comparator.compare(contracted, best) < 0) { in iterateSimplex()
120 final Comparator<RealPointValuePair> comparator) in evaluateNewSimplex() argument
139 evaluateSimplex(comparator); in evaluateNewSimplex()
/external/replicaisland/src/com/replica/replicaisland/
DQuickSorter.java22 public void sort(Type[] array, int count, Comparator<Type> comparator) { in sort() argument
23 quicksort(array, 0, count - 1, comparator); in sort()
45 public void quicksort(Type[] a, int left, int right, Comparator<Type> comparator) { in quicksort() argument
47 int i = partition(a, left, right, comparator); in quicksort()
48 quicksort(a, left, i - 1, comparator); in quicksort()
49 quicksort(a, i + 1, right, comparator); in quicksort()
53 private int partition(Type[] a, int left, int right, Comparator<Type> comparator) { in partition() argument
57 while (comparator.compare(a[++i], a[right]) < 0) { // find item on left to swap in partition()
59 while (comparator.compare(a[right], a[--j]) < 0) { // find item on right to swap in partition()
/external/catch2/include/internal/
Dcatch_matchers_vector.h44 ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {} in ContainsElementMatcher()
65 ContainsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {} in ContainsMatcher()
71 for (auto const& comparator : m_comparator) { in match()
74 if (el == comparator) { in match()
95 EqualsMatcher(std::vector<T> const &comparator) : m_comparator( comparator ) {} in EqualsMatcher()
161 Vector::ContainsMatcher<T> Contains( std::vector<T> const& comparator ) { in Contains() argument
162 return Vector::ContainsMatcher<T>( comparator ); in Contains()
166 Vector::ContainsElementMatcher<T> VectorContains( T const& comparator ) { in VectorContains() argument
167 return Vector::ContainsElementMatcher<T>( comparator ); in VectorContains()
171 Vector::EqualsMatcher<T> Equals( std::vector<T> const& comparator ) { in Equals() argument
[all …]
Dcatch_matchers_string.cpp36 …StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator ) in StringMatcherBase() argument
37 : m_comparator( comparator ), in StringMatcherBase()
53 …EqualsMatcher::EqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", compa… in EqualsMatcher() argument
60 …insMatcher::ContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comp… in ContainsMatcher() argument
67 …Matcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with", co… in StartsWithMatcher() argument
74 …ithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with", com… in EndsWithMatcher() argument
/external/tensorflow/tensorflow/compiler/xla/service/
Dstable_sort_expander.cc79 auto comparator = sort->to_apply(); in ExpandInstruction() local
94 comparator->CloneWithReplacements(std::move(replacements), in ExpandInstruction()
130 auto comparator = sort->to_apply(); in ExpandInstruction() local
132 comparator->MakeInstructionPostOrder(); in ExpandInstruction()
143 HloInstruction* old_root = comparator->root_instruction(); in ExpandInstruction()
158 for (int64 i = 0; i < comparator->num_parameters(); ++i) { in ExpandInstruction()
159 replacements[comparator->parameter_instruction(i)] = in ExpandInstruction()
160 comparator->parameter_instruction(i ^ 1); in ExpandInstruction()
178 comparator->AddInstruction(std::move(new_instruction)); in ExpandInstruction()
183 comparator->AddInstruction(HloInstruction::CreateCompare( in ExpandInstruction()
[all …]
/external/guava/guava-tests/benchmark/com/google/common/collect/
DMinMaxPriorityQueueBenchmark.java39 @Param private ComparatorType comparator; field in MinMaxPriorityQueueBenchmark
52 queue = heap.create(comparator.get()); in setUp()
82 public InvertedMinMaxPriorityQueue(Comparator<T> comparator) { in InvertedMinMaxPriorityQueue() argument
83 mmHeap = MinMaxPriorityQueue.orderedBy(comparator).create(); in InvertedMinMaxPriorityQueue()
100 @Override public Queue<Integer> create(Comparator<Integer> comparator) { in create() argument
101 return MinMaxPriorityQueue.orderedBy(comparator).create(); in create()
105 @Override public Queue<Integer> create(Comparator<Integer> comparator) { in create() argument
106 return new PriorityQueue<Integer>(11, comparator); in create()
110 @Override public Queue<Integer> create(Comparator<Integer> comparator) { in create() argument
111 return new InvertedMinMaxPriorityQueue<Integer>(comparator); in create()
[all …]
/external/icu/android_icu4j/src/main/java/android/icu/impl/
DIterableComparator.java21 private final Comparator<T> comparator; field in IterableComparator
28 public IterableComparator(Comparator<T> comparator) { in IterableComparator() argument
29 this(comparator, true); in IterableComparator()
32 public IterableComparator(Comparator<T> comparator, boolean shorterFirst) { in IterableComparator() argument
33 this.comparator = comparator; in IterableComparator()
56 …int result = comparator != null ? comparator.compare(aItem, bItem) : ((Comparable<T>)aItem).compar… in compare()
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/
DIterableComparator.java19 private final Comparator<T> comparator; field in IterableComparator
26 public IterableComparator(Comparator<T> comparator) { in IterableComparator() argument
27 this(comparator, true); in IterableComparator()
30 public IterableComparator(Comparator<T> comparator, boolean shorterFirst) { in IterableComparator() argument
31 this.comparator = comparator; in IterableComparator()
54 …int result = comparator != null ? comparator.compare(aItem, bItem) : ((Comparable<T>)aItem).compar… in compare()
/external/smali/util/src/main/java/org/jf/util/
DCollectionUtils.java75 public static <T> int compareAsIterable(@Nonnull Comparator<? super T> comparator, in compareAsIterable() argument
86 int res = comparator.compare(element1, element2); in compareAsIterable()
141 Comparator<?> comparator = sortedSet.comparator();
142 return (comparator == null) || comparator.equals(Ordering.natural());
151 Comparator<?> comparator = sortedSet.comparator();
152 if (comparator == null) {
155 return elementComparator.equals(comparator);
173 Comparator<?> comparator = sortedSet.comparator();
174 if (comparator != null && comparator.equals(elementComparator)) {
DArraySortedSet.java40 @Nonnull private final Comparator<? super T> comparator; field in ArraySortedSet
43 private ArraySortedSet(@Nonnull Comparator<? super T> comparator, @Nonnull T[] arr) { in ArraySortedSet() argument
45 this.comparator = comparator; in ArraySortedSet()
49 …public static <T> ArraySortedSet<T> of(@Nonnull Comparator<? super T> comparator, @Nonnull T[] arr… in of() argument
50 return new ArraySortedSet<T>(comparator, arr); in of()
66 return Arrays.binarySearch((T[])arr, (T)o, comparator) >= 0; in contains()
131 public Comparator<? super T> comparator() { in comparator() method in ArraySortedSet
132 return comparator; in comparator()
/external/easymock/src/org/easymock/internal/matchers/
DCompare.java30 private Comparator<? super T> comparator; field in Compare
34 public Compare(T expected, Comparator<? super T> comparator, LogicalOperator result) { in Compare() argument
36 this.comparator = comparator; in Compare()
41 buffer.append(comparator + "(" + expected + ") " + operator.getSymbol() in appendTo()
50 return operator.matchResult(comparator.compare((T) actual, expected)); in matches()

12345678910>>...14