Examples of DenseLU


Examples of no.uib.cipr.matrix.DenseLU

        rank = comm.rank();
        size = comm.size();

        A0 = new DenseMatrix(size, size);
        b0 = new DenseVector(size);
        lu = new DenseLU(size, size);

        Ai = new double[size];
        if (rank == root) {
            Ai0 = new double[size][size];
            zi0 = new double[size][1];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

        rank = comm.rank();
        size = comm.size();

        A0 = new DenseMatrix(size, size);
        b0 = new DenseVector(size);
        lu = new DenseLU(size, size);

        Ai = new double[size];
        if (rank == root) {
            Ai0 = new double[size][size];
            zi0 = new double[size][1];
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

    I = null;
  }

  public void testDenseLU() {
    int n = A.numRows();
    DenseLU lu = new DenseLU(n, n);
    lu.factor(A.copy());

    lu.solve(I);

    Matrix J = I.mult(A, new DenseMatrix(n, n));
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        if (i != j)
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

          assertEquals(J.get(i, j), 1, 1e-10);
  }

  public void testDenseLUtranspose() {
    int n = A.numRows();
    DenseLU lu = new DenseLU(n, n);
    lu.factor(A.copy());

    lu.transSolve(I);

    Matrix J = I.transAmult(A, new DenseMatrix(n, n));
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        if (i != j)
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

          assertEquals(J.get(i, j), 1, 1e-10);
  }

  public void testDenseLUrcond() {
    int n = A.numRows();
    DenseLU lu = new DenseLU(n, n);
    lu.factor(A.copy());

    lu.rcond(A, Matrix.Norm.One);
    lu.rcond(A, Matrix.Norm.Infinity);
  }
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

    // Permutation matrix:
    // 1.000 0.000 0.000
    // 0.000 0.000 1.000
    // 0.000 1.000 0.000

    DenseLU dlu = DenseLU.factorize(m);

    // check that m = L . U
    Matrix lTimesU = new DenseMatrix(3, 3);
    dlu.getL().mult(dlu.getU(), lTimesU);
    int[] pivots = dlu.getPivots();
    for (MatrixEntry entry : m) {
      int row = entry.row();
      int col = entry.column();
      double val = entry.get();
      double valLU = pivots[row] * lTimesU.get(row, col);
      assert val == valLU : "Row " + row + ", Col " + col
          + " wasn't equal! " + val + " " + valLU;
    }

    Matrix lu = dlu.getLU();
    // m == lu
    for (MatrixEntry entry : m) {
      int row = entry.row();
      int col = entry.column();
      double val = entry.get();
View Full Code Here

Examples of no.uib.cipr.matrix.DenseLU

        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.DenseLU

        A = new FlexCompRowMatrix(n, n);
        Utilities.rowPopulate(A, b);

        // Make it non-singular
        addDiagonal(A, shift);
        DenseLU lu = DenseLU.factorize(A);
        while (lu.isSingular()) {
            addDiagonal(A, shift);
            lu = DenseLU.factorize(A);
        }
    }
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.