Examples of ByteVector


Examples of de.mpi.rgblab.utils.vector.ByteVector

    // the number of points on the map
    capacity = len;

    x = new ShortVector(len);
    y = new ShortVector(len);
    l = new ByteVector(len);

  }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

    }

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

        ByteVector result = a.blank(factory);
        for (int i = 0; i < b.length(); i++) {
            result.set(i, OctetOps.aMinusB(a.get(i), b.get(i)));
        }
        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

    }

    @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.vector.ByteVector

    }

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

        ByteVector result = factory.createVector(a.length());
        for (int i = 0; i < a.length(); i++) {
            result.set(i, aPlusB(a.get(i), b.get(i)));
        }
        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

    }

    @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.vector.ByteVector

    }

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

        ByteVector result = a.blank(factory);

        for (int i = 0; i < a.length(); i++) {
            result.set(i, aTimesB(a.get(i), b.get(i)));
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

        if (columns() != vector.length()) {
            fail("Wrong vector length: " + vector.length() + ". Should be: " + columns() + ".");
        }

        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);
            }
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

        if (columns() != matrix.rows()) {
            fail("Wrong matrix dimensions: " + matrix.rows() + "x" + matrix.columns() +
                 ". Should be: " + columns() + "x_.");
        }

        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);
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

        if ((toColumn - fromColumn) != matrix.rows()) {
            fail("Wrong matrix dimensions: " + matrix.rows() + "x" + matrix.columns() +
                 ". Should be: " + (toColumn - fromColumn) + "x_.");
        }

        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);
        }

        return result;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.vector.ByteVector

    public ByteVector getRow(int i, Factory factory) {

        Indexables.checkIndexBounds(i, rows());
        ensureFactoryIsNotNull(factory);

        ByteVector result = factory.createVector(columns);

        ByteVectorIterator it = nonZeroRowIterator(i);
        while (it.hasNext()) {
            it.next();
            result.set(it.index(), it.get());
        }

        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.