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

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


        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


        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

        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

            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

            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

        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

        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

        ByteVectorIterator it = indexer.nonZeroIterator(b);
        // TODO: these.andAlsoAdd(those)
        // these.andAlsoSubtract(those);
        while (it.hasNext()) {
            it.next();
            a.update(it.index(), ByteVectors.asPlusFunction(it.get()));
        }
        return null;
    }

    @Override
View Full Code Here

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

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

    @Override
View Full Code Here

    public Void apply(DenseByteVector a, SparseByteVector b) {

        ByteVectorIterator it = indexer.nonZeroIterator(b);
        while (it.hasNext()) {
            it.next();
            a.set(it.index(), aPlusB(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.