public abstract class Function extends java.lang.Object implements java.lang.Comparable<Function>
Modifier and Type | Class and Description |
---|---|
(package private) class |
Function.DefaultSimplifier
Simplifier of function by default.
|
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<Function> |
COMPARATOR
Comparator of 2 functions
|
private Function.DefaultSimplifier |
defaultSimplifier
The default function simplifier
|
protected static ConstantsReferences |
references
Actual constant reference
|
Constructor and Description |
---|
Function()
Function empty
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
addParentheses(java.lang.String string)
Add parentheses to respect the operator priority
|
static boolean |
allEquals(Function function,
Function... functions)
Indicates if several functions are equals each others
|
int |
compareTo(Function function)
Compare with an other function
Parent documentation: |
protected abstract int |
compareToInternal(Function function)
Internal comparison
|
static Function |
createAddition(Function... functions)
Create an addition of several functions
|
static Function |
createMultiplication(Function... functions)
Create an multiplication of several functions
|
Function |
derive(java.lang.String... list)
Derive with several variable
|
Function |
derive(java.lang.String variable)
Derive the function
|
abstract Function |
derive(Variable variable)
Derive the function
|
Function |
derive(VariableList list)
Derive with several variable
|
boolean |
equals(java.lang.Object object)
Indicates if an object is equals to the function
|
abstract boolean |
functionIsEquals(Function function)
Indicates if a function is equals to this function
|
protected boolean |
functionIsEqualsMoreSimple(Function function)
Indicates if function is equals, the equality test is more simple than
functionIsEquals(Function) its use
internally for simplifyMaximum() |
protected static java.lang.String |
getArgument(java.lang.String string)
Give the "parameter" of the string
|
abstract Function |
getCopy()
Copy the function
|
private static boolean |
isBinaryOperator(char car)
Indicates if a character is binary operator
|
abstract boolean |
isRealValueNumber()
Indicates if function can see as real number, that is to say that the value of
obtainRealValueNumber() as as
meaning |
FunctionSimplifier |
obtainFunctionSimplifier()
Obtain the simplifier of the function.
|
abstract double |
obtainRealValueNumber()
Real value of function, if the function can be represents by a real number.
|
static Function |
parse(java.lang.String function)
Parse string to function.
|
java.lang.String |
realString()
Real string representation
|
Function |
replace(java.lang.String variable,
double constant)
Replace variable by constant
|
Function |
replace(java.lang.String variable,
Function function)
Replace variable by function
|
Function |
replace(Variable variable,
double constant)
Replace variable by constant
|
abstract Function |
replace(Variable variable,
Function function)
Replace variable by function
|
static void |
setConstantsReferences(ConstantsReferences references)
Modify the constants reference
This reference says what variable name can be replace by constant, example : PI replace by 3.1415926535897932384626433832795 |
Function |
simplify()
Simplify the function
|
Function |
simplifyMaximum()
Simplify at maximum the function
|
Function |
simplifyMaximum(java.io.PrintStream printStream)
Simplify at maximum the function on printing each steps
|
abstract java.lang.String |
toString()
String that represents the function
|
Function |
totalDerive()
Total derive
|
abstract VariableList |
variableList()
Variable list contains in this function
|
protected static ConstantsReferences references
public static final java.util.Comparator<Function> COMPARATOR
private Function.DefaultSimplifier defaultSimplifier
private static java.lang.String addParentheses(java.lang.String string)
string
- String to add parenthesesprivate static boolean isBinaryOperator(char car)
car
- Tested charactertrue
if character is binary operatorprotected static java.lang.String getArgument(java.lang.String string)
string
- String to parsepublic static final boolean allEquals(Function function, Function... functions)
function
- Function referencefunctions
- Functions tests to be equals to the referencestrue
if all functions are equals to the referencepublic static Function createAddition(Function... functions)
functions
- Functions listpublic static Function createMultiplication(Function... functions)
functions
- Functions listpublic static Function parse(java.lang.String function)
Symbol | Explanations |
---|---|
+ | Addition |
- | Subtraction It also represents the unary minus (Take the opposite sign) |
* | Multiplication |
/ | Division |
cos | Cosinus |
exp | Exponential |
ln | Logarithm Neperian |
sin | Sinus |
tan | Tangent |
function
- String to parsepublic static void setConstantsReferences(ConstantsReferences references)
references
- New referenceprotected abstract int compareToInternal(Function function)
function
- Function sure be the instance of the functionprotected boolean functionIsEqualsMoreSimple(Function function)
functionIsEquals(Function)
its use
internally for simplifyMaximum()
function
- Function to compare withtrue
if equalsfunctionIsEqualsMoreSimple(jhelp.util.math.formal.Function)
public int compareTo(Function function)
compareTo
in interface java.lang.Comparable<Function>
function
- Function to compareComparable.compareTo(java.lang.Object)
public final Function derive(java.lang.String variable)
variable
- Variable for derivepublic final Function derive(java.lang.String... list)
list
- Variable listpublic abstract Function derive(Variable variable)
variable
- Variable for derivepublic final Function derive(VariableList list)
list
- Variable listpublic final boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- Tested objecttrue
if equalsObject.equals(java.lang.Object)
public abstract boolean functionIsEquals(Function function)
function
- Function testedtrue
if there sure equals. false
dosen't mean not equals, but not sure about equalitypublic abstract Function getCopy()
public abstract boolean isRealValueNumber()
obtainRealValueNumber()
as as
meaningtrue
if the function can see as real numberpublic FunctionSimplifier obtainFunctionSimplifier()
public abstract double obtainRealValueNumber()
Double.NaN
is returnDouble.NaN
if not definepublic java.lang.String realString()
public final Function replace(java.lang.String variable, double constant)
variable
- Variable to replaceconstant
- Constant for replacepublic final Function replace(java.lang.String variable, Function function)
variable
- Variable to replacefunction
- Function for replacepublic final Function replace(Variable variable, double constant)
variable
- Variable to replaceconstant
- Constant for replacepublic abstract Function replace(Variable variable, Function function)
variable
- Variable to replacefunction
- Function for replacepublic final Function simplify()
public final Function simplifyMaximum()
public final Function simplifyMaximum(java.io.PrintStream printStream)
printStream
- Where print the stepspublic abstract java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public final Function totalDerive()
public abstract VariableList variableList()