Class FMath

java.lang.Object
  |
  +--FMath

public abstract class FMath
extends java.lang.Object

FMath is a abstract class with various functions I felt we're either missing or not implemented as I wanted them to be in the JDK Math class


Constructor Summary
FMath()
           
 
Method Summary
static double acosh(double x)
          Inverse Hyperbolic cosine function
static int arrayMax(double[] inputArray)
          Find the index of the maximum value in the inputArray
static int arrayMin(double[] inputArray)
          Returns the index of the mimimum value in an array of doubles
static double asinh(double x)
          Inverse Hyperbolic cosine
static double cosh(double x)
          Hyperbolic cosine function
static double dotprod(double[] a, double[] b)
          Get the dot product of 2 vectors
static double ellf(double phi, double ak)
          Legendre elliptic integral of the first kind as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html
static double ellpi(double phi, double en, double ak)
          Legendre elliptic integral of the third kind as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html
static double[] gaussElim(double[][] matrix)
          Perform Gauss Elimination on an n x n+1 matrix
static double[] leastSquares(double[] x, double[] y, int ORDER)
          Performs least squares of order ORDER on independent x and dependent y
static void main(java.lang.String[] args)
          Use main to test new algorithms
static double[][] matrixmult(double[][] a, double[][] b)
          Multiply two matrices Format for all matrices is matrix[row][column] Mult results in a matrix of size [a.length][b[0].length] a[0][0] a[0][1] a[0][n] b[0][0] b[0][1] b[0][n] a[1][0] a[1][1] a[1][n] x b[1][0] b[1][1] b[1][n] a[n][0] a[n][1] a[n][n] b[n][0] b[n][1] b[n][n]
static double rc(double x, double y)
          Carlson's degenerate elliptic integral (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html
static double rf(double x, double y, double z)
          Carlson's elliptic integral of the first kind (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html
static double rj(double x, double y, double z, double p)
          Carlson's elliptic integral of the third kind (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html
static double roundOff(double inputDouble, int places)
          Roundoff the inputDouble to the prescribed number of decimal places
static double rss(double a, double b, double c)
          Get the root sum square (vector magnitude) of the 3 input variables
static double sinh(double x)
          Hyperbolic sine function
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FMath

public FMath()
Method Detail

main

public static void main(java.lang.String[] args)
Use main to test new algorithms

arrayMax

public static int arrayMax(double[] inputArray)
Find the index of the maximum value in the inputArray
Returns:
The index of the largest double in the array

arrayMin

public static int arrayMin(double[] inputArray)
Returns the index of the mimimum value in an array of doubles

leastSquares

public static double[] leastSquares(double[] x,
                                    double[] y,
                                    int ORDER)
Performs least squares of order ORDER on independent x and dependent y

gaussElim

public static double[] gaussElim(double[][] matrix)
Perform Gauss Elimination on an n x n+1 matrix

cosh

public static double cosh(double x)
Hyperbolic cosine function
Returns:
(ex+e-x)/2.0

sinh

public static double sinh(double x)
Hyperbolic sine function
Returns:
(ex-e-x)/2.0

acosh

public static double acosh(double x)
Inverse Hyperbolic cosine function

asinh

public static double asinh(double x)
Inverse Hyperbolic cosine

ellf

public static double ellf(double phi,
                          double ak)
Legendre elliptic integral of the first kind as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html

ellpi

public static double ellpi(double phi,
                           double en,
                           double ak)
Legendre elliptic integral of the third kind as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html

rf

public static double rf(double x,
                        double y,
                        double z)
Carlson's elliptic integral of the first kind (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html

rj

public static double rj(double x,
                        double y,
                        double z,
                        double p)
Carlson's elliptic integral of the third kind (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html

rc

public static double rc(double x,
                        double y)
Carlson's degenerate elliptic integral (6.11) as defined at http://www.scf.fundp.ac.be/~jpvigner/homepage/sources/recipes/recipes.html

roundOff

public static double roundOff(double inputDouble,
                              int places)
Roundoff the inputDouble to the prescribed number of decimal places

rss

public static double rss(double a,
                         double b,
                         double c)
Get the root sum square (vector magnitude) of the 3 input variables

dotprod

public static double dotprod(double[] a,
                             double[] b)
Get the dot product of 2 vectors

matrixmult

public static double[][] matrixmult(double[][] a,
                                    double[][] b)
Multiply two matrices Format for all matrices is matrix[row][column] Mult results in a matrix of size [a.length][b[0].length] a[0][0] a[0][1] a[0][n] b[0][0] b[0][1] b[0][n] a[1][0] a[1][1] a[1][n] x b[1][0] b[1][1] b[1][n] a[n][0] a[n][1] a[n][n] b[n][0] b[n][1] b[n][n]
Returns:
a times b or null if number of columns in a != number of rows in b