Search in sources :

Example 56 with DataIdentifier

use of org.apache.sysml.parser.DataIdentifier in project incubator-systemml by apache.

the class ExternalFunctionProgramBlock method getParameterString.

/**
	 * Given a list of parameters as data identifiers, returns a string
	 * representation.
	 * 
	 * @param params list of data identifiers
	 * @return parameter string
	 */
protected String getParameterString(ArrayList<DataIdentifier> params) {
    String parameterString = "";
    for (int i = 0; i < params.size(); i++) {
        if (i != 0)
            parameterString += ",";
        DataIdentifier param = params.get(i);
        if (param.getDataType() == DataType.MATRIX) {
            String s = getDataTypeString(DataType.MATRIX) + ":";
            s = s + "" + param.getName() + "" + ":";
            s = s + getValueTypeString(param.getValueType());
            parameterString += s;
            continue;
        }
        if (param.getDataType() == DataType.SCALAR) {
            String s = getDataTypeString(DataType.SCALAR) + ":";
            s = s + "" + param.getName() + "" + ":";
            s = s + getValueTypeString(param.getValueType());
            parameterString += s;
            continue;
        }
        if (param.getDataType() == DataType.OBJECT) {
            String s = getDataTypeString(DataType.OBJECT) + ":";
            s = s + "" + param.getName() + "" + ":";
            parameterString += s;
            continue;
        }
    }
    return parameterString;
}
Also used : DataIdentifier(org.apache.sysml.parser.DataIdentifier)

Aggregations

DataIdentifier (org.apache.sysml.parser.DataIdentifier)56 ArrayList (java.util.ArrayList)19 HashMap (java.util.HashMap)13 ParameterExpression (org.apache.sysml.parser.ParameterExpression)13 Hop (org.apache.sysml.hops.Hop)12 Expression (org.apache.sysml.parser.Expression)12 LiteralOp (org.apache.sysml.hops.LiteralOp)10 BinaryExpression (org.apache.sysml.parser.BinaryExpression)8 BuiltinFunctionExpression (org.apache.sysml.parser.BuiltinFunctionExpression)8 Data (org.apache.sysml.runtime.instructions.cp.Data)7 DataGenOp (org.apache.sysml.hops.DataGenOp)6 DataOp (org.apache.sysml.hops.DataOp)6 StatementBlock (org.apache.sysml.parser.StatementBlock)6 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)6 HopsException (org.apache.sysml.hops.HopsException)4 DataType (org.apache.sysml.parser.Expression.DataType)4 ExternalFunctionStatement (org.apache.sysml.parser.ExternalFunctionStatement)4 IterablePredicate (org.apache.sysml.parser.IterablePredicate)4 LanguageException (org.apache.sysml.parser.LanguageException)4 ParForStatement (org.apache.sysml.parser.ParForStatement)4