Examples of DetermineDiagonalAndRightHandSide


Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=buildLearnerGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1", config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing5a()
  {
    LearnerGraph gr=buildLearnerGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1", Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"S","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  {
    Configuration config = Configuration.getDefaultConfiguration().copy();
    LearnerGraph gr=buildLearnerGraph("A-a-#B\nA-b-#B1\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1", config);
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"S","C");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing6a()
  {
    LearnerGraph gr=buildLearnerGraph("A-a-#B\nA-b-#B1\nQ-a->R", "testCountMatchingOutgoing1", Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","R");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  public final void testCountMatchingOutgoing6b()
  {
    LearnerGraph gr=buildLearnerGraph("A-a-#B\nA-b-#B1\nQ-a->R", "testCountMatchingOutgoing1", Configuration.getDefaultConfiguration());
    gr.linear.moveRejectToHighlight();
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_highlight();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","R");
    Assert.assertEquals(0,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing_nd1()
  {
    LearnerGraph gr=buildLearnerGraph("A1-a->C\nA2-a->C\nA3-a->C<-b-G\nB1-a->D<-a-B2\nE-b->D<-b-F", "testCountMatchingOutgoing_nd1", Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixInverse, matcher,"C","D");
    Assert.assertEquals(8,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(8*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.linear.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  public final void testCountMatchingOutgoing_nd2a()
  {
    LearnerGraph gr=buildLearnerGraph("A1-a->C\nA2-a->C\nA3-a->C<-b-G\nB1-a->D<-a-B2\nE-b->D<-b-F\n"
        +"N-c->C", "testCountMatchingOutgoing_nd2a", Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixInverse, matcher,"C","D");
    Assert.assertEquals(8,matcher.getRightHandSide(),Configuration.fpAccuracy);
    Assert.assertEquals(9*2,matcher.getDiagonal(),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

    Assert.assertEquals("right-hand side",matcher.getRightHandSide(),rightHand,Configuration.fpAccuracy);
    Assert.assertEquals("right-hand side",matcher.getDiagonal(),diag,Configuration.fpAccuracy);
   
    // Now copy the matcher and do another computation, with A and B reversed.
    DetermineDiagonalAndRightHandSide anotherMather = null;
    try {// based on http://forums.sun.com/thread.jspa?threadID=767974
      anotherMather = matcher.getClass().getDeclaredConstructor(new Class[]{GDLearnerGraph.class}).newInstance(new Object[]{gdlearnerGraph});
    } catch (Exception e) {
      Assert.fail("Unexpected exception cloning a matcher: "+e);
    }
    anotherMather.compute(gr.findVertex(B),gr.findVertex(A),
        matrixND.transitionMatrix.get(gr.findVertex(B)),matrixND.transitionMatrix.get(gr.findVertex(A)));

    Assert.assertEquals("right-hand side",anotherMather.getRightHandSide(),rightHand,Configuration.fpAccuracy);
    Assert.assertEquals("right-hand side",anotherMather.getDiagonal(),diag,Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing1()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a->B\nA-b->B\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","Q");
    Assert.assertEquals(2,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.GDLearnerGraph.DetermineDiagonalAndRightHandSide

  @Test
  public final void testCountMatchingOutgoing2()
  {
    LearnerGraph gr=new LearnerGraph(FsmParser.buildGraph("A-a->B\nA-b->B\nA-c->C\nQ-a->R\nQ-b->S", "testCountMatchingOutgoing1"), Configuration.getDefaultConfiguration());
    GDLearnerGraph ndGraph = new GDLearnerGraph(gr,LearnerGraphND.ignoreRejectStates, false);
    DetermineDiagonalAndRightHandSide matcher = ndGraph.new DDRH_default();
    getMatcherValue(gr,ndGraph,ndGraph.matrixForward, matcher,"A","A");
    Assert.assertEquals(3,matcher.getRightHandSide(),Configuration.fpAccuracy);
  }
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.