Class BinaryRelations
- java.lang.Object
-
- org.mariuszgromada.math.mxparser.mathcollection.BinaryRelations
-
public final class BinaryRelations extends Object
BinaryRelations - class for dealing with binary relations on integers or doubles.- Version:
- 4.1.0
- Author:
- Mariusz Gromada
mariuszgromada.org@gmail.com
MathSpace.pl
MathParser.org - mXparser project page
mXparser on GitHub
mXparser on SourceForge
mXparser on Bitbucket
mXparser on CodePlex
Janet Sudoku - project web page
Janet Sudoku on GitHub
Janet Sudoku on CodePlex
Janet Sudoku on SourceForge
Janet Sudoku on BitBucket
Scalar Free
Scalar Pro
ScalarMath.org
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_COMPARISON_EPSILONDefault epsilon for comparison
-
Constructor Summary
Constructors Constructor Description BinaryRelations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckIfEpsilonMode()Checks if epsilon comparison mode is active;static booleancheckIfExactMode()Checks if exact comparison mode is active;static doubleeq(double a, double b)Equality relation.static doublegeq(double a, double b)Greater or equal relation.static doublegetEpsilon()Returns current epsilon value.static doublegt(double a, double b)Greater than relation.static doubleleq(double a, double b)Lower or equal relation.static doublelt(double a, double b)Lower than relation.static doubleneq(double a, double b)Inequality relation.static voidsetDefaultEpsilon()Sets default epsilon value.static voidsetEpsilon(double epsilon)Sets epsilon value.static voidsetEpsilonComparison()Sets comparison mode to EPSILON.static voidsetExactComparison()Sets comparison mode to EXACT.
-
-
-
Field Detail
-
DEFAULT_COMPARISON_EPSILON
public static final double DEFAULT_COMPARISON_EPSILON
Default epsilon for comparison- See Also:
- Constant Field Values
-
-
Method Detail
-
setExactComparison
public static final void setExactComparison()
Sets comparison mode to EXACT.
-
setEpsilonComparison
public static final void setEpsilonComparison()
Sets comparison mode to EPSILON.
-
setEpsilon
public static final void setEpsilon(double epsilon)
Sets epsilon value.- Parameters:
epsilon- Epsilon value (grater than 0).- See Also:
setEpsilonComparison()
-
setDefaultEpsilon
public static final void setDefaultEpsilon()
Sets default epsilon value.- See Also:
setEpsilonComparison(),DEFAULT_COMPARISON_EPSILON
-
getEpsilon
public static final double getEpsilon()
Returns current epsilon value.- Returns:
- Returns current epsilon value.
- See Also:
setEpsilonComparison()
-
checkIfEpsilonMode
public static final boolean checkIfEpsilonMode()
Checks if epsilon comparison mode is active;- Returns:
- True if epsilon mode is active, otherwise returns false.
- See Also:
setEpsilonComparison(),setExactComparison()
-
checkIfExactMode
public static final boolean checkIfExactMode()
Checks if exact comparison mode is active;- Returns:
- True if exact mode is active, otherwise returns false.
- See Also:
setEpsilonComparison(),setExactComparison()
-
eq
public static final double eq(double a, double b)Equality relation.- Parameters:
a- the a number (a = b)b- the b number (a = b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a = b return 1, otherwise return 0.
-
neq
public static final double neq(double a, double b)Inequality relation.- Parameters:
a- the a number (a <> b)b- the b number (a <> b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a <> b return 1, otherwise return 0.
-
lt
public static final double lt(double a, double b)Lower than relation.- Parameters:
a- the a number (a < b)b- the b number (a < b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a < b return 1, otherwise return 0.
-
gt
public static final double gt(double a, double b)Greater than relation.- Parameters:
a- the a number (a > b)b- the b number (a > b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a > b return 1, otherwise return 0.
-
leq
public static final double leq(double a, double b)Lower or equal relation.- Parameters:
a- the a number (a <= b)b- the b number (a <= b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a <= b return 1, otherwise return 0.
-
geq
public static final double geq(double a, double b)Greater or equal relation.- Parameters:
a- the a number (a >= b)b- the b number (a >= b)- Returns:
- if a = Double.NaN or b = Double.NaN return Double.NaN, else if a >= b return 1, otherwise return 0.
-
-