Search in sources :

Example 1 with BinaryBlockToTextCellConverter

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

the class ConvertMatrixBlockToIJVLines method call.

@Override
public Iterator<String> call(Tuple2<MatrixIndexes, MatrixBlock> kv) throws Exception {
    final BinaryBlockToTextCellConverter converter = new BinaryBlockToTextCellConverter();
    converter.setBlockSize(brlen, bclen);
    converter.convert(kv._1, kv._2);
    Iterable<String> ret = new Iterable<String>() {

        @Override
        public Iterator<String> iterator() {
            return new Iterator<String>() {

                @Override
                public void remove() {
                }

                @Override
                public String next() {
                    return converter.next().getValue().toString();
                }

                @Override
                public boolean hasNext() {
                    return converter.hasNext();
                }
            };
        }
    };
    return ret.iterator();
}
Also used : Iterator(java.util.Iterator) BinaryBlockToTextCellConverter(org.apache.sysml.runtime.matrix.data.BinaryBlockToTextCellConverter)

Aggregations

Iterator (java.util.Iterator)1 BinaryBlockToTextCellConverter (org.apache.sysml.runtime.matrix.data.BinaryBlockToTextCellConverter)1