Package parser
Class PolynomialExpression
java.lang.Object
parser.MathExpression
parser.PolynomialExpression
- All Implemented Interfaces:
Savable
,Solvable
,Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Solves the Polynomial with BigDecimal precision....about 16d.p.static final int
Solves the Polynomial with normal double precision....about 16d.p.private int
Used to select what mode to operate objects of this class...whether DOUBLE_PRECISION or BIGDECIMAL_PRECISION.Fields inherited from class parser.MathExpression
correctFunction, DRG, hasListReturningOperators, lastResult, noOfListReturningOperators, parser_Result, returnType, scanner, utility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbigDecimalPrecisionSolve
(List<String> list) used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)doublePrecisionSolve
(List<String> list) Used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)int
static void
void
setPrecision
(int precision) used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)Methods inherited from class parser.MathExpression
codeModifier, copyArrayToArray, detectKeyOperators, functionComponentsAssociation, getBracket, getDRG, getExpression, getLastResult, getNoOfListReturningOperators, getReturnObjectName, getReturnType, getScanner, getValue, getVariableManager, getVars, getWhitespaceremover, isAutoInitOn, isCorrectFunction, isHasListReturningOperators, isHasLogicOperators, isHasMulOrDivOperators, isHasNumberReturningStatsOperators, isHasPermOrCombOperators, isHasPlusOrMinusOperators, isHasPostNumberOperators, isHasPowerOperators, isHasPreNumberOperators, isHasRemainderOperators, isOptimizable, isScannedAndOptimized, isVariableHandlerOnly, listToString, mapBrackets, mapBrackets, modifyBracketIndices, parse, serialize, setAutoInitOn, setBracket, setCorrectFunction, setDRG, setExpression, setHasListReturningOperators, setHasLogicOperators, setHasMulOrDivOperators, setHasNumberReturningStatsOperators, setHasPermOrCombOperators, setHasPlusOrMinusOperators, setHasPostNumberOperators, setHasPowerOperators, setHasPreNumberOperators, setHasRemainderOperators, setLastResult, setNoOfListReturningOperators, setOptimizable, setReturnType, setScanner, setValue, setVariableHandlerOnly, setVariableManager, setVariableValuesInFunction, setWhitespaceremover, solve, solveSubPortions, statsVerifier, unBracketDataSetReturningStatsOperators
-
Field Details
-
DOUBLE_PRECISION
public static final int DOUBLE_PRECISIONSolves the Polynomial with normal double precision....about 16d.p.- See Also:
-
BIGDECIMAL_PRECISION
public static final int BIGDECIMAL_PRECISIONSolves the Polynomial with BigDecimal precision....about 16d.p.- See Also:
-
precision
private int precisionUsed to select what mode to operate objects of this class...whether DOUBLE_PRECISION or BIGDECIMAL_PRECISION.
-
-
Constructor Details
-
PolynomialExpression
- Parameters:
expression
- A valid polynomial expression, having powers of the variable as only non-negative integers.
-
-
Method Details
-
setPrecision
public void setPrecision(int precision) - Parameters:
precision
- The precision to use. If set to any value other than 1 (DOUBLE_PRECISION) or 2 (BIGDECIMAL_PRECISION), it defaults to DOUBLE_PRECISION
-
getPrecision
public int getPrecision() -
solve
Description copied from class:MathExpression
used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)- Overrides:
solve
in classMathExpression
- Parameters:
list
- a list of scanner tokens of a maths expression- Returns:
- the solution to a SBP maths expression
-
doublePrecisionSolve
Used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)- Parameters:
list
- a list of scanner tokens of a maths expression- Returns:
- the solution to a SBP maths expression. The precision returned here is that of double numbers, namely about 16d.p
-
bigDecimalPrecisionSolve
used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)- Parameters:
list
- a list of scanner tokens of a maths expression- Returns:
- the solution to a SBP maths expression
-
main
-