Package org.apache.sysds.api.jmlc

## Class JMLCUtils

- java.lang.Object
- - org.apache.sysds.api.jmlc.JMLCUtils

    public class JMLCUtils
    extends Object

Utility class containing static methods for working with JMLC.

### Constructor Summary

Constructors
`JMLCUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static ArrayList<Instruction>` `cleanupRuntimeInstructions​(ArrayList<Instruction> insts, String... outputs)` Cleanup runtime instructions, removing rmvar instructions for any of the given output variable names.
`static ArrayList<Instruction>` `cleanupRuntimeInstructions​(ArrayList<Instruction> insts, HashSet<String> outputs)` Cleanup runtime instructions, removing rmvar instructions for any of the given output variable names.
`static void` `cleanupRuntimeProgram​(Program prog, String[] outputs)` Removes rmvar instructions that would remove any of the given outputs.
`static void` `rCleanupRuntimeProgram​(ProgramBlock pb, HashSet<String> outputs)` Cleanup program blocks (called recursively).

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

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

### Constructor Detail

#### JMLCUtils

    public JMLCUtils()

### Method Detail

#### cleanupRuntimeProgram

    public static void cleanupRuntimeProgram​(Program prog,
                                             String[] outputs)

Removes rmvar instructions that would remove any of the given outputs. This is important for keeping registered outputs after the program terminates.

Parameters:
  `prog` - the DML/PyDML program
  `outputs` - registered output variables

#### rCleanupRuntimeProgram

    public static void rCleanupRuntimeProgram​(ProgramBlock pb,
                                              HashSet<String> outputs)

Cleanup program blocks (called recursively).

Parameters:
  `pb` - program block
  `outputs` - registered output variables

#### cleanupRuntimeInstructions

    public static ArrayList<Instruction> cleanupRuntimeInstructions​(ArrayList<Instruction> insts,
                                                                    String... outputs)

Cleanup runtime instructions, removing rmvar instructions for any of the given output variable names.

Parameters:
  `insts` - list of instructions
  `outputs` - registered output variables
Returns:
  list of instructions

#### cleanupRuntimeInstructions

    public static ArrayList<Instruction> cleanupRuntimeInstructions​(ArrayList<Instruction> insts,
                                                                    HashSet<String> outputs)

Cleanup runtime instructions, removing rmvar instructions for any of the given output variable names.

Parameters:
  `insts` - list of instructions
  `outputs` - registered output variables
Returns:
  list of instructions