Examples of CCSByteMatrix


Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

public class CCSFactory extends CompressedFactory {

    @Override
    public ByteMatrix createMatrix() {

        return new CCSByteMatrix();
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createMatrix(int rows, int columns) {

        return new CCSByteMatrix(rows, columns);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createMatrix(int rows, int columns, byte[] array) {

        return new CCSByteMatrix(rows, columns, array);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createMatrix(byte[][] array) {

        return new CCSByteMatrix(array);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createMatrix(ByteMatrix matrix) {

        return new CCSByteMatrix(matrix);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createMatrix(MatrixSource source) {

        return new CCSByteMatrix(source);
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    @Override
    public ByteMatrix createConstantMatrix(int rows, int columns, byte value) {

        if (value == 0) {
            return new CCSByteMatrix(rows, columns);
        }
        else {
            byte[][] rowValues = new byte[columns][rows];
            int[][] rowIndices = new int[columns][rows];
            int[] colCardinalities = new int[columns];

            for (int j = 0; j < columns; j++) {
                colCardinalities[j] = rows;
                for (int i = 0; i < rows; i++) {
                    rowValues[j][i] = value;
                    rowIndices[j][i] = i;
                }
            }

            return new CCSByteMatrix(rows, columns, rowValues, rowIndices, colCardinalities);
        }
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    @Override
    public ByteMatrix createRandomMatrix(int rows, int columns, Random random) {

        int cardinality = (rows * columns) / DENSITY;

        ByteMatrix matrix = new CCSByteMatrix(rows, columns);
        for (; cardinality > 0; cardinality--) {
            final int i = random.nextInt(rows);
            final int j = random.nextInt(columns);
            matrix.set(i, j, (byte)random.nextInt());
        }

        return matrix;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    @Override
    public ByteMatrix createRandomSymmetricMatrix(int size, Random random) {

        int cardinality = (size * size) / DENSITY;

        ByteMatrix matrix = new CCSByteMatrix(size, size);
        for (int k = 0; k < cardinality / 2; k++) {
            final int i = random.nextInt(size);
            final int j = random.nextInt(size);
            final byte value = (byte)random.nextInt();

            matrix.set(i, j, value);
            matrix.set(j, i, value);
        }

        return matrix;
    }
View Full Code Here

Examples of net.fec.openrq.util.linearalgebra.matrix.sparse.CCSByteMatrix

    }

    @Override
    public ByteMatrix createSquareMatrix(int size) {

        return new CCSByteMatrix(size, size);
    }
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.