org.apache.commons.math3.analysis.polynomials
Class PolynomialSplineFunctionTest

java.lang.Object
  extended by org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunctionTest

public class PolynomialSplineFunctionTest
extends Object

Tests the PolynomialSplineFunction implementation.

Version:
$Id: PolynomialSplineFunctionTest.java 1364030 2012-07-21 01:10:04Z erans $

Field Summary
protected  PolynomialFunction dp
          Derivative of test polynomials -- 2x + 1
protected  double[] knots
          Knot points
protected  PolynomialFunction[] polynomials
          Quadratic polynomials used in tests: x^2 + x [-1, 0) x^2 + x + 2 [0, 1) x^2 + x + 4 [1, 2) Defined so that evaluation using PolynomialSplineFunction evaluation algorithm agrees at knot point boundaries.
protected  double tolerance
          Error tolerance for tests
 
Constructor Summary
PolynomialSplineFunctionTest()
           
 
Method Summary
protected  int findKnot(double[] knots, double x)
          Do linear search to find largest knot point less than or equal to x.
 void testConstructor()
           
 void testValues()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tolerance

protected double tolerance
Error tolerance for tests


polynomials

protected PolynomialFunction[] polynomials
Quadratic polynomials used in tests: x^2 + x [-1, 0) x^2 + x + 2 [0, 1) x^2 + x + 4 [1, 2) Defined so that evaluation using PolynomialSplineFunction evaluation algorithm agrees at knot point boundaries.


knots

protected double[] knots
Knot points


dp

protected PolynomialFunction dp
Derivative of test polynomials -- 2x + 1

Constructor Detail

PolynomialSplineFunctionTest

public PolynomialSplineFunctionTest()
Method Detail

testConstructor

public void testConstructor()

testValues

public void testValues()

findKnot

protected int findKnot(double[] knots,
                       double x)
Do linear search to find largest knot point less than or equal to x. Implementation does binary search.



Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.