org.apache.commons.math.analysis.interpolation
Class SplineInterpolatorTest

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

public class SplineInterpolatorTest
extends junit.framework.TestCase

Test the SplineInterpolator.

Version:
$Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $

Field Summary
protected  double coefficientTolerance
          error tolerance for interpolating polynomial coefficients
protected  double interpolationTolerance
          error tolerance for interpolated values -- high value is from sin test
protected  double knotTolerance
          error tolerance for spline interpolator value at knot points
 
Constructor Summary
SplineInterpolatorTest(String name)
           
 
Method Summary
static junit.framework.Test suite()
           
 void testIllegalArguments()
           
 void testInterpolateLinear()
           
 void testInterpolateLinearDegenerateThreeSegment()
           
 void testInterpolateLinearDegenerateTwoSegment()
           
 void testInterpolateSin()
           
protected  void verifyConsistency(org.apache.commons.math.analysis.polynomials.PolynomialSplineFunction f, double[] x)
          Verifies that interpolating polynomials satisfy consistency requirement: adjacent polynomials must agree through two derivatives at knot points
protected  void verifyInterpolation(org.apache.commons.math.analysis.UnivariateRealFunction f, double[] x, double[] y)
          verifies that f(x[i]) = y[i] for i = 0..n-1 where n is common length.
 
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

knotTolerance

protected double knotTolerance
error tolerance for spline interpolator value at knot points


coefficientTolerance

protected double coefficientTolerance
error tolerance for interpolating polynomial coefficients


interpolationTolerance

protected double interpolationTolerance
error tolerance for interpolated values -- high value is from sin test

Constructor Detail

SplineInterpolatorTest

public SplineInterpolatorTest(String name)
Method Detail

suite

public static junit.framework.Test suite()

testInterpolateLinearDegenerateTwoSegment

public void testInterpolateLinearDegenerateTwoSegment()
                                               throws Exception
Throws:
Exception

testInterpolateLinearDegenerateThreeSegment

public void testInterpolateLinearDegenerateThreeSegment()
                                                 throws Exception
Throws:
Exception

testInterpolateLinear

public void testInterpolateLinear()
                           throws Exception
Throws:
Exception

testInterpolateSin

public void testInterpolateSin()
                        throws Exception
Throws:
Exception

testIllegalArguments

public void testIllegalArguments()
                          throws org.apache.commons.math.MathException
Throws:
org.apache.commons.math.MathException

verifyInterpolation

protected void verifyInterpolation(org.apache.commons.math.analysis.UnivariateRealFunction f,
                                   double[] x,
                                   double[] y)
                            throws Exception
verifies that f(x[i]) = y[i] for i = 0..n-1 where n is common length.

Throws:
Exception

verifyConsistency

protected void verifyConsistency(org.apache.commons.math.analysis.polynomials.PolynomialSplineFunction f,
                                 double[] x)
                          throws Exception
Verifies that interpolating polynomials satisfy consistency requirement: adjacent polynomials must agree through two derivatives at knot points

Throws:
Exception


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.