Ejemplo n.º 1
0
        private static ISymbolicExpressionTreeNode Product(ISymbolicExpressionTreeNode f, ISymbolicExpressionTreeNode g)
        {
            var product = mulSy.CreateTreeNode();

            product.AddSubtree(f);
            product.AddSubtree(g);
            return(product);
        }
 private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta)
 {
     if (beta.IsAlmost(1.0))
     {
         return(treeNode);
     }
     else
     {
         var multipliciation = new Multiplication();
         var node            = multipliciation.CreateTreeNode();
         var betaConst       = MakeConstant(beta);
         node.AddSubtree(treeNode);
         node.AddSubtree(betaConst);
         return(node);
     }
 }
 private static ISymbolicExpressionTreeNode MakeProduct(ISymbolicExpressionTreeNode treeNode, double beta) {
   if (beta.IsAlmost(1.0)) {
     return treeNode;
   } else {
     var multipliciation = new Multiplication();
     var node = multipliciation.CreateTreeNode();
     var betaConst = MakeConstant(beta);
     node.AddSubtree(treeNode);
     node.AddSubtree(betaConst);
     return node;
   }
 }