コード例 #1
0
    @Override
    public MatrixBlock call(MatrixBlock arg0) throws Exception {
      MatrixBlock pmV = _pmV.getMatrixBlock(1, 1);

      // execute mapmmchain operation
      MatrixBlock out = new MatrixBlock();
      return arg0.chainMatrixMultOperations(pmV, null, out, ChainType.XtXv);
    }
コード例 #2
0
    @Override
    public Tuple2<MatrixIndexes, MatrixBlock> call(Tuple2<MatrixIndexes, MatrixBlock> arg0)
        throws Exception {
      MatrixBlock pmV = _pmV.getMatrixBlock(1, 1);

      MatrixIndexes ixIn = arg0._1();
      MatrixBlock blkIn = arg0._2();
      int rowIx = (int) ixIn.getRowIndex();

      MatrixIndexes ixOut = new MatrixIndexes(1, 1);
      MatrixBlock blkOut = new MatrixBlock();

      // execute mapmmchain operation
      blkIn.chainMatrixMultOperations(pmV, _pmW.getMatrixBlock(rowIx, 1), blkOut, ChainType.XtwXv);

      // output new tuple
      return new Tuple2<MatrixIndexes, MatrixBlock>(ixOut, blkOut);
    }