|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.commons.math.analysis.polynomials.PolynomialFunctionTest
public final class PolynomialFunctionTest
Tests the PolynomialFunction implementation of a UnivariateRealFunction.
Field Summary | |
---|---|
protected double |
tolerance
Error tolerance for tests |
Constructor Summary | |
---|---|
PolynomialFunctionTest()
|
Method Summary | |
---|---|
void |
checkPolynomial(org.apache.commons.math.analysis.polynomials.PolynomialFunction p,
String reference)
|
void |
testAddition()
|
void |
testConstants()
tests the value of a constant polynomial. |
void |
testfirstDerivativeComparison()
tests the firstDerivative function by comparison |
void |
testLinear()
tests the value of a linear polynomial. |
void |
testMultiplication()
|
void |
testQuadratic()
Tests a second order polynomial. |
void |
testQuintic()
This will test the quintic function f(x) = x^2(x-5)(x+3)(x-1) = x^5 - 3x^4 -13x^3 + 15x^2 |
void |
testSerial()
|
void |
testString()
|
void |
testSubtraction()
|
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 |
---|
protected double tolerance
Constructor Detail |
---|
public PolynomialFunctionTest()
Method Detail |
---|
public void testConstants() throws org.apache.commons.math.MathException
value of this is 2.5 everywhere.
org.apache.commons.math.MathException
public void testLinear() throws org.apache.commons.math.MathException
This will test the function f(x) = 3*x - 1.5
This will have the values f(0.0) = -1.5, f(-1.0) = -4.5, f(-2.5) = -9.0, f(0.5) = 0.0, f(1.5) = 3.0 and f(3.0) = 7.5
org.apache.commons.math.MathException
public void testQuadratic()
This will test the function f(x) = 2x^2 - 3x -2 = (2x+1)(x-2)
public void testQuintic()
public void testfirstDerivativeComparison() throws org.apache.commons.math.MathException
This will test the functions f(x) = x^3 - 2x^2 + 6x + 3, g(x) = 3x^2 - 4x + 6 and h(x) = 6x - 4
org.apache.commons.math.MathException
public void testString()
public void testAddition()
public void testSubtraction()
public void testMultiplication()
public void testSerial()
public void checkPolynomial(org.apache.commons.math.analysis.polynomials.PolynomialFunction p, String reference)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |