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

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


        ByteMatrix result = blank(factory);

        if (value != 0) {
            for (int i = 0; i < rows(); i++) {
                ByteVectorIterator it = nonZeroRowIterator(i);
                while (it.hasNext()) {
                    it.next();
                    final byte prod = aTimesB(value, it.get());
                    result.set(i, it.index(), prod);
                }
            }
        }

        return result;
View Full Code Here


        ByteVector result = factory.createVector(rows());

        for (int i = 0; i < rows(); i++) {
            byte acc = 0;
            ByteVectorIterator it = nonZeroRowIterator(i);
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), vector.get(it.index()));
                acc = aPlusB(acc, prod);
            }

            if (acc != 0) {
                result.set(i, acc);
View Full Code Here

        ByteMatrix result = factory.createMatrix(rows(), matrix.columns());

        for (int i = 0; i < rows(); i++) {
            for (int j = 0; j < result.columns(); j++) {
                byte acc = 0;
                ByteVectorIterator it = nonZeroRowIterator(i);
                while (it.hasNext()) {
                    it.next();
                    final byte prod = aTimesB(it.get(), matrix.get(it.index(), j));
                    acc = aPlusB(acc, prod);
                }

                if (acc != 0) {
                    result.set(i, j, acc);
View Full Code Here

        ByteMatrix result = factory.createMatrix(toThisRow - fromThisRow, toOtherColumn - fromOtherColumn);

        for (int i = fromThisRow; i < toThisRow; i++) {
            for (int j = fromOtherColumn; j < toOtherColumn; j++) {
                byte acc = 0;
                ByteVectorIterator it = nonZeroRowIterator(i, fromThisColumn, toThisColumn);
                while (it.hasNext()) {
                    it.next();
                    final byte prod = aTimesB(it.get(), matrix.get(it.index(), j));
                    acc = aPlusB(acc, prod);
                }

                if (acc != 0) {
                    result.set(i - fromThisRow, j - fromOtherColumn, acc);
View Full Code Here

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

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

            ByteVectorIterator it = nonZeroRowIterator(i);
            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

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

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

            ByteVectorIterator it = nonZeroRowIterator(i, fromColumn, toColumn);
            while (it.hasNext()) {
                it.next();
                final byte prod = aTimesB(it.get(), matrix.get(it.index() - fromColumn, j));
                acc = aPlusB(acc, prod);
            }

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

        ensureFactoryIsNotNull(factory);

        ByteMatrix result = factory.createMatrix(columns(), rows());

        for (int i = 0; i < rows(); i++) {
            ByteVectorIterator it = nonZeroRowIterator(i);
            while (it.hasNext()) {
                it.next();
                result.set(it.index(), i, it.get());
            }
        }

        return result;
    }
View Full Code Here

    @Override
    public void each(MatrixProcedure procedure) {

        for (int i = 0; i < rows(); i++) {
            ByteVectorIterator it = rowIterator(i);
            while (it.hasNext()) {
                it.next();
                procedure.apply(i, it.index(), it.get());
            }
        }
    }
View Full Code Here

    @Override
    public void eachNonZero(MatrixProcedure procedure) {

        for (int i = 0; i < rows(); i++) {
            ByteVectorIterator it = nonZeroRowIterator(i);
            while (it.hasNext()) {
                it.next();
                procedure.apply(i, it.index(), it.get());
            }
        }
    }
View Full Code Here

    @Override
    public void updateNonZero(MatrixFunction function) {

        for (int i = 0; i < rows(); i++) {
            ByteVectorIterator it = nonZeroRowIterator(i);
            while (it.hasNext()) {
                it.next();
                it.set(function.evaluate(i, it.index(), it.get()));
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.fec.openrq.util.linearalgebra.io.ByteVectorIterator

Copyright © 2018 www.massapicom. 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.