Examples of numColumns()


Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

        for (int i = 0; i < Al.size() - 1; ++i)
            this.A[i] = Al.get(i);

        // Create a LU decomposition of the smallest Galerkin matrix
        DenseMatrix Ac = new DenseMatrix(Al.get(Al.size() - 1));
        lu = new DenseLU(Ac.numRows(), Ac.numColumns());
        lu.factor(Ac);

        // Allocate vectors at each level
        u = new DenseVector[m];
        f = new DenseVector[m];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

    File matrixFile = new File("TestMatrixFile");
    BufferedWriter out = new BufferedWriter(new FileWriter(matrixFile));
    MatrixVectorWriter writer = new MatrixVectorWriter(out);
    MatrixInfo mi = new MatrixInfo(false, MatrixInfo.MatrixField.Real, MatrixInfo.MatrixSymmetry.General);
    writer.printMatrixInfo(mi);
    writer.printMatrixSize(new MatrixSize(mat.numRows(), mat.numColumns(), mat.numColumns() * mat.numRows()), mi);
    writer.printArray(mat.getData());
    writer.close();
    Matrix newMat = new DenseMatrix(new MatrixVectorReader(new FileReader(matrixFile)));

    MatrixTestAbstract.assertEquals(mat, newMat);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

    File matrixFile = new File("TestMatrixFile");
    BufferedWriter out = new BufferedWriter(new FileWriter(matrixFile));
    MatrixVectorWriter writer = new MatrixVectorWriter(out);
    MatrixInfo mi = new MatrixInfo(false, MatrixInfo.MatrixField.Real, MatrixInfo.MatrixSymmetry.General);
    writer.printMatrixInfo(mi);
    writer.printMatrixSize(new MatrixSize(mat.numRows(), mat.numColumns(), mat.numColumns() * mat.numRows()), mi);
    writer.printArray(mat.getData());
    writer.close();
    Matrix newMat = new DenseMatrix(new MatrixVectorReader(new FileReader(matrixFile)));

    MatrixTestAbstract.assertEquals(mat, newMat);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

  }

  public void ignoredTimedMult() {
    Stopwatch watch = Stopwatch.createUnstarted();
    DenseMatrix dense = new DenseMatrix(1000, 1000);
    int[][] nz = Utilities.getRowPattern(dense.numRows(), dense.numColumns(), 100);
    Utilities.rowPopulate(dense, nz);
    log.info("created matrices");
    Matrix sparse = new LinkedSparseMatrix(dense.numRows(), dense.numColumns());
    sparse.set(dense);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

    Stopwatch watch = Stopwatch.createUnstarted();
    DenseMatrix dense = new DenseMatrix(1000, 1000);
    int[][] nz = Utilities.getRowPattern(dense.numRows(), dense.numColumns(), 100);
    Utilities.rowPopulate(dense, nz);
    log.info("created matrices");
    Matrix sparse = new LinkedSparseMatrix(dense.numRows(), dense.numColumns());
    sparse.set(dense);

    for (Matrix m : Lists.newArrayList(dense, sparse)) {
      log.info("starting " + m.getClass());
      Matrix t = new DenseMatrix(m);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

  }

  public void ignoredTimedTransMult() {
    Stopwatch watch = Stopwatch.createUnstarted();
    DenseMatrix dense = new DenseMatrix(1000, 1000);
    int[][] nz = Utilities.getRowPattern(dense.numRows(), dense.numColumns(), 100);
    Utilities.rowPopulate(dense, nz);
    log.info("created matrices");
    Matrix sparse = new LinkedSparseMatrix(dense.numRows(), dense.numColumns());
    sparse.set(dense);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

    Stopwatch watch = Stopwatch.createUnstarted();
    DenseMatrix dense = new DenseMatrix(1000, 1000);
    int[][] nz = Utilities.getRowPattern(dense.numRows(), dense.numColumns(), 100);
    Utilities.rowPopulate(dense, nz);
    log.info("created matrices");
    Matrix sparse = new LinkedSparseMatrix(dense.numRows(), dense.numColumns());
    sparse.set(dense);

    for (Matrix m : Lists.newArrayList(dense, sparse)) {
      log.info("starting " + m.getClass());
      Matrix t = new DenseMatrix(m);
View Full Code Here

Examples of no.uib.cipr.matrix.DenseMatrix.numColumns()

        System.arraycopy(svd.getS(), 0, S.getDiagonal(), 0, svd.getS().length);
        DenseMatrix U = svd.getU();
        DenseMatrix Vt = svd.getVt();

        // Compute U*S*Vt
        Matrix s = U.mult(S.mult(Vt, new DenseMatrix(S.numRows(), Vt
                .numColumns())), new DenseMatrix(A.numRows(), A.numColumns()));

        // Check that A=U*S*Vt
        for (int i = 0; i < A.numRows(); ++i)
            for (int j = 0; j < A.numColumns(); ++j)
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    MatrixInfo.MatrixSymmetry.General);
        MatrixSize size = r.readMatrixSize(info);

        // Resize the matrix to correct size
        numRows = size.numRows();
        numColumns = size.numColumns();
        data = new double[numRows * numColumns];

        // Check that the matrix is in an acceptable format
        if (info.isPattern())
            throw new UnsupportedOperationException(
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    "Complex matrices are not supported");

        // Resize the matrix to correct size
        MatrixSize size = r.readMatrixSize(info);
        numRows = size.numRows();
        numColumns = size.numColumns();

        // Start reading entries
        int numEntries = size.numEntries();
        int[] row = new int[numEntries];
        int[] column = new int[numEntries];
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.