Tabnine Logo
MathLib.max
Code IndexAdd Tabnine to your IDE (free)

How to use
max
method
in
javolution.lang.MathLib

Best Java code snippets using javolution.lang.MathLib.max (Showing top 15 results out of 315)

origin: com.github.mrstampy/esp

private double getMax(double[] fftd, int lowerCutoffHz, int upperCutoffHz) {
  double max = Double.MIN_VALUE;
  for (int i = lowerCutoffHz; i <= upperCutoffHz; i++) {
    max = MathLib.max(max, fftd[i]);
  }
  return max;
}
origin: javolution/javolution

private int getSubMapDepth() {
  if (_useSubMaps) {
    int depth = 0;
    for (int i = 0; i < C2; i++) {
      int subMapDepth = _subMaps[i].getSubMapDepth();
      depth = MathLib.max(depth, subMapDepth);
    }
    return depth + 1;
  } else {
    return 0;
  }
}
origin: org.javolution/javolution-core-java

    _index++;
    _wordSize++;
    _length = MathLib.max(_length, _index);
_index += MathLib.max(wordSize, (bitLength + 7) >> 3);
_wordSize = wordSize;
_bitsUsed = bitLength;
_length = MathLib.max(_length, _index);
origin: javolution/javolution

    _index++;
    _wordSize++;
    _length = MathLib.max(_length, _index);
_index += MathLib.max(wordSize, (bitLength + 7) >> 3);
_wordSize = wordSize;
_bitsUsed = bitLength;
_length = MathLib.max(_length, _index);
origin: javolution/javolution

private int getMaximumDistance() {
  int max = 0;
  if (_useSubMaps) {
    for (int i = 0; i < C2; i++) {
      int subMapMax = _subMaps[i].getMaximumDistance();
      max = MathLib.max(max, subMapMax);
    }
    return max;
  }
  for (int i = 0; i < _entries.length; i++) {
    Entry entry = _entries[i];
    if ((entry != null) && (entry != Entry.NULL)) {
      int slot = (entry._keyHash >> _keyShift) & (_entries.length - 1);
      int distanceToSlot = i - slot;
      if (distanceToSlot < 0) {
        distanceToSlot += _entries.length;
      }
      if (distanceToSlot > max) {
        max = distanceToSlot;
      }
    }
  }
  return max;
}
origin: javolution/javolution

private int getDepth() {
  if (_data != null) // Primitive.
    return 0;
  return MathLib.max(_head.getDepth(), _tail.getDepth()) + 1;
}
private int getNbrOfBranches() {
origin: javolution/javolution

/**
 * Set the {@link LocalContext local} concurrency. Concurrency is 
 * hard limited by {@link #MAXIMUM_CONCURRENCY}.
 * 
 * @param concurrency the new concurrency (<code>0</code> or negative
 *       number to disable concurrency).
 */
public static void setConcurrency(int concurrency) {
  concurrency = MathLib.max(0, concurrency);
  concurrency = MathLib.min(((Integer) MAXIMUM_CONCURRENCY.get()).intValue(), concurrency);
  CONCURRENCY.set(new Integer(concurrency));
}
origin: org.javolution/javolution-core-java

private int getDepth() {
  if (_data != null) // Primitive.
    return 0;
  return MathLib.max(_head.getDepth(), _tail.getDepth()) + 1;
}
origin: javolution/javolution

/**
 * Returns the index within this text of the first occurrence of the
 * specified character, starting the search at the specified index.
 *
 * @param c the character to search for.
 * @param fromIndex the index to start the search from.
 * @return the index of the first occurrence of the character in this text
 *         that is greater than or equal to <code>fromIndex</code>, 
 *         or <code>-1</code> if the character does not occur.
 */
public int indexOf(char c, int fromIndex) {
  if (_data != null) { // Primitive.
    for (int i = MathLib.max(fromIndex, 0); i < _count; i++) {
      if (_data[i] == c)
        return i;
    }
    return -1;
  } else { // Composite.
    final int cesure = _head._count;
    if (fromIndex < cesure) {
      final int headIndex = _head.indexOf(c, fromIndex);
      if (headIndex >= 0)
        return headIndex; // Found in head.
    }
    final int tailIndex = _tail.indexOf(c, fromIndex - cesure);
    return (tailIndex >= 0) ? tailIndex + cesure : -1;
  }
}
origin: org.javolution/javolution-core-java

/**
 * Returns the index within this text of the first occurrence of the
 * specified character, starting the search at the specified index.
 *
 * @param c the character to search for.
 * @param fromIndex the index to start the search from.
 * @return the index of the first occurrence of the character in this text
 *         that is greater than or equal to <code>fromIndex</code>, 
 *         or <code>-1</code> if the character does not occur.
 */
public int indexOf(char c, int fromIndex) {
  if (_data != null) { // Primitive.
    for (int i = MathLib.max(fromIndex, 0); i < _count; i++) {
      if (_data[i] == c)
        return i;
    }
    return -1;
  } else { // Composite.
    final int cesure = _head._count;
    if (fromIndex < cesure) {
      final int headIndex = _head.indexOf(c, fromIndex);
      if (headIndex >= 0)
        return headIndex; // Found in head.
    }
    final int tailIndex = _tail.indexOf(c, fromIndex - cesure);
    return (tailIndex >= 0) ? tailIndex + cesure : -1;
  }
}
origin: org.jscience/jscience

final int thisSize = this._size;
final int thatSize = that._size;
Term result = FACTORY.array(MathLib.max(thisSize, thatSize));
result._size = 0;
for (int i = 0, j = 0;;) {
origin: org.jscience/jscience

min = MathLib.min(_minimum * that._maximum, _maximum
max = MathLib.max(_minimum * that._minimum, _maximum
origin: org.jscience/jscience

int log10Error = (int) MathLib.floor(MathLib.log10(error));
int digits = log10Value - log10Error - 1; // Exact digits.
digits = MathLib.max(1, digits + _errorDigits);
origin: org.jscience/jscience

int log10Error = (int) MathLib.floor(MathLib.log10(error));
int digits = log10Value - log10Error - 1; // Exact digits.
digits = MathLib.max(1, digits + _errorDigits);
origin: org.jscience/jscience

/**
 * Returns the reciprocal (or inverse) of this real number.
 *
 * @return <code>1 / this</code>.
 */
public Real inverse() {
  if ((this == NaN) || (this == ZERO))
    return NaN;
  if (this.isExact())
    return this.toInexact().inverse();
  LargeInteger thisMin = this._significand.minus(this._error);
  LargeInteger thisMax = this._significand.plus(this._error);
  if (thisMin.isNegative() && thisMax.isPositive()) // Encompasses 0
    return NaN;
  int digits = MathLib.max(thisMin.digitLength(), thisMax.digitLength());
  long exp = ((long) -this._exponent) - digits - digits;
  if ((exp > Integer.MAX_VALUE || (exp < Integer.MIN_VALUE)))
    return NaN; // Exponent overflow.
  LargeInteger min = div(2 * digits, thisMax);
  LargeInteger max = div(2 * digits, thisMin);
  Real real = FACTORY.object();
  real._exponent = (int) exp;
  real._significand = min.plus(max).shiftRight(1);
  real._error = max.minus(min).plus(LargeInteger.ONE);
  return real.normalize();
}
javolution.langMathLibmax

Javadoc

Returns the greater of two double values.

Popular methods of MathLib

  • min
    Returns the smaller of two long values.
  • sqrt
    Returns the positive square root of the specified value.
  • abs
    Returns the absolute value of the specified long argument.
  • bitLength
    Returns the number of bits in the minimal two's-complement representation of the specified long, exc
  • exp
    Returns #E raised to the specified power.
  • floor
    Returns the largest (closest to positive infinity)double value that is not greater than the argument
  • log
    Returns the natural logarithm (base #E) of the specified value.
  • pow
    Returns the value of the first argument raised to the power of the second argument.
  • round
    Returns the closest int to the specified argument.
  • toDoublePow10
    Returns the closest double representation of the specified long number multiplied by a power of ten.
  • toDoublePow2
    Returns the closest double representation of the specified long number multiplied by a power of two.
  • toLongPow10
    Returns the closest long representation of the specified double number multiplied by a power of ten.
  • toDoublePow2,
  • toLongPow10,
  • _atan,
  • _ieee754_exp,
  • _ieee754_log,
  • asin,
  • atan,
  • digitLength,
  • floorLog10

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now