meshi.symmetryComplex.energy.edmEnergy
Class EDMSplinedPolynomial

java.lang.Object
  extended by meshi.symmetryComplex.energy.edmEnergy.EDMSplinedPolynomial

public class EDMSplinedPolynomial
extends java.lang.Object


Field Summary
private  double[][] breaks
           
private  double[] coefs
           
private static int NUM_DIMENSIONS
           
 
Constructor Summary
EDMSplinedPolynomial(double[][] breaks, double[] coefs)
          Create a new EDMSplinedPolynomial from parameters.
EDMSplinedPolynomial(java.lang.String edmDataFileNum)
          Create a new EDMSplinedPolynomial from a file.
 
Method Summary
 int findBin(double[] breaks, double value)
          Find break index (bin) for value.
private static double quickPower(double torsion, int power)
          Raises a double by the power, with 0 <= power <= 3.
 double value(int derivVar, double... args)
          Evaluate value of polynomial or any of its first derivations at given point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_DIMENSIONS

private static final int NUM_DIMENSIONS
See Also:
Constant Field Values

breaks

private double[][] breaks

coefs

private double[] coefs
Constructor Detail

EDMSplinedPolynomial

public EDMSplinedPolynomial(double[][] breaks,
                            double[] coefs)
Create a new EDMSplinedPolynomial from parameters.

Parameters:
breaks - each break has different coefficients
coefs - coefficienst by breaks

EDMSplinedPolynomial

public EDMSplinedPolynomial(java.lang.String edmDataFileNum)
                     throws java.io.IOException
Create a new EDMSplinedPolynomial from a file.

Throws:
java.io.IOException
Method Detail

value

public double value(int derivVar,
                    double... args)
Evaluate value of polynomial or any of its first derivations at given point.

Parameters:
derivVar - variable to be derived (zero for none)
args - list of variable assignments
Returns:
evaluation of polynomial

findBin

public int findBin(double[] breaks,
                   double value)
Find break index (bin) for value.

Returns:
left bound of break, -1 if no break found.

quickPower

private static double quickPower(double torsion,
                                 int power)
Raises a double by the power, with 0 <= power <= 3. For the special exception of power=-1, returns 0 (as it eases polynomial derivation calculations).