Package org.apache.sysds.runtime.functionobjects

# 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`

Direct Known Subclasses:
  `Max`, `Min`

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 enum`
`Builtin.BuiltinCode`

## Field Summary

Fields
Modifier and Type
Field
Description
`Builtin.BuiltinCode`
`bFunc`
`static HashMap<String,Builtin.BuiltinCode>`
`String2BuiltinCode`

## Method Summary

Modifier and Type
Method
Description
`double`
`execute(double in)`
`long`
`execute(double[] a, double[] c, int start, int end)`
`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`

### Methods inherited from class org.apache.sysds.runtime.functionobjects.FunctionObject

`clone, execute, execute, execute, execute, execute, execute, execute, execute`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### bFunc

public Builtin.BuiltinCode bFunc

### String2BuiltinCode

public static HashMap<String,Builtin.BuiltinCode> String2BuiltinCode

## Method Details

### 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(String str)

### getBuiltinFnObject

public static Builtin getBuiltinFnObject(Builtin.BuiltinCode code)

### execute

public double execute(double in)

Overrides:
  `execute` in class `FunctionObject`

### execute

public long execute(double[] a, double[] c, int start, int end)

### execute

public double execute(long in)

Overrides:
  `execute` in class `FunctionObject`

### execute

public double execute(double in1, double in2)

Overrides:
  `execute` in class `FunctionObject`

### execute

public double execute(long in1, long in2)

Overrides:
  `execute` in class `FunctionObject`

### execute

public String execute(String in1)

Overrides:
  `execute` in class `FunctionObject`

### isBinarySparseSafe

public boolean isBinarySparseSafe()

### toString

public String toString()

Overrides:
  `toString` in class `ValueFunction`