Examples of MatrixAccumulator


Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

     *
     * @return a minimum matrix accumulator
     */
    public static MatrixAccumulator mkMinAccumulator() {

        return new MatrixAccumulator() {

            private byte result = maxByte();


            @Override
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

     *
     * @return a maximum matrix accumulator
     */
    public static MatrixAccumulator mkMaxAccumulator() {

        return new MatrixAccumulator() {

            private byte result = minByte();


            @Override
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

     *            the neutral value
     * @return a sum accumulator
     */
    public static MatrixAccumulator asSumAccumulator(final byte neutral) {

        return new MatrixAccumulator() {

            private byte result = neutral;


            @Override
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

     *            the neutral value
     * @return a product accumulator
     */
    public static MatrixAccumulator asProductAccumulator(final byte neutral) {

        return new MatrixAccumulator() {

            private byte result = neutral;


            @Override
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

    public static MatrixAccumulator asFunctionAccumulator(
        final MatrixAccumulator accumulator,
        final MatrixFunction function)
    {

        return new MatrixAccumulator() {

            @Override
            public void update(int i, int j, byte value) {

                accumulator.update(i, j, function.evaluate(i, j, value));
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.functor.MatrixAccumulator

                                                            {1, 0, 2},
                                                            {4, 0, 5},
                                                            {0, 0, 0}
        });

        MatrixAccumulator sum = ByteMatrices.asSumAccumulator((byte)0);
        MatrixAccumulator product = ByteMatrices.asProductAccumulator((byte)1);

        assertEquals(a.foldNonZero(sum), 2);
        // check whether the accumulator were flushed or not
        assertEquals(a.foldNonZero(sum), 2);
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.