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


C# FNode.CloneOfMe方法代码示例

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


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

示例1: Bind

        /// <summary>
        /// Binds a leaf node to another node
        /// </summary>
        /// <param name="MainNode">The node containing a pointer node that will be bound</param>
        /// <param name="ParameterNode">The node that will be bound to the MainNode</param>
        /// <param name="PointerNodeName">The name of the pointer the ParameterNode will be replacing</param>
        /// <returns></returns>
        public static FNode Bind(FNode MainNode, FNode ParameterNode, string PointerNodeName)
        {

            // Clone the main node //
            FNode t = MainNode.CloneOfMe();

            // Decompile t //
            List<FNodePointer> refs = FNodeAnalysis.AllPointers(t);

            // Replace the pointer node with the parameter node //
            foreach (FNodePointer x in refs)
            {
                if (x.PointerName == PointerNodeName)
                    FNodeAnalysis.ReplaceNode(x, ParameterNode);
            }

            return t;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:26,代码来源:FNodeCompactor.cs

示例2: GradientOfPowerUpper

        // F(X) = power(Y, G(X)), F'(X) = LOG(Y) * power(Y, G(X)) * G'(X)
        private static FNode GradientOfPowerUpper(FNode Node, FNodePointer X)
        {

            // Throw an exception if X is decendant of Y, in otherwords F(X) = Power(G(X), H(X))
            if (FNodeAnalysis.IsDecendent(X, Node.Children[1]))
                throw new Exception(string.Format("Cannot differentiate the power function with the form: Power(G(X), H(X)); G(X) cannot have a relation to X"));

            // LOG(Y) //
            FNode log_y = new FNodeResult(null, new CellFuncFVLog());
            log_y.AddChildNode(Node.Children[0]);

            // Get Power(Y, G(X)) * LOG(Y) //
            FNode pow_f_dx = new FNodeResult(Node.ParentNode, new CellBinMult());
            pow_f_dx.AddChildNode(Node.CloneOfMe());
            pow_f_dx.AddChildNode(log_y);

            // Get Power(G(X), N-1) * G'(X) //
            FNode t = new FNodeResult(Node.ParentNode, new CellBinMult());
            t.AddChildNode(pow_f_dx);
            t.AddChildNode(Gradient(Node.Children[1], X));

            return t;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:25,代码来源:FNodeGradient.cs

示例3: BindNode

        public static FNode BindNode(FNode Equation, CellVector Bindings, Dictionary<string, int> Map)
        {

            FNode t = Equation.CloneOfMe();
            foreach(KeyValuePair<string,int> kv in Map)
            {
                string name = kv.Key;
                int idx = kv.Value;
                FNode b = new FNodeValue(null, Bindings[idx]);
                t = FNodeCompacter.Bind(t, b, name);
            }

            return t;

        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:15,代码来源:NonlinearRegressionModel.cs

示例4: GradientOfExp

        // F(X) = exp(G(X)), F'(X) = exp(G(X)) * G'(X), or simplified F(X) * G'(X) 
        private static FNode GradientOfExp(FNode Node, FNodePointer X)
        {

            // F(X) * G'(X) //
            FNodeResult t = new FNodeResult(Node.ParentNode, new CellBinMult());
            t.AddChildNode(Node.CloneOfMe());
            t.AddChildNode(Gradient(Node.Children[0], X));

            return t;
        }
开发者ID:pwdlugosz,项目名称:Horse,代码行数:11,代码来源:FNodeGradient.cs


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