use of org.apache.sysml.runtime.matrix.data.TaggedMatrixValue in project incubator-systemml by apache.
the class ReduceBase method processAggregateInstructions.
// process all the aggregate instructions for one group of values
protected void processAggregateInstructions(MatrixIndexes indexes, Iterator<TaggedMatrixValue> values, boolean imbededCorrection) throws IOException {
try {
while (values.hasNext()) {
TaggedMatrixValue value = values.next();
byte input = value.getTag();
ArrayList<AggregateInstruction> instructions = agg_instructions.get(input);
// if there is no specified aggregate operation on an input, by default apply sum
if (instructions == null) {
defaultAggIns.input = input;
defaultAggIns.output = input;
processAggregateHelp(indexes.getRowIndex(), indexes.getColumnIndex(), value.getBaseObject(), defaultAggIns, imbededCorrection);
} else // otherwise, perform the specified aggregate instructions
{
for (AggregateInstruction ins : instructions) processAggregateHelp(indexes.getRowIndex(), indexes.getColumnIndex(), value.getBaseObject(), ins, imbededCorrection);
}
}
} catch (Exception e) {
throw new IOException(e);
}
}
use of org.apache.sysml.runtime.matrix.data.TaggedMatrixValue in project systemml by apache.
the class ReduceBase method processAggregateInstructions.
// process all the aggregate instructions for one group of values
protected void processAggregateInstructions(MatrixIndexes indexes, Iterator<TaggedMatrixValue> values, boolean imbededCorrection) throws IOException {
try {
while (values.hasNext()) {
TaggedMatrixValue value = values.next();
byte input = value.getTag();
ArrayList<AggregateInstruction> instructions = agg_instructions.get(input);
// if there is no specified aggregate operation on an input, by default apply sum
if (instructions == null) {
defaultAggIns.input = input;
defaultAggIns.output = input;
processAggregateHelp(indexes.getRowIndex(), indexes.getColumnIndex(), value.getBaseObject(), defaultAggIns, imbededCorrection);
} else // otherwise, perform the specified aggregate instructions
{
for (AggregateInstruction ins : instructions) processAggregateHelp(indexes.getRowIndex(), indexes.getColumnIndex(), value.getBaseObject(), ins, imbededCorrection);
}
}
} catch (Exception e) {
throw new IOException(e);
}
}
Aggregations