org.apache.sysml.api.jmlc

Class ResultVariables



  • public class ResultVariables
    extends Object
    A ResultVariables object holds the data returned by a call to PreparedScript's executeScript method, which executes a DML/PyDML script.
    • Constructor Detail

      • ResultVariables

        public ResultVariables()
    • Method Detail

      • getVariableNames

        public Set<String> getVariableNames()
        Obtain the output variable names held by this ResultVariables object.
        Returns:
        the set of output variable names
      • size

        public int size()
        Obtain the number of output data held by this ResultVariables object.
        Returns:
        the number of output variables with data
      • getMatrix

        public double[][] getMatrix(String varname)
                             throws DMLException
        Obtain the matrix represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        matrix as a two-dimensional double array
        Throws:
        DMLException - if DMLException occurs
      • getMatrixBlock

        public MatrixBlock getMatrixBlock(String varname)
                                   throws DMLException
        Obtain the matrix represented by the given output variable. Calling this method avoids unnecessary output conversions.
        Parameters:
        varname - output variable name
        Returns:
        matrix as matrix block
        Throws:
        DMLException - if DMLException occurs
      • getFrame

        public String[][] getFrame(String varname)
                            throws DMLException
        Obtain the frame represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        frame as a two-dimensional string array
        Throws:
        DMLException - if DMLException occurs
      • getFrameBlock

        public FrameBlock getFrameBlock(String varname)
                                 throws DMLException
        Obtain the frame represented by the given output variable. Calling this method avoids unnecessary output conversions.
        Parameters:
        varname - output variable name
        Returns:
        frame as a frame block
        Throws:
        DMLException - if DMLException occurs
      • getDouble

        public double getDouble(String varname)
                         throws DMLException
        Obtain the double value represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        double value
        Throws:
        DMLException - if DMLException occurs
      • getBoolean

        public boolean getBoolean(String varname)
                           throws DMLException
        Obtain the boolean value represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        boolean value
        Throws:
        DMLException - if DMLException occurs
      • getLong

        public long getLong(String varname)
                     throws DMLException
        Obtain the long value represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        long value
        Throws:
        DMLException - if DMLException occurs
      • getString

        public String getString(String varname)
                         throws DMLException
        Obtain the string value represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        string value
        Throws:
        DMLException - if DMLException occurs
      • getScalarObject

        public org.apache.sysml.runtime.instructions.cp.ScalarObject getScalarObject(String varname)
                                                                              throws DMLException
        Obtain the ScalarObject represented by the given output variable.
        Parameters:
        varname - output variable name
        Returns:
        ScalarObject
        Throws:
        DMLException - if DMLException occurs
      • addResult

        protected void addResult(String ovar,
                                 org.apache.sysml.runtime.instructions.cp.Data data)
        Add the output variable name and generated output data to the ResultVariable object. Called during the execution of PreparedScript's executeScript method.
        Parameters:
        ovar - output variable name
        data - generated output data

Copyright © 2017 The Apache Software Foundation. All rights reserved.