当前位置: 首页>>代码示例>>C#>>正文


C# ASTNode.getReal方法代码示例

本文整理汇总了C#中libsbmlcs.ASTNode.getReal方法的典型用法代码示例。如果您正苦于以下问题:C# ASTNode.getReal方法的具体用法?C# ASTNode.getReal怎么用?C# ASTNode.getReal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbmlcs.ASTNode的用法示例。


在下文中一共展示了ASTNode.getReal方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: test_element_constants_notanumber

 public void test_element_constants_notanumber()
 {
     string s = wrapMathML("<notanumber/>");
       N = libsbml.readMathMLFromString(s);
       assertTrue( N != null );
       assertTrue( N.getType() == libsbml.AST_REAL );
       assertEquals( true, isnan(N.getReal()) );
       assertTrue( N.getNumChildren() == 0 );
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:9,代码来源:TestReadMathML.cs

示例2: test_element_cn_units

 public void test_element_cn_units()
 {
     string s = wrapMathMLUnits("<cn sbml:units=\"mole\"> 12345.7 </cn>");
       N = libsbml.readMathMLFromString(s);
       assertTrue( N != null );
       assertTrue( N.getType() == libsbml.AST_REAL );
       assertTrue( N.getReal() == 12345.7 );
       assertTrue( N.getUnits() ==  "mole"    );
       assertTrue( N.getNumChildren() == 0 );
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:10,代码来源:TestReadMathML.cs

示例3: test_element_constants_infinity

 public void test_element_constants_infinity()
 {
     string s = wrapMathML("<infinity/>");
       N = libsbml.readMathMLFromString(s);
       assertTrue( N != null );
       assertTrue( N.getType() == libsbml.AST_REAL );
       assertTrue( util_isInf(N.getReal()) == true );
       assertTrue( N.getNumChildren() == 0 );
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:9,代码来源:TestReadMathML.cs

示例4: test_ASTNode_avogadro_bug

 public void test_ASTNode_avogadro_bug()
 {
     double val;
       ASTNode n = new  ASTNode();
       n.setName( "NA");
       n.setType(libsbml.AST_NAME_AVOGADRO);
       assertTrue((  "NA" == n.getName() ));
       val = n.getReal();
       assertTrue( val == 6.02214179e23 );
       assertTrue( n.isConstant() == true );
       n = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:12,代码来源:TestASTNode.cs

示例5: test_element_cn_real

 public void test_element_cn_real()
 {
     string s = wrapMathML("<cn type='real'> 12345.7 </cn>");
       N = libsbml.readMathMLFromString(s);
       assertTrue( N != null );
       assertTrue( N.getType() == libsbml.AST_REAL );
       assertTrue( N.getReal() == 12345.7 );
       assertTrue( N.getNumChildren() == 0 );
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:9,代码来源:TestReadMathML.cs

示例6: test_ASTNode_setCharacter

 public void test_ASTNode_setCharacter()
 {
     ASTNode node = new  ASTNode();
       node.setName( "foo");
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue((  "foo" == node.getName() ));
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '+');
       assertTrue( node.getType() == libsbml.AST_PLUS );
       assertTrue( node.getCharacter() == '+' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '-');
       assertTrue( node.getType() == libsbml.AST_MINUS );
       assertTrue( node.getCharacter() == '-' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '*');
       assertTrue( node.getType() == libsbml.AST_TIMES );
       assertTrue( node.getCharacter() == '*' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '/');
       assertTrue( node.getType() == libsbml.AST_DIVIDE );
       assertTrue( node.getCharacter() == '/' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '^');
       assertTrue( node.getType() == libsbml.AST_POWER );
       assertTrue( node.getCharacter() == '^' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setCharacter( '$');
       assertTrue( node.getType() == libsbml.AST_UNKNOWN );
       assertTrue( node.getCharacter() == '$' );
       assertTrue( node.getName() == null );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:61,代码来源:TestASTNode.cs

示例7: test_ASTNode_getReal

 public void test_ASTNode_getReal()
 {
     double val;
       ASTNode n = new  ASTNode();
       n.setType(libsbml.AST_REAL);
       n.setValue(1.6);
       assertTrue( n.getReal() == 1.6 );
       n.setType(libsbml.AST_REAL_E);
       n.setValue(12.3,3);
       val = Math.Abs(n.getReal() - 12300.0);
       assertTrue( val < DBL_EPSILON );
       n.setType(libsbml.AST_RATIONAL);
       n.setValue(1,2);
       assertTrue( n.getReal() == 0.5 );
       n = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:16,代码来源:TestASTNode.cs

示例8: test_ASTNode_setReal

 public void test_ASTNode_setReal()
 {
     ASTNode node = new  ASTNode();
       node.setName( "foo");
       assertTrue( node.getType() == libsbml.AST_NAME );
       node.setValue(32.1);
       assertTrue( node.getType() == libsbml.AST_REAL );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 32.1 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       assertTrue( node.getMantissa() == 32.1 );
       node.setValue(45,90);
       assertTrue( node.getType() == libsbml.AST_RATIONAL );
       assertTrue( node.getInteger() == 45 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 0.5 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 90 );
       assertTrue( node.getMantissa() == 0 );
       node.setValue(32.0,4);
       assertTrue( node.getType() == libsbml.AST_REAL_E );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 320000 );
       assertTrue( node.getExponent() == 4 );
       assertTrue( node.getDenominator() == 1 );
       assertTrue( node.getMantissa() == 32 );
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:34,代码来源:TestASTNode.cs

示例9: test_ASTNode_setName

 public void test_ASTNode_setName()
 {
     string name =  "foo";
       ASTNode node = new  ASTNode();
       assertTrue( node.getType() == libsbml.AST_UNKNOWN );
       node.setName(name);
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue(( name == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       if (node.getName() == name);
       {
       }
       node.setName(null);
       assertTrue( node.getType() == libsbml.AST_NAME );
       if (node.getName() != null);
       {
       }
       node.setType(libsbml.AST_FUNCTION_COS);
       assertTrue( node.getType() == libsbml.AST_FUNCTION_COS );
       assertTrue((  "cos" == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setType(libsbml.AST_PLUS);
       node.setName(name);
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue(( name == node.getName() ));
       assertTrue( node.getCharacter() == '+' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:40,代码来源:TestASTNode.cs

示例10: test_ASTNode_setInteger

 public void test_ASTNode_setInteger()
 {
     ASTNode node = new  ASTNode();
       node.setName( "foo");
       assertTrue( node.getType() == libsbml.AST_NAME );
       assertTrue((  "foo" == node.getName() ));
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setValue(3.2);
       assertTrue( node.getType() == libsbml.AST_REAL );
       assertTrue( node.getInteger() == 0 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 3.2 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node.setValue(321);
       assertTrue( node.getType() == libsbml.AST_INTEGER );
       assertTrue( node.getInteger() == 321 );
       assertTrue( node.getName() == null );
       assertTrue( node.getCharacter() == '\0' );
       assertTrue( node.getReal() == 0 );
       assertTrue( node.getExponent() == 0 );
       assertTrue( node.getDenominator() == 1 );
       node = null;
 }
开发者ID:TotteKarlsson,项目名称:roadrunner,代码行数:29,代码来源:TestASTNode.cs


注:本文中的libsbmlcs.ASTNode.getReal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。