示例#1
0
 /// <summary>
 /// Create a symbolic scalar from this pattern. If the pattern is a constant its internal
 /// expression is returned, else a symbolic expression with a single variable is created and returned
 /// </summary>
 /// <param name="varNameTemplate"></param>
 /// <returns></returns>
 internal MathematicaScalar ToMathematicaScalar(StringSequenceTemplate varNameTemplate)
 {
     return
         (IsConstant
         ? ConstantSymbolicScalar
         : MathematicaScalar.Create(SymbolicUtils.Cas, varNameTemplate.GenerateNextString()));
 }
示例#2
0
 /// <summary>
 /// Create a symbolic expression from this pattern. If the pattern is a constant its internal
 /// expression is returned, else a symbolic expression with a single variable is created and returned
 /// </summary>
 /// <param name="varNameTemplate"></param>
 /// <returns></returns>
 public Expr ToExpr(StringSequenceTemplate varNameTemplate)
 {
     return
         (IsConstant
         ? ConstantExpr
         : SymbolicUtils.Cas[varNameTemplate.GenerateNextString()]);
 }
示例#3
0
 /// <summary>
 /// Create a symbolic value from this pattern. If the pattern is a constant its internal
 /// expression is returned, else a symbolic expression with a single variable is created and returned
 /// </summary>
 /// <param name="varNameTemplate"></param>
 /// <returns></returns>
 public AstValueScalar ToValue(StringSequenceTemplate varNameTemplate)
 {
     return
         (IsConstant
         ? ConstantValue
         : new AstValueScalar(
              ValuePrimitive <MathematicaScalar> .Create(
                  GMacType.AssociatedPrimitiveType,
                  MathematicaScalar.Create(SymbolicUtils.Cas, varNameTemplate.GenerateNextString())
                  )
              ));
 }
示例#4
0
 public string NewNodeName()
 {
     return
         (_nodeNamesTemplate.GenerateNextString());
 }