Examples of solveExternally()


Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    DoubleMatrix2D Ax=solver.toDoubleMatrix2D();
    Assert.assertEquals(getExpectedMatrix2DSlowly(gr),Ax);
    if (expectedAx != null) Assert.assertEquals(expectedAx, Ax);
    DoubleMatrix1D b=solver.toDoubleMatrix1D();
    if (expectedB != null) Assert.assertEquals(expectedB, b);Assert.assertEquals(getExpectedMatrix1DSlowly(gr),b);
    solver.solveExternally(1);// check if we have a solution, just in case it fails.

    // Now check consistency.
    gr.config.setAttenuationK_testOnly(1);DoubleMatrix2D Ax1 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    gr.config.setAttenuationK(0);DoubleMatrix2D Ax0 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    DoubleMatrix1D one = DoubleFactory1D.dense.make(Ax1.rows(), 1), a=DoubleFactory1D.dense.make(Ax.rows(), 0);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    DoubleMatrix2D Ax=solver.toDoubleMatrix2D();
    Assert.assertEquals(getExpectedMatrix2DSlowly(gr),Ax);
    if (expectedAx != null) Assert.assertEquals(expectedAx, Ax);
    DoubleMatrix1D b=solver.toDoubleMatrix1D();
    if (expectedB != null) Assert.assertEquals(expectedB, b);Assert.assertEquals(getExpectedMatrix1DSlowly(gr),b);
    solver.solveExternally(1);// check if we have a solution, just in case it fails.

    // Now check consistency.
    gr.config.setAttenuationK_testOnly(1);DoubleMatrix2D Ax1 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    gr.config.setAttenuationK(0);DoubleMatrix2D Ax0 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    DoubleMatrix1D one = DoubleFactory1D.dense.make(Ax1.rows(), 1), a=DoubleFactory1D.dense.make(Ax.rows(), 0);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    DoubleMatrix2D Ax=solver.toDoubleMatrix2D();
    Assert.assertEquals(getExpectedMatrix2DSlowly(gr),Ax);
    if (expectedAx != null) Assert.assertEquals(expectedAx, Ax);
    DoubleMatrix1D b=solver.toDoubleMatrix1D();
    if (expectedB != null) Assert.assertEquals(expectedB, b);Assert.assertEquals(getExpectedMatrix1DSlowly(gr),b);
    solver.solveExternally(1);// check if we have a solution, just in case it fails.

    // Now check consistency.
    gr.config.setAttenuationK_testOnly(1);DoubleMatrix2D Ax1 = ndGraph.buildMatrix(ThreadNumber).toDoubleMatrix2D();
    gr.config.setAttenuationK(0);DoubleMatrix2D Ax0 = ndGraph.buildMatrix(ThreadNumber).toDoubleMatrix2D();
    DoubleMatrix1D one = DoubleFactory1D.dense.make(Ax1.rows(), 1), a=DoubleFactory1D.dense.make(Ax.rows(), 0);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    LSolver s = new LSolver(testMatrix,DoubleFactory1D.dense.make(new double[]{8., 45., -3., 3., 19.}));
    DoubleMatrix1D x = DoubleFactory1D.dense.make(testMatrix.rows());
    for(int i=0;i<s.j_b.length;++i) x.setQuick(i, s.j_b[i]);
   
    // Test 1
    s.solveExternally(1);
    for(int i=0;i<testMatrix.rows();++i)
      Assert.assertEquals(i+1, s.j_x[i],Configuration.fpAccuracy);
    verifyAxb(s);
   
    // Test 2
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

   
    for(int i=0;i<solver.j_b.length;++i) x.setQuick(i, solver.j_b[i]);
   
    checkForCorrectException(new whatToRun() {
      public @Override void run() throws NumberFormatException {
        solver.solveExternally(1);
      }
    }, IllegalArgumentException.class,"singular");   

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

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    long tmFinished = new Date().getTime();
    System.out.println(" time taken: "+((double)tmFinished-tmStarted)/1000);
    verifyAxb(matrix, b, vector);
   
    tmStarted = new Date().getTime();
    solver.solveExternally(1);
    tmFinished = new Date().getTime();
    System.out.println(" time taken: "+((double)tmFinished-tmStarted)/1000);   
    for(int i=0;i<matrix.rows();++i)
      Assert.assertEquals(solver.j_x[i], vector.getQuick(i),Configuration.fpAccuracy);
    verifyAxb(solver);
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

  @Test
  public final void testLargeMatrix1()
  {
    LSolver solver = buildSolver(10000,4);
    long tmStarted = new Date().getTime();
    solver.solveExternally(1);
    long tmFinished = new Date().getTime();
    System.out.println("time taken: "+((double)tmFinished-tmStarted)/1000);
    verifyAxb(solver);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

  }

  @Test
  public final void testLargeMatrix2()
  {
    LSolver solver = buildSolver(15000,3);solver.solveExternally(1);verifyAxb(solver);
  }
}
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    final LSolver solver = new LSolver(matrix,DoubleFactory1D.dense.make(matrix.rows(), 0));

    boolean singular = false;
    try
    {
      solver.solveExternally(1);
    }
    catch(IllegalArgumentException ex)
    {
      if (ex.getMessage().contains("singular"))
        singular = true;
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.LSolver.solveExternally()

    DoubleMatrix2D Ax=solver.toDoubleMatrix2D();
    Assert.assertEquals(getExpectedMatrix2DSlowly(gr),Ax);
    if (expectedAx != null) Assert.assertEquals(expectedAx, Ax);
    DoubleMatrix1D b=solver.toDoubleMatrix1D();
    if (expectedB != null) Assert.assertEquals(expectedB, b);Assert.assertEquals(getExpectedMatrix1DSlowly(gr),b);
    solver.solveExternally(1);// check if we have a solution, just in case it fails.

    // Now check consistency.
    gr.config.setAttenuationK_testOnly(1);DoubleMatrix2D Ax1 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    gr.config.setAttenuationK(0);DoubleMatrix2D Ax0 = ndGraph.buildMatrix(threadNumber).toDoubleMatrix2D();
    DoubleMatrix1D one = DoubleFactory1D.dense.make(Ax1.rows(), 1), a=DoubleFactory1D.dense.make(Ax.rows(), 0);
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.