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 class
Builtin.BuiltinCode
-
Field Summary
Fields Modifier and Type Field Description Builtin.BuiltinCode
bFunc
static HashMap<String,Builtin.BuiltinCode>
String2BuiltinCode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
execute(double in)
double
execute(double in1, double in2)
double
execute(long in)
double
execute(long in1, long in2)
String
execute(String in1)
Builtin.BuiltinCode
getBuiltinCode()
static Builtin
getBuiltinFnObject(String str)
static Builtin
getBuiltinFnObject(Builtin.BuiltinCode code)
boolean
isBinarySparseSafe()
static boolean
isBuiltinCode(ValueFunction fn, Builtin.BuiltinCode... codes)
static boolean
isBuiltinFnObject(String str)
String
toString()
-
Methods inherited from class org.apache.sysds.runtime.functionobjects.ValueFunction
isBinary, 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:
execute
in classFunctionObject
-
execute
public double execute(long in)
- Overrides:
execute
in classFunctionObject
-
execute
public double execute(double in1, double in2)
- Overrides:
execute
in classFunctionObject
-
execute
public double execute(long in1, long in2)
- Overrides:
execute
in classFunctionObject
-
execute
public String execute(String in1)
- Overrides:
execute
in classFunctionObject
-
isBinarySparseSafe
public boolean isBinarySparseSafe()
-
toString
public String toString()
- Overrides:
toString
in classValueFunction
-
-