getNumConstraints() public method

public getNumConstraints ( ) : long
return long
Exemplo n.º 1
0
 public void test_Model_createConstraint()
 {
     Model m = new  Model(2,2);
       Constraint p = m.createConstraint();
       assertTrue( m.getNumConstraints() == 1 );
       assertTrue( (p).getLevel() == 2 );
       assertTrue( (p).getVersion() == 2 );
       m = null;
 }
Exemplo n.º 2
0
 public void test_Model_addConstraint2()
 {
     Model m = new  Model(2,2);
       Constraint c = new  Constraint(2,3);
       c.setMath(libsbml.parseFormula("a+b"));
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumConstraints() == 0 );
       c = null;
       m = null;
 }
Exemplo n.º 3
0
 public void test_Model_addConstraint3()
 {
     Model m = new  Model(2,2);
       Constraint c = null;
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumConstraints() == 0 );
       m = null;
 }
Exemplo n.º 4
0
 public void test_Model_addConstraint1()
 {
     Model m = new  Model(2,2);
       Constraint c = new  Constraint(2,2);
       int i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       c.setMath(libsbml.parseFormula("a+b"));
       i = m.addConstraint(c);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumConstraints() == 1 );
       c = null;
       m = null;
 }