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

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.analysis.polynomials.PolynomialSplineFunctionTest
All Implemented Interfaces:
junit.framework.Test

public class PolynomialSplineFunctionTest
extends junit.framework.TestCase

Tests the PolynomialSplineFunction implementation.

Version:
$Revision: 799857 $

Field Summary
protected  org.apache.commons.math.analysis.polynomials.PolynomialFunction dp
          Derivative of test polynomials -- 2x + 1
protected  double[] knots
          Knot points
protected  org.apache.commons.math.analysis.polynomials.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 junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tolerance

protected double tolerance
Error tolerance for tests


polynomials

protected org.apache.commons.math.analysis.polynomials.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 org.apache.commons.math.analysis.polynomials.PolynomialFunction dp
Derivative of test polynomials -- 2x + 1

Constructor Detail

PolynomialSplineFunctionTest

public PolynomialSplineFunctionTest()
Method Detail

testConstructor

public void testConstructor()

testValues

public void testValues()
                throws Exception
Throws:
Exception

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-2009 Apache Software Foundation. All Rights Reserved.