Examples of LUDecompositionQuick


Examples of cern.colt.matrix.linalg.LUDecompositionQuick

    for(int i=0;i<testMatrix.rows();++i)
      Assert.assertEquals(i+1, s.j_x[i],comparisonAccuracy);
    verifyAxb(s);
   
    // Test 2
    LUDecompositionQuick solver = new LUDecompositionQuick();
    solver.decompose(testMatrix);solver.setLU(testMatrix);
    solver.solve(x);
    for(int i=0;i<testMatrix.rows();++i)
      Assert.assertEquals(i+1, x.getQuick(i),comparisonAccuracy);
    verifyAxb(s);

    // Test 3
View Full Code Here

Examples of cern.colt.matrix.linalg.LUDecompositionQuick

      }
    }, IllegalArgumentException.class,"singular");   

    checkForCorrectException(new whatToRun() {
      public void run() throws NumberFormatException {
        LUDecompositionQuick coltSolver = new LUDecompositionQuick();
        coltSolver.decompose(matrix);coltSolver.setLU(matrix);
        coltSolver.solve(x);
      }
    }, IllegalArgumentException.class,"singular");   

    checkForCorrectException(new whatToRun() {
      public void run() throws NumberFormatException {
View Full Code Here

Examples of cern.colt.matrix.linalg.LUDecompositionQuick

    final DoubleMatrix1D b = DoubleFactory1D.dense.make(size);
    b.assign(randomGenerator);

    final LSolver solver = new LSolver(matrix,b);
    long tmStarted = new Date().getTime();
    LUDecompositionQuick coltSolver = new LUDecompositionQuick();
    coltSolver.decompose(matrix);coltSolver.setLU(matrix);
   
    DoubleMatrix1D vector = b.copy();
    coltSolver.solve(vector);
    long tmFinished = new Date().getTime();
    System.out.println(" time taken: "+((double)tmFinished-tmStarted)/1000);
    verifyAxb(matrix, b, vector);
   
    tmStarted = new Date().getTime();
View Full Code Here

Examples of cern.colt.matrix.linalg.LUDecompositionQuick

    }
   
    if (!singular)
      TestSolver.verifyAxb(solver);
   
    LUDecompositionQuick coltSolver = new LUDecompositionQuick();
    coltSolver.decompose(matrix);coltSolver.setLU(matrix);
    DoubleMatrix1D vector = DoubleFactory1D.dense.make(matrix.rows(), 0);
   
    try
    {
      coltSolver.solve(vector);
    }
    catch(IllegalArgumentException ex)
    {
      if (ex.getMessage().contains("singular"))
        Assert.assertTrue(singular);
View Full Code Here

Examples of cern.colt.matrix.linalg.LUDecompositionQuick

   * to Colt format, followed by running Colt itself. Hence all this is
   * extremely slow.
   */ 
  public void solveUsingColt()
  {
    LUDecompositionQuick solver = new LUDecompositionQuick();
    DoubleMatrix2D matrix = toDoubleMatrix2D();
    solver.decompose(matrix);solver.setLU(matrix);
    DoubleMatrix1D result = toDoubleMatrix1D();
    solver.solve(result);result.toArray(j_x);   
  }
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.