org.encog.ml.prg.expvalue
Class EvaluateExpr
- java.lang.Object
-
- org.encog.ml.prg.expvalue.EvaluateExpr
-
public final class EvaluateExpr extends java.lang.ObjectSimple utility class that performs some basic operations on ExpressionValue objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static ExpressionValueadd(ExpressionValue a, ExpressionValue b)Perform an add on two expression values.static ExpressionValuediv(ExpressionValue a, ExpressionValue b)Perform a division on two expression values.static ExpressionValueequ(ExpressionValue a, ExpressionValue b)Perform an equal on two expressions.static ExpressionValuemul(ExpressionValue a, ExpressionValue b)Perform a multiply on two expression values.static ExpressionValuenotequ(ExpressionValue a, ExpressionValue b)Perform a non-equal on two expressions.static ExpressionValuepow(ExpressionValue a, ExpressionValue b)Perform a protected div on two expression values.static ExpressionValueprotectedDiv(ExpressionValue a, ExpressionValue b)Perform a protected div on two expression values.static ExpressionValuesub(ExpressionValue a, ExpressionValue b)Perform a subtract on two expression values.
-
-
-
Method Detail
-
add
public static ExpressionValue add(ExpressionValue a, ExpressionValue b)
Perform an add on two expression values. a+b- Parameters:
a- The first argument.b- The second argument.- Returns:
- The result of adding two numbers. Concat for strings. If one is a string, the other is converted to string. If no string, then if one is float, both are converted to int.
-
div
public static ExpressionValue div(ExpressionValue a, ExpressionValue b)
Perform a division on two expression values. a/b An Encog division by zero exception can occur. If one param is a float, the other is converted to a float.- Parameters:
a- The first argument, must be numeric.b- The second argument, must be numeric.- Returns:
- The result of the operation.
-
equ
public static ExpressionValue equ(ExpressionValue a, ExpressionValue b)
Perform an equal on two expressions. Booleans, ints and strings must exactly equal. Floating point must be equal within the default Encog tolerance.- Parameters:
a- The first parameter to check.b- The second parameter to check.- Returns:
- True/false.
-
mul
public static ExpressionValue mul(ExpressionValue a, ExpressionValue b)
Perform a multiply on two expression values. a*b If one param is a float, the other is converted to a float.- Parameters:
a- The first argument, must be numeric.b- The second argument, must be numeric.- Returns:
- The result of the operation.
-
notequ
public static ExpressionValue notequ(ExpressionValue a, ExpressionValue b)
Perform a non-equal on two expressions. Booleans, ints and strings must exactly non-equal. Floating point must be non-equal within the default Encog tolerance.- Parameters:
a- The first parameter to check.b- The second parameter to check.- Returns:
- True/false.
-
pow
public static ExpressionValue pow(ExpressionValue a, ExpressionValue b)
Perform a protected div on two expression values. a/b If one param is a float, the other is converted to a float.- Parameters:
a- The first argument, must be numeric.b- The second argument, must be numeric.- Returns:
- The result of the operation.
-
protectedDiv
public static ExpressionValue protectedDiv(ExpressionValue a, ExpressionValue b)
Perform a protected div on two expression values. a/b Division by zero results in 1.- Parameters:
a- The first argument, must be numeric.b- The second argument, must be numeric.- Returns:
- The result of the operation.
-
sub
public static ExpressionValue sub(ExpressionValue a, ExpressionValue b)
Perform a subtract on two expression values. a-b If one param is a float, the other is converted to a float.- Parameters:
a- The first argument, must be numeric.b- The second argument, must be numeric.- Returns:
- The result of the operation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG