Class Builtin
- java.lang.Object
-
- org.apache.sysds.runtime.functionobjects.FunctionObject
-
- org.apache.sysds.runtime.functionobjects.ValueFunction
-
- org.apache.sysds.runtime.functionobjects.Builtin
-
- All Implemented Interfaces:
Serializable
public class Builtin extends ValueFunction
Class with pre-defined set of objects. This class can not be instantiated elsewhere. Notes on commons.math FastMath: * FastMath uses lookup tables and interpolation instead of native calls. * The memory overhead for those tables is roughly 48KB in total (acceptable) * Micro and application benchmarks showed significantly (30%-3x) performance improvements for most operations; without loss of accuracy. * atan / sqrt were 20% slower in FastMath and hence, we use Math there * round / abs were equivalent in FastMath and hence, we use Math there * Finally, there is just one argument against FastMath - The comparison heavily depends on the JVM. For example, currently the IBM JDK JIT compiles to HW instructions for sqrt which makes this operation very efficient; as soon as other operations like log/exp are similarly compiled, we should rerun the micro benchmarks, and switch back if necessary.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuiltin.BuiltinCode
-
Field Summary
Fields Modifier and Type Field Description Builtin.BuiltinCodebFuncstatic HashMap<String,Builtin.BuiltinCode>String2BuiltinCode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleexecute(double in)doubleexecute(double in1, double in2)doubleexecute(long in)doubleexecute(long in1, long in2)Stringexecute(String in1)Builtin.BuiltinCodegetBuiltinCode()static BuiltingetBuiltinFnObject(String str)static BuiltingetBuiltinFnObject(Builtin.BuiltinCode code)static booleanisBuiltinCode(ValueFunction fn, Builtin.BuiltinCode... codes)static booleanisBuiltinFnObject(String str)StringtoString()-
Methods inherited from class org.apache.sysds.runtime.functionobjects.ValueFunction
requiresCorrection
-
-
-
-
Field Detail
-
bFunc
public Builtin.BuiltinCode bFunc
-
String2BuiltinCode
public static HashMap<String,Builtin.BuiltinCode> String2BuiltinCode
-
-
Method Detail
-
getBuiltinCode
public Builtin.BuiltinCode getBuiltinCode()
-
isBuiltinCode
public static boolean isBuiltinCode(ValueFunction fn, Builtin.BuiltinCode... codes)
-
isBuiltinFnObject
public static boolean isBuiltinFnObject(String str)
-
getBuiltinFnObject
public static Builtin getBuiltinFnObject(Builtin.BuiltinCode code)
-
execute
public double execute(double in)
- Overrides:
executein classFunctionObject
-
execute
public double execute(long in)
- Overrides:
executein classFunctionObject
-
execute
public double execute(double in1, double in2)- Overrides:
executein classFunctionObject
-
execute
public double execute(long in1, long in2)- Overrides:
executein classFunctionObject
-
execute
public String execute(String in1)
- Overrides:
executein classFunctionObject
-
-