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

How to use
min
method
in
javolution.lang.MathLib

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

origin: org.javolution/javolution-core-java

@Override
public void setConcurrency(int concurrency) {
  // The setting of the concurrency can only reduce the number 
  // of threads available in the context.
  int nbThreads = MathLib.min(parent.threads.length, concurrency);
  threads = new ConcurrentThreadImpl[nbThreads];
  for (int i = 0; i < nbThreads; i++) { // Reused from parent threads.
    threads[i] = parent.threads[i];
  }
}
origin: com.github.mrstampy/esp

private double getMin(double[] fftd, int lowerCutoff, int upperCutoffHz) {
  double min = Double.MAX_VALUE;
  for (int i = lowerCutoff; i <= upperCutoffHz; i++) {
    min = MathLib.min(min, fftd[i]);
  }
  return min;
}
origin: org.javolution/javolution-core-java

@Override
protected Integer initialized(Integer value) {
  return MathLib.min(value, 65536); // Hard-limiting
}
origin: javolution/javolution

/**
 * Performs the logical AND operation on this bit set and the
 * given bit set. This means it builds the intersection
 * of the two sets. The result is stored into this bit set.
 *
 * @param that the second bit set.
 */
public void and(FastBitSet that) {
  final int n = MathLib.min(this._length, that._length);
  for (int i = 0; i < n; ++i) {
    this.bits[i] &= that.bits[i];
  }
  this._length = n;
}
origin: org.javolution/javolution-core-java

@Override
protected Integer initialized(Integer value) {
  return MathLib.min(value, 65536); // Hard-limiting
}
origin: javolution/javolution

public final void clear() {
  for (int i = 0; i < _size; i += C1) {
    final int count = MathLib.min(_size - i, C1);
    final  E [] low = _high[i >> B1];
    System.arraycopy(NULL_BLOCK, 0, low, 0, count);
  }
  _size = 0; // No need for volatile, removal are not thread-safe.
}
origin: javolution/javolution

/**
 * Prints out this text builder to the specified writer.
 * 
 * @param writer the destination writer.
 */
public void print(Writer writer) throws IOException {
  for (int i = 0; i < _length; i += C1) {
    char[] chars = _high[i >> B1];
    writer.write(chars, 0, MathLib.min(C1, _length - i));
  }
}
origin: javolution/javolution

private static void reset(Object[] entries) {
  for (int i = 0; i < entries.length;) {
    int count = MathLib.min(entries.length - i, C1);
    System.arraycopy(NULL_ENTRIES, 0, entries, i, count);
    i += count;
  }
}
private static final Entry[] NULL_ENTRIES = new Entry[C1];
origin: org.apache.marmotta/marmotta-commons

private void copyTo(FractalTableImpl that) {
  int n = MathLib.min(this.data.length, that.data.length);
  offset &= (data.length << shift) - 1; // Makes it positive.
  int o = offset >> shift;
  if ((o + n) > data.length) { // Wrapping.
    int w = (o + n) - data.length;
    n -= w;
    System.arraycopy(data, 0, that.data, n, w);
  }
  System.arraycopy(data, o, that.data, 0, n);
  that.offset = offset - (o << shift);
}
origin: org.javolution/javolution-core-java

private void copyTo(FractalTableImpl that) {
  int n = MathLib.min(this.data.length, that.data.length);
  offset &= (data.length << shift) - 1; // Makes it positive.
  int o = offset >> shift;
  if ((o + n) > data.length) { // Wrapping.
    int w = (o + n) - data.length;
    n -= w;
    System.arraycopy(data, 0, that.data, n, w);
  }
  System.arraycopy(data, o, that.data, 0, n);
  that.offset = offset - (o << shift);
}
origin: apache/marmotta

private void copyTo(FractalTableImpl that) {
  int n = MathLib.min(this.data.length, that.data.length);
  offset &= (data.length << shift) - 1; // Makes it positive.
  int o = offset >> shift;
  if ((o + n) > data.length) { // Wrapping.
    int w = (o + n) - data.length;
    n -= w;
    System.arraycopy(data, 0, that.data, n, w);
  }
  System.arraycopy(data, o, that.data, 0, n);
  that.offset = offset - (o << shift);
}
origin: org.javolution/javolution-core-java

@Override
public boolean intersects(BitSetService that) {
  long[] thatBits = that.toLongArray();
  int i = MathLib.min(this.bits.length, thatBits.length);
  while (--i >= 0) {
    if ((bits[i] & thatBits[i]) != 0) return true; 
  }
  return false;
}
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

@Override
public BitSetServiceImpl get(int fromIndex, int toIndex) {
  if (fromIndex < 0 || fromIndex > toIndex)
    throw new IndexOutOfBoundsException();
  BitSetServiceImpl bitSet = new BitSetServiceImpl();
  int length = MathLib.min(bits.length, (toIndex >>> 6) + 1);
  bitSet.bits = new long[length];
  System.arraycopy(bits, 0, bitSet.bits, 0, length);
  bitSet.clear(0, fromIndex);
  bitSet.clear(toIndex, length << 6);
  return bitSet;
}
origin: org.javolution/javolution-core-java

@Override
public void and(BitSetService that) {
  long[] thatBits = that.toLongArray();
  int n = MathLib.min(this.bits.length, thatBits.length);
  for (int i = 0; i < n; i++) {
    this.bits[i] &= thatBits[i];
  }
  for (int i = n; i < bits.length; i++) {
    this.bits[i] = 0L;
  }
  trim();
}
origin: org.javolution/javolution-core-java

@Override
public void andNot(BitSetService that) {
  long[] thatBits = that.toLongArray();
  int n = MathLib.min(this.bits.length, thatBits.length);
  for (int i = 0; i < n; i++) {
    this.bits[i] &= ~thatBits[i];
  }
  trim();
}
origin: org.jscience/jscience

/**
 * Returns the trace of this matrix.
 *
 * @return the sum of the diagonal elements.
 */
public F trace() {
  F sum = this.get(0, 0);
  for (int i = MathLib.min(getNumberOfColumns(), getNumberOfRows()); --i > 0;) {
    sum = sum.plus(get(i, i));
  }
  return sum;
}
origin: org.jscience/jscience

@Override
public DenseVector<F> getDiagonal() {
  int m = this.getNumberOfRows();
  int n = this.getNumberOfColumns();
  int dimension = MathLib.min(m, n);
  DenseVector<F> V = DenseVector.newInstance();
  for (int i = 0; i < dimension; i++) {
    V._elements.add(this.get(i, i));
  }
  return V;
}
origin: org.jscience/jscience

@Override
public ComplexVector getDiagonal() {
  int m = this.getNumberOfRows();
  int n = this.getNumberOfColumns();
  int dimension = MathLib.min(m, n);
  ComplexVector V = ComplexVector.newInstance(dimension);
  for (int i = 0; i < dimension; i++) {
    V.set(i, this.get(i, i));
  }
  return V;
}
origin: org.jscience/jscience

@Override
public Float64Vector getDiagonal() {
  int m = this.getNumberOfRows();
  int n = this.getNumberOfColumns();
  int dimension = MathLib.min(m, n);
  Float64Vector V = Float64Vector.newInstance(dimension);
  for (int i = 0; i < dimension; i++) {
    V.set(i, this.get(i, i).doubleValue());
  }
  return V;
}
javolution.langMathLibmin

Javadoc

Returns the smaller of two double values.

Popular methods of MathLib

  • 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.
  • max
    Returns the greater of two long values.
  • 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

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Path (java.nio.file)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • JOptionPane (javax.swing)
  • Top Vim plugins
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