Examples of ByteVectorIterator


Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    public ByteVector apply(SparseByteVector a, SparseByteVector b) {

        ByteVectorIterator these = a.nonZeroIterator();
        ByteVectorIterator those = b.nonZeroIterator();
        ByteVectorIterator both = these.orElseSubtract(those);

        return both.toVector(factory);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

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

        ByteVector result = a.copy(factory);
        ByteVectorIterator it = b.nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            result.update(it.index(), ByteVectors.asMinusFunction(it.get()));
        }
        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        ensureFactoryIsNotNull(factory);
        ByteVector result = blank(factory);

        if (value != 0) {
            ByteVectorIterator it = nonZeroIterator();
            while (it.hasNext()) {
                it.next();
                result.set(it.index(), aTimesB(value, it.get()));
            }
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        if (value == 0) {
            clear();
        }
        else {
            ByteVectorIterator it = nonZeroIterator();
            while (it.hasNext()) {
                it.next();
                it.set(aTimesB(it.get(), value));
            }
        }
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    public ByteVector apply(SparseByteVector a, SparseByteVector b) {

        ByteVectorIterator these = a.nonZeroIterator();
        ByteVectorIterator those = b.nonZeroIterator();
        ByteVectorIterator both = these.orElseAdd(those);

        return both.toVector(factory);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

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

        ByteVector result = a.copy(factory);
        ByteVectorIterator it = b.nonZeroIterator();
        while (it.hasNext()) {
            it.next();
            result.update(it.index(), ByteVectors.asPlusFunction(it.get()));
        }
        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        ByteVector result = factory.createVector(matrix.columns());

        for (int j = 0; j < matrix.columns(); j++) {
            byte acc = 0;

            ByteVectorIterator it = nonZeroIterator();
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), matrix.get(it.index(), j));
                acc = aPlusB(acc, prod);
            }

            result.set(j, acc);
        }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

        ByteVector result = factory.createVector(matrix.columns());

        for (int j = 0; j < matrix.columns(); j++) {
            byte acc = 0;

            ByteVectorIterator it = nonZeroIterator(fromIndex, toIndex);
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), matrix.get(it.index() - fromIndex, j));
                acc = aPlusB(acc, prod);
            }

            result.set(j, acc);
        }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

    }

    @Override
    public ByteVector apply(SparseByteVector a, SparseByteVector b) {

        ByteVectorIterator these = a.nonZeroIterator();
        ByteVectorIterator those = b.nonZeroIterator();
        ByteVectorIterator both = these.andAlsoMultiply(those);

        return both.toVector(factory);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

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

        ByteVector result = a.blank(factory);
        ByteVectorIterator it = b.nonZeroIterator();

        while (it.hasNext()) {
            it.next();
            result.set(it.index(), aTimesB(it.get(), a.get(it.index())));
        }

        return result;
    }
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.