Esempio n. 1
0
  private void collectOutput(MatrixIndexes indexes, MatrixValue value_out) throws Exception {
    MatrixValue value = outCache.get(indexes);

    try {
      if (value != null) {
        // LOG.info("********** oops, should not run this code1 ***********");
        /*				LOG.info("the output is in the cache");
        				LOG.info("old block");
        				LOG.info(block.toString());
        */
        value.binaryOperationsInPlace(
            ((AggregateBinaryOperator) aggBinInstruction.getOperator()).aggOp.increOp, value_out);

        /*				LOG.info("add block");
        				LOG.info(block_out.toString());
        				LOG.info("result block");
        				LOG.info(block.toString());
        */
      } else if (outCache.size() < OUT_CACHE_SIZE) {
        // LOG.info("********** oops, should not run this code2 ***********");
        value = valueClass.newInstance();
        value.reset(value_out.getNumRows(), value_out.getNumColumns(), value.isInSparseFormat());
        value.binaryOperationsInPlace(
            ((AggregateBinaryOperator) aggBinInstruction.getOperator()).aggOp.increOp, value_out);
        outCache.put(new MatrixIndexes(indexes), value);

        /*				LOG.info("the output is not in the cache");
        				LOG.info("result block");
        				LOG.info(block.toString());
        */
      } else {
        realWriteToCollector(indexes, value_out);
      }
    } catch (DMLUnsupportedOperationException e) {
      throw new IOException(e);
    }
  }
Esempio n. 2
0
 public void set(long ind, MatrixValue b) {
   remainIndex = ind;
   value.copy(b);
 }
Esempio n. 3
0
 public RemainIndexValue(long ind, MatrixValue b) throws Exception {
   remainIndex = ind;
   valueClass = b.getClass();
   value = valueClass.newInstance();
   value.copy(b);
 }