genopt.algorithm.util.math
Class Fun

java.lang.Object
  extended by genopt.algorithm.util.math.Fun

public class Fun
extends java.lang.Object

Collection of mathematical functions. This package is scanned by FunctionEvaluator.

This project was carried out at:

and supported by

GenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Version:
GenOpt(R) 3.1.0 (December 8, 2011)

Author:
Michael Wetter

Field Summary
private static double LN10
          Natural logarithm of 10.
 
Constructor Summary
Fun()
           
 
Method Summary
static double add(double x0, double x1)
          Adds two numbers.
static double add(double x0, double x1, double x2)
          Adds three numbers.
static double add(double x0, double x1, double x2, double x3)
          Adds four numbers.
static double add(double x0, double x1, double x2, double x3, double x4)
          Adds five numbers.
static double add(double x0, double x1, double x2, double x3, double x4, double x5)
          Adds six numbers.
static double divide(double x, double y)
          Divides two numbers.
static double[] getSpacing(int nStep, double x0, double x1)
          Gets an array containing spacing between x0 and x1.
static double log10(double x0)
          Returns the logarithm (base 10) of a double value.
static double multiply(double x0, double x1)
          Multiplies two numbers.
static double multiply(double x0, double x1, double x2)
          Multiplies three numbers.
static double subtract(double x0, double x1)
          Subtracts two numbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LN10

private static final double LN10
Natural logarithm of 10.

Constructor Detail

Fun

public Fun()
Method Detail

getSpacing

public static final double[] getSpacing(int nStep,
                                        double x0,
                                        double x1)
Gets an array containing spacing between x0 and x1.

Parameters:
nStep - number of intervals. If negative, spacing will be logarithmic, otherwise it will be linear
x0 - first point of spacing
x1 - last point of spacing
Returns:
array with all coordinate values

log10

public static final double log10(double x0)
Returns the logarithm (base 10) of a double value.
Special cases:

Parameters:
x0 - - a number greater than 0
Returns:
the logarithm of x.

add

public static final double add(double x0,
                               double x1)
Adds two numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
Returns:
the sum of the arguments

add

public static final double add(double x0,
                               double x1,
                               double x2)
Adds three numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
x2 - 3rd argument
Returns:
the sum of the arguments

add

public static final double add(double x0,
                               double x1,
                               double x2,
                               double x3)
Adds four numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
x2 - 3rd argument
x3 - 4th argument
Returns:
the sum of the arguments

add

public static final double add(double x0,
                               double x1,
                               double x2,
                               double x3,
                               double x4)
Adds five numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
x2 - 3rd argument
x3 - 4th argument
x4 - 5th argument
Returns:
the sum of the arguments

add

public static final double add(double x0,
                               double x1,
                               double x2,
                               double x3,
                               double x4,
                               double x5)
Adds six numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
x2 - 3rd argument
x3 - 4th argument
x4 - 5th argument
x5 - 6th argument
Returns:
the sum of the arguments

subtract

public static final double subtract(double x0,
                                    double x1)
Subtracts two numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
Returns:
the difference x0 - x1

multiply

public static final double multiply(double x0,
                                    double x1)
Multiplies two numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
Returns:
the product of the arguments

multiply

public static final double multiply(double x0,
                                    double x1,
                                    double x2)
Multiplies three numbers. This method is typically being used by FunctionEvaluator

Parameters:
x0 - 1st argument
x1 - 2nd argument
x2 - 3rd argument
Returns:
the product of the arguments

divide

public static final double divide(double x,
                                  double y)
Divides two numbers. This method is typically being used by FunctionEvaluator

Parameters:
x - 1st argument
y - 2nd argument
Returns:
the ratio x/y