Search in sources :

Example 1 with WeightedPair

use of org.apache.sysml.runtime.matrix.data.WeightedPair in project incubator-systemml by apache.

the class CMCOVMRMapper method specialOperationsForActualMap.

@Override
protected void specialOperationsForActualMap(int index, OutputCollector<Writable, Writable> out, Reporter reporter) throws IOException {
    //apply all instructions
    processMapperInstructionsForMatrix(index);
    for (byte tag : cmTags) {
        CM lcmFn = cmFn.get(tag);
        IndexedMatrixValue input = cachedValues.getFirst(tag);
        if (input == null)
            continue;
        WeightedPair inputPair = (WeightedPair) input.getValue();
        CM_N_COVCell cmValue = (CM_N_COVCell) cmNcovCache.getFirst(tag).getValue();
        try {
            //	System.out.println("~~~~~\nold: "+cmValue.getCM_N_COVObject());
            //	System.out.println("add: "+inputPair);
            lcmFn.execute(cmValue.getCM_N_COVObject(), inputPair.getValue(), inputPair.getWeight());
        //	System.out.println("new: "+cmValue.getCM_N_COVObject());
        } catch (DMLRuntimeException e) {
            throw new IOException(e);
        }
    }
    for (byte tag : covTags) {
        IndexedMatrixValue input = cachedValues.getFirst(tag);
        if (input == null)
            continue;
        //System.out.println("*** cached Value:\n"+cachedValues);
        WeightedPair inputPair = (WeightedPair) input.getValue();
        CM_N_COVCell comValue = (CM_N_COVCell) cmNcovCache.getFirst(tag).getValue();
        try {
            //System.out.println("~~~~~\nold: "+comValue.getCM_N_COVObject());
            //	System.out.println("add: "+inputPair);
            covFn.execute(comValue.getCM_N_COVObject(), inputPair.getValue(), inputPair.getOtherValue(), inputPair.getWeight());
        //	System.out.println("new: "+comValue.getCM_N_COVObject());
        } catch (DMLRuntimeException e) {
            throw new IOException(e);
        }
    }
}
Also used : CM_N_COVCell(org.apache.sysml.runtime.matrix.data.CM_N_COVCell) CM(org.apache.sysml.runtime.functionobjects.CM) IOException(java.io.IOException) WeightedPair(org.apache.sysml.runtime.matrix.data.WeightedPair) DMLRuntimeException(org.apache.sysml.runtime.DMLRuntimeException)

Aggregations

IOException (java.io.IOException)1 DMLRuntimeException (org.apache.sysml.runtime.DMLRuntimeException)1 CM (org.apache.sysml.runtime.functionobjects.CM)1 CM_N_COVCell (org.apache.sysml.runtime.matrix.data.CM_N_COVCell)1 WeightedPair (org.apache.sysml.runtime.matrix.data.WeightedPair)1