Package Jama

Examples of Jama.LUDecomposition


        }
        int n = A.getColumnDimension();

        A = A.getMatrix(0, n - 1, 0, n - 1);
        A.set(0, 0, 0.);
        LUDecomposition LU = A.lu();

        try {
            check(A.getMatrix(LU.getPivot(), 0, n - 1),
                    LU.getL().times(LU.getU()));
            try_success("LUDecomposition...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "LUDecomposition...",
                    "incorrect LU decomposition calculation");
        }
View Full Code Here


            print(
                    c < 1 / eps
                            ? fixedWidthDoubletoString(c, 12, 3)
                            : "         Inf");

            LUDecomposition LU = new LUDecomposition(M);
            Matrix L = LU.getL();
            Matrix U = LU.getU();
            int[] p = LU.getPivot();
            Matrix R = L.times(U).minus(M.getMatrix(p, 0, n - 1));
            double res = R.norm1() / (n * eps);

            print(fixedWidthDoubletoString(res, 12, 3));

View Full Code Here

                    hessian[j][i] += r[i] * r[j] * weights[k];
                }
            }
        }

        final LUDecomposition lu = new LUDecomposition(new Matrix(hessian));

        if (lu.isNonsingular()) {
            deltas = lu.solve(gradient);
        } else {
            throw new AIFHError("Matrix Non singular");
        }

        final double[] prev = this.algorithm.getLongTermMemory().clone();
View Full Code Here

   * for each <em>n</em>.
   */
  private Matrix actuallySolveMatrix() {
    MatrixPrimitive prim = this.toMatrixPrimitive();
    Matrix m = new Matrix(prim.body);
    LUDecomposition decomp = new LUDecomposition(m);
    Matrix solution = new Matrix(prim.solution);

    try {
      return decomp.solve(solution);
    } catch (RuntimeException e) {
      if (e.getMessage().equals("Matrix is singular.")) {
        throw new AmbiguousLayoutException();
      } else {
        throw e;
View Full Code Here

TOP

Related Classes of Jama.LUDecomposition

Copyright © 2018 www.massapicom. 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.