Package net.fec.openrq.util.linearalgebra.io

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator.index()


    public void update(VectorFunction function) {

        ByteVectorIterator it = iterator();
        while (it.hasNext()) {
            it.next();
            it.set(function.evaluate(it.index(), it.get()));
        }
    }

    @Override
    public void update(VectorFunction function, int fromIndex, int toIndex) {
View Full Code Here


    public void update(VectorFunction function, int fromIndex, int toIndex) {

        ByteVectorIterator it = iterator(fromIndex, toIndex);
        while (it.hasNext()) {
            it.next();
            it.set(function.evaluate(it.index(), it.get()));
        }
    }

    @Override
    public void updateNonZero(VectorFunction function) {
View Full Code Here

    public void updateNonZero(VectorFunction function) {

        ByteVectorIterator it = nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            it.set(function.evaluate(it.index(), it.get()));
        }
    }

    @Override
    public void updateNonZero(VectorFunction function, int fromIndex, int toIndex) {
View Full Code Here

    public void updateNonZero(VectorFunction function, int fromIndex, int toIndex) {

        ByteVectorIterator it = nonZeroIterator(fromIndex, toIndex);
        while (it.hasNext()) {
            it.next();
            it.set(function.evaluate(it.index(), it.get()));
        }
    }

    @Override
    public byte fold(VectorAccumulator accumulator) {
View Full Code Here

        boolean result = true;
        ByteVectorIterator it = iterator();

        while (it.hasNext()) {
            it.next();
            result = result && predicate.test(it.index(), it.get());
        }

        return result;
    }
View Full Code Here

    public Void apply(SparseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = b.nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            a.update(it.index(), ByteVectors.asMinusFunction(it.get()));
        }
        return null;
    }

    @Override
View Full Code Here

        Serialization.writeVectorLength(buffer, length());
        Serialization.writeVectorCardinality(buffer, cardinality());
        ByteVectorIterator it = nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            Serialization.writeVectorIndex(buffer, it.index());
            Serialization.writeVectorValue(buffer, it.get());
        }

        buffer.rewind();
        return buffer;
View Full Code Here

    @Override
    public Void apply(SparseByteVector a, DenseByteVector b) {

        ByteVectorIterator it = a.iterator();
        while (it.hasNext()) {
            it.set(aMinusB(it.get(), b.get(it.index())));
        }
        return null;
    }

    @Override
View Full Code Here

        Serialization.writeVectorLength(ch, length());
        Serialization.writeVectorCardinality(ch, cardinality());
        ByteVectorIterator it = nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            Serialization.writeVectorIndex(ch, it.index());
            Serialization.writeVectorValue(ch, it.get());
        }
    }

    private int getSerializedDataSize() {
View Full Code Here

    public Void apply(DenseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = b.nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            a.set(it.index(), aMinusB(a.get(it.index()), it.get()));
        }
        return null;
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.