Package com.singularsys.exttests
Class PolynomialCreatorTest
java.lang.Object
com.singularsys.exttests.PolynomialCreatorTest
Tests for the polynomial package.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XJepprotected PolynomialCreatorstatic final booleanprotected SubstitutionVisitor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertPolynomialEquals(String s1, String s2) voidexpandTestString(String expr, String expected) voidmyAssertEquals(String msg, String actual, String expected) voidvoidvoidvoidsetUp()voidsimplifyTest(String expr, String expected) voidsimplifyTestString(String expr, String expected) voidsimplifyTestString2(String expr, String expected, String expt2) voidsimplifyTestString3(String expr, String expected, String expt2, String expt3) voidvoidvoidUses theComplexFieldWithTotalOrderto allow simplification of polynomials with Currently failing test.voidUsers theComplexPolynomialRewriterto rewrite powers of i.voidvoidvoidtest7dim()voidtestAdd()voidtestBad1()voidtestBad2()voidtestBad3()voidtestBad4()voidtestBad5()voidvoidtestBad7()voidvoidvoidvoidChecks that simplify/expand does not clean functions and operators marked withDirtyFunctionand does clean other functions and operators with constant arguments.voidvoidTheexpand.toNodehas problems with uminusvoidvoidvoidCheck that it does not create a polynomial like x+-y =voidvoidvoidvoidtestSimp()voidvoidtestSub()voidvoidvoidThe total ordering of monomials/polynomials mean that terms are rearranged.voidvoid
-
Field Details
-
PRINT_RESULTS
public static final boolean PRINT_RESULTS -
jep
-
pc
-
sv
-
-
Constructor Details
-
PolynomialCreatorTest
public PolynomialCreatorTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
myAssertEquals
-
assertPolynomialEquals
- Throws:
Exception
-
simplifyTest
- Throws:
Exception
-
simplifyTestString
- Throws:
JepException
-
simplifyTestString2
- Throws:
Exception
-
simplifyTestString3
public void simplifyTestString3(String expr, String expected, String expt2, String expt3) throws Exception - Throws:
Exception
-
expandTestString
- Throws:
JepException
-
testPrint
- Throws:
Exception
-
testMonomial
- Throws:
Exception
-
testSimp
- Throws:
Exception
-
testCommute
- Throws:
Exception
-
testPolySimp
- Throws:
Exception
-
testPolyDiffSimp
- Throws:
Exception
-
testTotalOrder
The total ordering of monomials/polynomials mean that terms are rearranged.- Throws:
JepException
-
testCompare
- Throws:
Exception
-
testPolySimp2
- Throws:
Exception
-
testExpandToNode
Theexpand.toNodehas problems with uminus- Throws:
Exception
-
testDirtyFunctions
Checks that simplify/expand does not clean functions and operators marked withDirtyFunctionand does clean other functions and operators with constant arguments.- Throws:
JepException
-
testSimpleEquals
- Throws:
Exception
-
testToArray
- Throws:
Exception
-
test_toPNodeArrayRecursive
- Throws:
Exception
-
testToCoefficientArray
- Throws:
Exception
-
testUnitaryPlusBug
- Throws:
Exception
-
test7dim
- Throws:
Exception
-
testCreatePoly
- Throws:
JepException
-
testAdd
- Throws:
JepException
-
testPolySigns
Check that it does not create a polynomial like x+-y =- Throws:
Exception
-
testExpandOperator
- Throws:
Exception
-
test_compare_uses_preprocessed_arguments
- Throws:
Exception
-
poly_with_function_add_poly_with_function
- Throws:
ParseException
-
poly_with_function_add_poly_with_function2
- Throws:
ParseException
-
testSub
- Throws:
Exception
-
test_serialization_of_elements
- Throws:
Exception
-
PConstant_with_complex_int_value
- Throws:
Exception
-
test_expandComplex
Uses theComplexFieldWithTotalOrderto allow simplification of polynomials with Currently failing test. To expand requires callingMutablePolynomial.add(PNodeI)this in turn requires callingPNodeI.compareTo(PNodeI)which needs to compare powers. But Complex numbers are not comparable, so a JepRuntimeException is thrown.- Throws:
JepException
-
test_ComplexTotalOrder
- Throws:
JepException
-
test_rewrite_power_of_i
Users theComplexPolynomialRewriterto rewrite powers of i.- Throws:
JepException
-
usingRationalField
- Throws:
Exception
-
testBad1
- Throws:
Exception
-
testBad2
- Throws:
Exception
-
testBad3
- Throws:
Exception
-
testBad4
- Throws:
Exception
-
testBad5
- Throws:
Exception
-
testBad6Works
- Throws:
Exception
-
testBad7
- Throws:
Exception
-