org.ojalgo
Class MathUtils

java.lang.Object
  extended by org.ojalgo.MathUtils

public abstract class MathUtils
extends Object

Contains stuff that is missing from StrictMath and that is not included in PrimitiveFunction.

Author:
apete

Method Summary
static int gcd(int aValue1, int aValue2)
          Deprecated. Since Version 22. Use RationalNumber.gcd(int,int) instead
static long gcd(long aValue1, long aValue2)
          Deprecated. Since Version 22. Use RationalNumber.gcd(long,long) instead
static double getError(int aScale)
          Deprecated. Since Version 22. Use NumberContext.getError() instead.
static boolean isZero(double aNmbr)
          Deprecated. Since Version 22. Use TypeUtils.isZero(double) instead
static boolean isZero(Number aNmbr)
          Deprecated. Since Version 22. Use TypeUtils.isZero(double) instead
static int max(int anIntA, int anIntB, int anIntC)
          Deprecated. Since Version 22. Use MatrixUtils.max(int,int,int) instead
static int min(int anIntA, int anIntB, int anIntC)
          Deprecated. Since Version 22. Use MatrixUtils.min(int,int,int) instead
static long power10(int anExponent)
          Deprecated. Since Version 22. Use something else...
static int randomInteger(int aLower, int aHigher)
          Deprecated. Since Version 22. Use Uniform.randomInteger(int,int) instead
static BigDecimal toBigDecimal(Number aNumber)
          Deprecated. Since Version 22. Use TypeUtils.toBigDecimal(Number) instead
static ComplexNumber toComplexNumber(Number aNumber)
          Deprecated. Since Version 22. Use TypeUtils.toComplexNumber(Number) instead
static RationalNumber toRationalScalar(Number aNumber)
          Deprecated. Since Version 22. Use TypeUtils.toRationalNumber(Number) instead
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

gcd

@Deprecated
public static int gcd(int aValue1,
                                 int aValue2)
Deprecated. Since Version 22. Use RationalNumber.gcd(int,int) instead

Greatest Common Denominator


gcd

@Deprecated
public static long gcd(long aValue1,
                                  long aValue2)
Deprecated. Since Version 22. Use RationalNumber.gcd(long,long) instead


getError

@Deprecated
public static double getError(int aScale)
Deprecated. Since Version 22. Use NumberContext.getError() instead.

The (rounding) error is half the size of a one in the last decimal place. If the scale is set to 3 then the error is 0.0005.

Returns:
The rounding error size

isZero

@Deprecated
public static boolean isZero(double aNmbr)
Deprecated. Since Version 22. Use TypeUtils.isZero(double) instead


isZero

@Deprecated
public static boolean isZero(Number aNmbr)
Deprecated. Since Version 22. Use TypeUtils.isZero(double) instead


max

@Deprecated
public static int max(int anIntA,
                                 int anIntB,
                                 int anIntC)
Deprecated. Since Version 22. Use MatrixUtils.max(int,int,int) instead


min

@Deprecated
public static int min(int anIntA,
                                 int anIntB,
                                 int anIntC)
Deprecated. Since Version 22. Use MatrixUtils.min(int,int,int) instead


power10

@Deprecated
public static long power10(int anExponent)
Deprecated. Since Version 22. Use something else...

See Also:
PrimitiveFunction.POW, PrimitiveFunction.POWER, BigFunction.POW, BigFunction.POWER

randomInteger

@Deprecated
public static int randomInteger(int aLower,
                                           int aHigher)
Deprecated. Since Version 22. Use Uniform.randomInteger(int,int) instead

Returns:
An integer: aLower <= ? < aHigher

toBigDecimal

@Deprecated
public static BigDecimal toBigDecimal(Number aNumber)
Deprecated. Since Version 22. Use TypeUtils.toBigDecimal(Number) instead

If the input Number is a BigDecimal it is passed through unaltered. Otherwise an equivalent BigDecimal is created.

Parameters:
aNumber - Any Number
Returns:
A corresponding BigDecimal

toComplexNumber

@Deprecated
public static ComplexNumber toComplexNumber(Number aNumber)
Deprecated. Since Version 22. Use TypeUtils.toComplexNumber(Number) instead


toRationalScalar

@Deprecated
public static RationalNumber toRationalScalar(Number aNumber)
Deprecated. Since Version 22. Use TypeUtils.toRationalNumber(Number) instead