public final class mXparser extends Object
RecursiveArgument,
Expression,
Function,
Constant| Modifier and Type | Field and Description |
|---|---|
static String |
LICENSE
License info.
|
static int |
PRIMES_CACHE_NOT_INITIALIZED |
static PrimesCache |
primesCache
Prime numbers cache
|
| Constructor and Description |
|---|
mXparser() |
| Modifier and Type | Method and Description |
|---|---|
static double[] |
arrayList2double(ArrayList<Double> numbers)
Converts ArrayList of double to double[]
|
static boolean |
checkIfEpsilonMode()
Checks if epsilon comparison mode is active;
|
static boolean |
checkIfExactMode()
Checks if exact comparison mode is active;
|
static boolean |
checkIfUlpRounding()
Double floating-point precision arithmetic causes
rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
additionally doubles are having a lot of advantages
providing flexible number representation regardless of
number size. mXparser is fully based on double numbers
and that is why is providing intelligent ULP rounding
to minimize misleading results.
|
static void |
consolePrint(Object o)
Prints object.toString to the Console
|
static void |
consolePrintHelp()
Prints all help content.
|
static void |
consolePrintHelp(String word)
Prints filtered help content.
|
static void |
consolePrintln()
Prints new line to the Console, no new line
|
static void |
consolePrintln(Object o)
Prints object.toString to the Console + new line
|
static void |
consolePrintTokens(ArrayList<Token> tokens)
Prints tokens to the console.
|
static void |
disableUlpRounding()
Double floating-point precision arithmetic causes
rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
additionally doubles are having a lot of advantages
providing flexible number representation regardless of
number size. mXparser is fully based on double numbers
and that is why is providing intelligent ULP rounding
to minimize misleading results.
|
static void |
enableUlpRounding()
Double floating-point precision arithmetic causes
rounding problems, i.e. 0.1 + 0.1 + 0.1 is slightly different than 0.3,
additionally doubles are having a lot of advantages
providing flexible number representation regardless of
number size. mXparser is fully based on double numbers
and that is why is providing intelligent ULP rounding
to minimize misleading results.
|
static String |
getConsoleOutput()
Returns console output string, console output string
is being built by consolePrintln(), consolePrint().
|
static double |
getEpsilon()
Returns current epsilon value.
|
static double |
getFunctionValue(Expression f,
Argument x,
double x0)
Calculates function f(x0) (given as expression) assigning Argument x = x0;
|
static double[] |
getFunctionValues(Expression f,
Argument index,
double from,
double to,
double delta)
Returns array of double values of the function f(i)
calculated on the range: i = from to i = to by step = delta
|
static String |
getHelp()
General mXparser expression help
|
static String |
getHelp(String word)
General mXparser expression help - in-line key word searching
|
String |
getLicense()
Gets license info
|
static int |
getMaxNumInPrimesCache()
Returns maximum integer number in primes cache
|
static int |
getThreadsNumber()
Gets maximum threads number
|
static String |
hexString2AsciiString(String hexString)
Converts hex string into ASCII string, where each letter is
represented by two hex digits (byte) from the hex string.
|
static void |
initPrimesCache()
Initialization of prime numbers cache.
|
static void |
initPrimesCache(int mximumNumberInCache)
Initialization of prime numbers cache.
|
static void |
initPrimesCache(PrimesCache primesCache)
Initialization of prime numbers cache.
|
static String |
numberToAsciiString(double number)
Converts (long)double number into ASCII string, where each letter is
represented by two hex digits (byte) from the hex representation
of the original number casted to long type.
|
static String |
numberToAsciiString(int number)
Converts number into ASCII string, where each letter is
represented by two hex digits (byte) from the hex representation
of the original number
|
static String |
numberToAsciiString(long number)
Converts number into ASCII string, where each letter is
represented by two hex digits (byte) from the hex representation
of the original number
|
static String |
numberToHexString(double number)
Converts (long)double number to hex string (plain text)
|
static String |
numberToHexString(int number)
Converts integer number to hex string (plain text)
|
static String |
numberToHexString(long number)
Converts long number to hex string (plain text)
|
static void |
resetConsoleOutput()
Resets console output string, console output
string is being built by consolePrintln(), consolePrint().
|
void |
setConsoleOutputPrefix(String consoleOutputPrefix)
Sets console output string prefix.
|
void |
setConsolePrefix(String consolePrefix)
Sets console prefix.
|
void |
setDefaultConsoleOutputPrefix()
Sets default console output string prefix.
|
void |
setDefaultConsolePrefix()
Sets default console prefix.
|
static void |
setDefaultEpsilon()
Sets default epsilon value.
|
static void |
setDefaultThreadsNumber()
Sets default threads number
|
static void |
setEpsilon(double epsilon)
Sets epsilon value.
|
static void |
setEpsilonComparison()
Sets comparison mode to EPSILON.
|
static void |
setExactComparison()
Sets comparison mode to EXACT.
|
static void |
setNoPrimesCache()
Sets
primesCache to null |
static void |
setRandomGenerator(Random randomGenerator)
Modifies random generator used by the ProbabilityDistributions class.
|
static void |
setThreadsNumber(int threadsNumber)
Sets threads number
|
static void |
wait(int n)
Waits given number of milliseconds
|
public static PrimesCache primesCache
public static final int PRIMES_CACHE_NOT_INITIALIZED
public static final String LICENSE
public static final void initPrimesCache()
PrimesCache.DEFAULT_MAX_NUM_IN_CACHEPrimesCachepublic static final void initPrimesCache(int mximumNumberInCache)
mximumNumberInCache - The maximum integer number that
will be stored in cache.PrimesCachepublic static final void initPrimesCache(PrimesCache primesCache)
primesCache - The primes cache objectPrimesCachepublic static void setNoPrimesCache()
primesCache to nullpublic static final int getMaxNumInPrimesCache()
PRIMES_CACHE_NOT_INITIALIZEDpublic static final int getThreadsNumber()
public static final void setDefaultThreadsNumber()
public static final void setThreadsNumber(int threadsNumber)
threadsNumber - Thread number.public static final double getFunctionValue(Expression f, Argument x, double x0)
f - the expressionx - the argumentx0 - the argument valueExpressionpublic static final double[] arrayList2double(ArrayList<Double> numbers)
numbers - the numbers listpublic static final double[] getFunctionValues(Expression f, Argument index, double from, double to, double delta)
f - Function expressionindex - Index argumentfrom - 'from' valueto - 'to' valuedelta - 'delta' step definitionpublic static final void setRandomGenerator(Random randomGenerator)
randomGenerator - Random generator.ProbabilityDistributions,
ProbabilityDistributions.randomGeneratorpublic static final void setExactComparison()
BinaryRelationspublic static final void setEpsilonComparison()
BinaryRelationspublic static final void setEpsilon(double epsilon)
epsilon - Epsilon value (grater than 0).setEpsilonComparison(),
BinaryRelationspublic static final void setDefaultEpsilon()
public static final double getEpsilon()
setEpsilonComparison(),
BinaryRelationspublic static final boolean checkIfEpsilonMode()
setEpsilonComparison(),
setExactComparison(),
BinaryRelationspublic static final boolean checkIfExactMode()
setEpsilonComparison(),
setExactComparison(),
BinaryRelationspublic static final void enableUlpRounding()
public static final void disableUlpRounding()
public static final boolean checkIfUlpRounding()
public static final String numberToHexString(int number)
number - Integer numberpublic static final String numberToHexString(long number)
number - Long numberpublic static final String numberToHexString(double number)
number - Double numberpublic static final String hexString2AsciiString(String hexString)
hexString - Hex string (i.e. 48656C6C6F)public static final String numberToAsciiString(int number)
number - Integer number (i.e. 310939249775 = '48656C6C6F')public static final String numberToAsciiString(long number)
number - Long number (i.e. 310939249775 = '48656C6C6F')public static final String numberToAsciiString(double number)
number - Double number (i.e. 310939249775 = '48656C6C6F')public static final void consolePrintln(Object o)
o - Object to printpublic static final void consolePrintln()
public static final void consolePrint(Object o)
o - Object to printpublic static final void resetConsoleOutput()
public void setDefaultConsolePrefix()
public void setDefaultConsoleOutputPrefix()
public void setConsolePrefix(String consolePrefix)
consolePrefix - String containing console prefix definition.public void setConsoleOutputPrefix(String consoleOutputPrefix)
consoleOutputPrefix - String containing console output prefix definition.public static final String getConsoleOutput()
consolePrint(Object),
consolePrintln(Object),
consolePrintln(),
resetConsoleOutput()public static final String getHelp()
public static final String getHelp(String word)
word - Key word to be searchedpublic static final void consolePrintHelp()
public static final void consolePrintHelp(String word)
word - Key word.public static final void consolePrintTokens(ArrayList<Token> tokens)
tokens - Tokens list.Expression.getCopyOfInitialTokens(),
Tokenpublic String getLicense()
public static void wait(int n)
n - Number of millisecondsCopyright © 2017. All rights reserved.