use of org.apache.sysml.runtime.matrix.operators.ReIndexOperator in project incubator-systemml by apache.
the class RangeBasedReIndexInstruction method parseInstruction.
public static RangeBasedReIndexInstruction parseInstruction(String str) {
InstructionUtils.checkNumFields(str, 8);
String[] parts = InstructionUtils.getInstructionParts(str);
String opcode = parts[0];
boolean forLeft = false;
if (opcode.equalsIgnoreCase(RightIndex.OPCODE + "ForLeft"))
forLeft = true;
else if (!opcode.equalsIgnoreCase(RightIndex.OPCODE))
throw new DMLRuntimeException("Unknown opcode while parsing a Select: " + str);
byte in = Byte.parseByte(parts[1]);
IndexRange rng = new IndexRange(UtilFunctions.parseToLong(parts[2]), UtilFunctions.parseToLong(parts[3]), UtilFunctions.parseToLong(parts[4]), UtilFunctions.parseToLong(parts[5]));
byte out = Byte.parseByte(parts[6]);
long rlen = Long.parseLong(parts[7]);
long clen = Long.parseLong(parts[8]);
return new RangeBasedReIndexInstruction(new ReIndexOperator(), in, out, rng, forLeft, rlen, clen, str);
}
use of org.apache.sysml.runtime.matrix.operators.ReIndexOperator in project systemml by apache.
the class RangeBasedReIndexInstruction method parseInstruction.
public static RangeBasedReIndexInstruction parseInstruction(String str) {
InstructionUtils.checkNumFields(str, 8);
String[] parts = InstructionUtils.getInstructionParts(str);
String opcode = parts[0];
boolean forLeft = false;
if (opcode.equalsIgnoreCase(RightIndex.OPCODE + "ForLeft"))
forLeft = true;
else if (!opcode.equalsIgnoreCase(RightIndex.OPCODE))
throw new DMLRuntimeException("Unknown opcode while parsing a Select: " + str);
byte in = Byte.parseByte(parts[1]);
IndexRange rng = new IndexRange(UtilFunctions.parseToLong(parts[2]), UtilFunctions.parseToLong(parts[3]), UtilFunctions.parseToLong(parts[4]), UtilFunctions.parseToLong(parts[5]));
byte out = Byte.parseByte(parts[6]);
long rlen = Long.parseLong(parts[7]);
long clen = Long.parseLong(parts[8]);
return new RangeBasedReIndexInstruction(new ReIndexOperator(), in, out, rng, forLeft, rlen, clen, str);
}
Aggregations