Tabnine Logo
javolution.lang
Code IndexAdd Tabnine to your IDE (free)

How to use javolution.lang

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

origin: javolution/javolution

@Override
public Object getField(Class forClass, Class type, boolean inherited) {
  ClassInitializer.initialize(forClass);
  return getField2(forClass, type, inherited);
}
private Object getField2(Class forClass, Class type, boolean inherited) {
origin: javolution/javolution

/**
 * Returns the closest <code>int</code> to the specified argument. 
 *
 * @param f the <code>float</code> value to be rounded to a <code>int</code>
 * @return the nearest <code>int</code> value.
 **/
public static int round(float f) {
  return (int) floor(f + 0.5f);
}
/**/
origin: javolution/javolution

/**
 * Returns the natural logarithm (base <i>{@link #E e}</i>) of the specified
 * value.
 *
 * @param x the value greater than <code>0.0</code>.
 * @return the value y such as <code><i>e</i><sup>y</sup> == x</code>
 **/
public static double log(double x) {
  return MathLib._ieee754_log(x);
}
/**/
origin: javolution/javolution

/**
 * Returns the hyperbolic cosine of x.
 * 
 * @param x the value for which the hyperbolic cosine is calculated.
 * @return <code>(exp(x) + exp(-x)) / 2</code>
 **/
public static double cosh(double x) {
  return (MathLib.exp(x) + MathLib.exp(-x)) * 0.5;
}
/**/
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: javolution/javolution

/**
 * Returns the decimal logarithm of the specified value.
 *
 * @param x the value greater than <code>0.0</code>.
 * @return the value y such as <code>10<sup>y</sup> == x</code>
 **/
public static double log10(double x) {
  return log(x) * INV_LOG10;
}
private static double INV_LOG10 = 0.43429448190325182765112891891661;
origin: org.jscience/jscience

/**
 * Returns the closest integer value to this 64 bits floating point number.
 * 
 * @return this number rounded to the nearest integer.
 */
public long round() {
  return MathLib.round(_value);
}
origin: org.jscience/jscience

/**
 * Compares the absolute value of this number with that number.
 * 
 * @param that the number to compare with.
 * @return <code>|this| > |that|</code>
 */
public boolean isLargerThan(Float64 that) {
  return MathLib.abs(this._value) > MathLib.abs(that._value);
}
origin: javolution/javolution

/**
 * Returns the arc cosine of the specified value,
 * in the range of 0.0 through <i>pi</i>. 
 *
 * @param x the value whose arc cosine is to be returned.
 * @return the arc cosine in radians for the specified value.
 **/
public static double acos(double x) {
  return HALF_PI - MathLib.asin(x);
}
/**/
origin: javolution/javolution

/**
 * Returns <i>{@link #E e}</i> raised to the specified power.
 *
 * @param x the exponent.
 * @return <code><i>e</i><sup>x</sup></code>
 * @see <a href="http://mathworld.wolfram.com/ExponentialFunction.html">
 *      Exponential Function -- from MathWorld</a> 
 **/
public static double exp(double x) {
  return MathLib._ieee754_exp(x);
}
/**/
origin: javolution/javolution

/**
 * Returns a random number between zero and one.
 *  
 * @return  a <code>double</code> greater than or equal 
 *          to <code>0.0</code> and less than <code>1.0</code>.
 **/
public static double random() {
  return random(0, Integer.MAX_VALUE) * NORMALIZATION_FACTOR;
}
private static final double NORMALIZATION_FACTOR = -1.0 / Integer.MIN_VALUE;
origin: javolution/javolution

/**
 * Sets explicitely the factory to be used for the specified class 
 * (see {@link #getInstance}).
 * 
 * @param factory the factory to use.
 * @param forClass the associated class.
 * @see #getInstance(Class)
 */
public static <T>  void setInstance(ObjectFactory <T>  factory,
    Class <T>  forClass) {
  Reflection.getInstance().setField(factory, forClass, ObjectFactory.class);
}
origin: javolution/javolution

/**
 * Initializes all runtime and classpath classes.
 * 
 * @see #initializeRuntime()
 * @see #initializeClassPath()
 */
public static void initializeAll() {
  initializeRuntime();
  initializeClassPath();
}
origin: org.javolution/javolution-core-java

@Override
public int length() {
  if (bits.length == 0) return 0;
  return (bits.length << 6) - MathLib.numberOfLeadingZeros(bits[bits.length -1]);
}
origin: javolution/javolution

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
/**/
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the hyperbolic cosine of x.
 * 
 * @param x the value for which the hyperbolic cosine is calculated.
 * @return <code>(exp(x) + exp(-x)) / 2</code>
 **/
public static double cosh(double x) {
  return (MathLib.exp(x) + MathLib.exp(-x)) * 0.5;
}
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the natural logarithm (base <i>{@link #E e}</i>) of the specified
 * value.
 *
 * @param x the value greater than <code>0.0</code>.
 * @return the value y such as <code><i>e</i><sup>y</sup> == x</code>
 **/
public static double log(double x) {
  return MathLib._ieee754_log(x);
}
origin: javolution/javolution

/**
 * Returns a pseudo random <code>float</code> value in the range
 * <code>[min, max]</code> (fast and thread-safe without synchronization).
 * 
 * @param min the minimum value inclusive.
 * @param max the maximum value inclusive.
 * @return a pseudo random number in the range <code>[min, max]</code>.
 */
public static float random(float min, float max) {
  return (float) random((double) min, (double) max);
}
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
origin: javolution/javolution

/**
 * Returns the hyperbolic tangent of x.
 * 
 * @param x the value for which the hyperbolic tangent is calculated.
 * @return <code>(exp(2 * x) - 1) / (exp(2 * x) + 1)</code>
 **/
public static double tanh(double x) {
  return (MathLib.exp(2 * x) - 1) / (MathLib.exp(2 * x) + 1);
}
/**/
javolution.lang

Most used classes

  • MathLib
    This utility class ensures cross-platform portability of the math library. Functions not supported
  • Configurable
    An element which is configurable without presupposing how the configuration is done. Does your cl
  • Realtime
    This interface identifies RTSJ [http://www.rtsj.org/] safe classes with predictable response time a
  • Parallelizable
  • ClassInitializer
    This utility class allows for initialization of all classes at startup to avoid initialization dela
  • Configurable$Listener,
  • Initializer,
  • Reflection$Constructor,
  • Reflection$Default$BaseConstructor,
  • Reflection$Default$BaseMethod,
  • Reflection$Default$DefaultConstructor,
  • Reflection$Default$ReflectConstructor,
  • Reflection$Default$ReflectMethod,
  • Reflection$Default,
  • Reflection$Method,
  • Reflection,
  • Reusable,
  • ValueType
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