Examples of LUDecompositionQuick


Examples of cern.colt.matrix.linalg.LUDecompositionQuick

LU = A.like();
solved = b.like();
//Inv = Factory2D.make(size,size);

LUDecompositionQuick lu = new LUDecompositionQuick();

System.out.println("benchmarking assignment...");
cern.colt.Timer timer = new cern.colt.Timer().start();
LU.assign(A);
solved.assign(b);
timer.stop().display();

LU.assign(A);
lu.decompose(LU);

System.out.println("benchmarking LU...");
timer.reset().start();
for (int i=runs; --i >=0; ) {
  solved.assign(b);
  //Inv.assign(I);
  //lu.decompose(LU);
  lu.solve(solved);
  //lu.solve(Inv);
}
timer.stop().display();

//System.out.println("A="+A);
View Full Code Here

Examples of cern.colt.matrix.linalg.LUDecompositionQuick

LU = A.like();
solved = b.like();
//Inv = Factory2D.make(size,size);

LUDecompositionQuick lu = new LUDecompositionQuick();

System.out.println("benchmarking assignment...");
cern.colt.Timer timer = new cern.colt.Timer().start();
LU.assign(A);
solved.assign(b);
timer.stop().display();

LU.assign(A);
lu.decompose(LU);

System.out.println("benchmarking LU...");
timer.reset().start();
for (int i=runs; --i >=0; ) {
  solved.assign(b);
  //Inv.assign(I);
  //lu.decompose(LU);
  lu.solve(solved);
  //lu.solve(Inv);
}
timer.stop().display();

//System.out.println("A="+A);
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

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

    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");   

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

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

   * 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

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

      solveUsingColt();
  }

  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.