Calculate the closest match of the given base float with the list of others.<p>

@param base the base float to compare the other with
@param others the list of floats to compate to the base

@return the array index of the closest match
544236
private int calculateClosest(float base, float[] others) {

        int result = -1;
        float bestMatch = Float.MAX_VALUE;
        for (int count = 0; count < others.length; count++) {
            float difference = Math.abs(base - others[count]);
            if (difference < bestMatch) {
                // new best match found
                bestMatch = difference;
                result = count;
            }
            if (bestMatch == 0f) {
                // it does not get better then this
                break;
            }
        }
        return result;
    }
900460
@Override
  public int compareTo(Object other) {
    if (other == null) {
      return -1;
    }
    TaskKey otherKey = (TaskKey) other;
    return new CompareToBuilder().appendSuper(super.compareTo(otherKey))
        .append(this.taskId, otherKey.getTaskId())
        .toComparison();
  }
854296
public int compareTo (ComparableTuple<L, R> other)
    {
        int rv = ObjectUtil.compareTo(left, other.left);
        return (rv != 0) ? rv : ObjectUtil.compareTo(right, other.right);
    }
1070274
public IndexRange mergedWith(IndexRange other) {
        checkArgNotNull(other, "other");
        return new IndexRange(Math.min(start, other.start), Math.max(end, other.end));
    }
563513
@Override
	public int compareTo(ValueArray<ShortValue> o) {
		ShortValueArray other = (ShortValueArray) o;

		int min = Math.min(position, other.position);
		for (int i = 0; i < min; i++) {
			int cmp = Short.compare(data[i], other.data[i]);

			if (cmp != 0) {
				return cmp;
			}
		}

		return Integer.compare(position, other.position);
	}
895683
protected function combineSelectorSingle($base, $other)
    {
        $tag = [];
        $out = [];
        $wasTag = true;

        foreach ([$base, $other] as $single) {
            foreach ($single as $part) {
                if (preg_match('/^[\[.:#]/', $part)) {
                    $out[] = $part;
                    $wasTag = false;
                } elseif (preg_match('/^[^_-]/', $part)) {
                    $tag[] = $part;
                    $wasTag = true;
                } elseif ($wasTag) {
                    $tag[count($tag) - 1] .= $part;
                } else {
                    $out[count($out) - 1] .= $part;
                }
            }
        }

        if (count($tag)) {
            array_unshift($out, $tag[0]);
        }

        return $out;
    }
831244
public int matchScore(AndroidModel otherModel) {
        int score = 0;
        if (this.mManufacturer.equalsIgnoreCase(otherModel.mManufacturer)) {
            score = 1;
        }
        if (score ==1 && this.mModel.equals(otherModel.mModel)) {
            score = 2;
        }
        if (score == 2 && this.mBuildNumber.equals(otherModel.mBuildNumber)) {
            score = 3;
        }
        if (score == 3 && this.mVersion.equals(otherModel.mVersion)) {
            score = 4;
        }
        LogManager.d(TAG, "Score is %s for %s compared to %s", score, toString(), otherModel);
        return score;
    }
1203987
public int firstIndexOfDifference(Permutation other) {
        int r = 0;
        while ((r < values.length) && values[r] == other.get(r)) {
            r++;
        }
        return r;
    }
1130755
public Filter<S> mergeRemainderFilter(CompositeScore<S> other) {
        return getFilteringScore().mergeRemainderFilter(other.getFilteringScore());
    }
422001
public static double getHaltonNumberForGivenBase(long index, int base) {
		index += 1;

		double x = 0.0;
		double factor = 1.0 / base;
		while(index > 0) {
			x += (index % base) * factor;
			factor /= base;
			index /= base;
		}

		return x;
	}
744674
@Override
  public int compareTo(EigenPair otherEigenPair) {
    return eigenvalue < otherEigenPair.eigenvalue ? -1 : (eigenvalue > otherEigenPair.eigenvalue ? 1 : 0);
  }
284758
public boolean precedesOrEqualsForAllOffsetTypesInBoth(final OffsetGroup other) {
    return charOffset().precedesOrEquals(other.charOffset())
        && edtOffset().precedesOrEquals(other.edtOffset())
        && (!byteOffset().isPresent() || !other.byteOffset().isPresent()
                || byteOffset().get().precedesOrEquals(other.byteOffset().get()))
        && (!asrTime().isPresent() || !other.asrTime().isPresent()
                || asrTime().get().precedesOrEquals(other.asrTime().get()));
  }
784191
public void set(IntFloatSortedVector other) {
        this.used = other.used;
        this.indices = IntArrays.copyOf(other.indices);
        this.values = FloatArrays.copyOf(other.values);
    }
1301530
protected static double[] average(double[] base, double[] target)
    {
        int dataNum = base.length;
        double[] average = new double[dataNum];

        for (int index = 0; index < dataNum; index++)
        {
            average[index] = (base[index] + target[index]) / 2.0;
        }

        return average;
    }
874463
public void merge(final KllFloatsSketch other) {
    if ((other == null) || other.isEmpty()) { return; }
    if (m_ != other.m_) {
      throw new SketchesArgumentException("incompatible M: " + m_ + " and " + other.m_);
    }
    final long finalN = n_ + other.n_;
    for (int i = other.levels_[0]; i < other.levels_[1]; i++) {
      update(other.items_[i]);
    }
    if (other.numLevels_ >= 2) {
      mergeHigherLevels(other, finalN);
    }
    if (Float.isNaN(minValue_) || (other.minValue_ < minValue_)) { minValue_ = other.minValue_; }
    if (Float.isNaN(maxValue_) || (other.maxValue_ > maxValue_)) { maxValue_ = other.maxValue_; }
    n_ = finalN;
    assertCorrectTotalWeight();
    if (other.isEstimationMode()) {
      minK_ = min(minK_, other.minK_);
    }
  }
751353
public Stream<BASE> getUnmatchedBases() {
    return bases.stream().filter(base -> !baseToRaw.containsKey(base));
  }
558960
@Override
	public int compareTo(ValueArray<ByteValue> o) {
		ByteValueArray other = (ByteValueArray) o;

		int min = Math.min(position, other.position);
		for (int i = 0; i < min; i++) {
			int cmp = Byte.compare(data[i], other.data[i]);

			if (cmp != 0) {
				return cmp;
			}
		}

		return Integer.compare(position, other.position);
	}