• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Core.Signal类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MathNet.Symbolics.Core.Signal的典型用法代码示例。如果您正苦于以下问题:C# Signal类的具体用法?C# Signal怎么用?C# Signal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Signal类属于MathNet.Symbolics.Core命名空间,在下文中一共展示了Signal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GenericFunctionProcess

        protected GenericFunctionProcess(bool[] inInput, bool[] inInternal, bool[] outOutput, bool[] outInternal)
        {
            if(inInput == null)
                throw new ArgumentNullException("inInput");
            if(inInternal == null)
                throw new ArgumentNullException("inInternal");
            if(outOutput == null)
                throw new ArgumentNullException("outOutput");
            if(outInternal == null)
                throw new ArgumentNullException("outInternal");

            this.inInput = inInput;
            this.inInternal = inInternal;
            this.outOutput = outOutput;
            this.outInternal = outInternal;

            //count mapped signals
            for(int i = 0; i < inInput.Length; i++)
                if(inInput[i]) inCount++;
            for(int i = 0; i < inInternal.Length; i++)
                if(inInternal[i]) inCount++;
            for(int i = 0; i < outOutput.Length; i++)
                if(outOutput[i]) outCount++;
            for(int i = 0; i < outInternal.Length; i++)
                if(outInternal[i]) outCount++;

            inputs = new Signal[inCount];
            outputs = new Signal[outCount];
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:29,代码来源:GenericFunctionProcess.cs


示例2: TraverseSignal

        private bool TraverseSignal(List<Guid> signals, List<Guid> ports, List<Guid> buses, Signal signal, Port target, bool ignoreHold, IScanVisitor visitor)
        {
            if(signal == null)
                return true;

            bool again = true;
            if(!signals.Contains(signal.InstanceId))
            {
                again = false;
                signals.Add(signal.InstanceId);
            }

            if(visitor.EnterSignal(signal, target, again, target == null))
            {
                // LEAF SIGNAL?
                if(!signal.BehavesAsBeingDriven(ignoreHold))
                {
                    if(!visitor.VisitLeaf(signal, again))
                        return false; // finished
                }
                else // HANDLE PORT
                {
                    TraversePort(signals, ports, buses, signal.DrivenByPort, signal, ignoreHold, visitor);
                }
            }
            return visitor.LeaveSignal(signal, target, again, target == null);
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:27,代码来源:AllStrategy.cs


示例3: Cotangent

        public static Signal Cotangent(Context context, Signal op)
        {
            if(context == null)
                throw new ArgumentNullException("context");

            return context.Builder.Function(new MathIdentifier("Cotangent", "Std"), op);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:Std.cs


示例4: EnterSignal

 public override bool EnterSignal(Signal signal, Port parent, bool again, bool root)
 {
     if(again)
         return false;
     _signals.Add(signal);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:CollectVisitor.cs


示例5: EnterPort

 public override bool EnterPort(Port port, Signal parent, bool again, bool root)
 {
     if(again)
         return false;
     _ports.Add(port);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:CollectVisitor.cs


示例6: DoTraverse

 protected override void DoTraverse(Signal rootSignal, IScanVisitor visitor, bool ignoreHold)
 {
     List<Guid> signals = new List<Guid>();
     List<Guid> ports = new List<Guid>();
     List<Guid> buses = new List<Guid>();
     TraverseSignal(signals, ports, buses, rootSignal, null, ignoreHold, visitor);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:7,代码来源:AllSpanningTreeStrategy.cs


示例7: BuildTheorems

        public static ITheorem[] BuildTheorems(Context context)
        {
            ITheorem[] theorems = new ITheorem[2];

            theorems[0] = new Analysis.DerivativeTransformation(context.Library.LookupEntity(_entityId),
                delegate(Port port, SignalSet manipulatedInputs, Signal variable, bool hasManipulatedInputs)
                {
                    Builder b = context.Builder;
                    Signal[] outputs = new Signal[manipulatedInputs.Count];
                    ReadOnlySignalSet squares = b.Square(port.OutputSignals);
                    Signal one = IntegerValue.ConstantOne(context);
                    for(int i = 0; i < outputs.Length; i++)
                        outputs[i] = (one + squares[i]) * manipulatedInputs[i];
                    return b.Negate(outputs);
                });

            theorems[1] = new BasicTransformation("CotangentTrigonometricSusbtitute", "Std", "TrigonometricSubstitute", "Std",
                delegate(Port port) { return port.Entity.EntityId.Equals("Cotangent", "Std"); },
                delegate(Port port) { return ManipulationPlan.DoAlter; },
                delegate(Port port, SignalSet transformedInputs, bool hasTransformedInputs)
                {
                    Signal[] ret = new Signal[transformedInputs.Count];
                    for(int i = 0; i < ret.Length; i++)
                        ret[i] = Std.Cosine(port.Context, transformedInputs[i]) / Std.Sine(port.Context, transformedInputs[i]);
                    return ret;
                });

            return theorems;
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:CotangentArchitectures.cs


示例8: FulfillsCondition

        public override bool FulfillsCondition(Signal output, Port port)
        {
            if(port == null)
                return false;

            return port.HasArchitectureLink && _match(port.CurrentArchitecture);
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:ArchitectureCondition.cs


示例9: BuildTheorems

        public static ITheorem[] BuildTheorems(Context context)
        {
            ITheorem[] theorems = new ITheorem[2];

            theorems[0] = new Analysis.DerivativeTransformation(_entityId,
                delegate(Port port, SignalSet manipulatedInputs, Signal variable, bool hasManipulatedInputs)
                {
                    Builder b = context.Builder;
                    Signal[] outputs = new Signal[manipulatedInputs.Count];
                    ReadOnlySignalSet cotangents = Std.Cotangent(context, port.InputSignals);
                    for(int i = 0; i < outputs.Length; i++)
                        outputs[i] = b.MultiplySimplified(port.OutputSignals[i], cotangents[i], manipulatedInputs[i]);
                    return b.Negate(outputs);
                });

            theorems[1] = new BasicTransformation(_entityId.DerivePostfix("TrigonometricSubstitute"), new MathIdentifier("TrigonometricSubstitute", "Std"),
                delegate() { return new Pattern(new EntityCondition(_entityId)); },
                delegate(Port port) { return ManipulationPlan.DoAlter; },
                delegate(Port port, SignalSet transformedInputs, bool hasTransformedInputs)
                {
                    return port.Context.Builder.Invert(Std.Sine(port.Context, transformedInputs));
                    //Signal[] ret = new Signal[transformedInputs.Count];
                    //for(int i = 0; i < ret.Length; i++)
                    //    ret[i] = port.Context.Builder.Invert(Std.Sine(port.Context, transformedInputs[i]));
                    //return ret;
                });

            return theorems;
        }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:29,代码来源:CosecantArchitectures.cs


示例10: FulfillsCondition

 public override bool FulfillsCondition(Signal output, Port port)
 {
     foreach(Condition c in _conditions)
         if(!c.FulfillsCondition(output, port))
             return false;
     return true;
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:AndCondition.cs


示例11: PropagatePropertyIfApplicable

 public bool PropagatePropertyIfApplicable(Signal target)
 {
     if(target == null) throw new ArgumentNullException("target");
     if(!target.HasProperty(providedPropertyId) && WouldBePropagatedTo(target))
         buildProperty(target);
     return target.HasProperty(providedPropertyId);
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:7,代码来源:GenericPropagationTheorem.cs


示例12: Action

 protected override CommandReference Action()
 {
     int idx = System.SignalCount;
     Signal s = new Signal(System.Context);
     Guid iid = s.InstanceId;
     System.AddSignal(s);
     return new CommandReference(iid, idx);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:NewSignalCommand.cs


示例13: Traverse

 public void Traverse(Signal rootSignal, IScanVisitor visitor, bool ignoreHold)
 {
     //lock(??) {
     ScanStrategy strat = ProvideExecutableInstance();
     strat._activeScans++; //}
     try { strat.DoTraverse(rootSignal, visitor, ignoreHold); }
     finally { strat._activeScans--; }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:ScanStrategy.cs


示例14: EnterPort

 public override bool EnterPort(Port port, Signal parent, bool again, bool root)
 {
     // ## DIVE DEEPER ONLY ON UNCERTAIN PORTS
     if(_plans[port.InstanceId] != ManipulationPlan.AlterIfChildsAltered
         && _plans[port.InstanceId] != ManipulationPlan.CloneIfChildsAltered)
         return false;
     return base.EnterPort(port, parent, again, root);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:Manipulator.cs


示例15: IsMember

 public override ECategoryMembership IsMember(Signal signal, bool ignoreCache)
 {
     if(signal.Value == null)
         return ECategoryMembership.Unknown;
     if(signal.Value is ComplexValue || signal.Value is RealValue || signal.Value is RationalValue || signal.Value is IntegerValue)
         return ECategoryMembership.Member;
     return ECategoryMembership.NotMember;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:ComplexValueCategory.cs


示例16: DoTraverse

 protected override void DoTraverse(Signal rootSignal, IScanVisitor visitor, bool ignoreHold)
 {
     if(rootSignal.BehavesAsBeingDriven(ignoreHold))
     {
         List<Guid> ports = new List<Guid>();
         TraversePort(ports, rootSignal.DrivenByPort, rootSignal, ignoreHold, visitor);
     }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:AllPortsStrategy.cs


示例17: EnterSignal

 public override bool EnterSignal(Signal signal, Port parent, bool again, bool root)
 {
     if(again)
         return false;
     if(_match(signal))
         return _action(signal);
     return true;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:SignalConditionalActionVisitor.cs


示例18: IsMember

 public override ECategoryMembership IsMember(Signal signal, bool ignoreCache)
 {
     if(signal.Value == null)
         return ECategoryMembership.Unknown;
     if(signal.Value is LogicValue)
         return ECategoryMembership.Member;
     return ECategoryMembership.NotMember;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:LogicValueCategory.cs


示例19: SignalEventItem

 public SignalEventItem(Signal signal, ValueStructure newValue, SetValue setValue, SetEventFlag setEventFlag, NotifyNewValue notifyNewValue)
 {
     _signal = signal;
     _newValue = newValue;
     _setEventFlag = setEventFlag;
     _setValue = setValue;
     _notifyNewValue = notifyNewValue;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:8,代码来源:SignalEventItem.cs


示例20: VisitCycle

 public override bool VisitCycle(Port port, Signal target, Signal source)
 {
     // ## ON CYCLES, TEST WHETHER THE PORT DEPENDS ON ANY ALTERED PORTS AND ADOPT
     if(Scanner.ExistsPort(port, delegate(Port p) { return _plans[p.InstanceId] == ManipulationPlan.DoAlter; }, _ignoreHold))
         _plans[port.InstanceId] = ManipulationPlan.DoAlter;
     else
         _plans[port.InstanceId] = ManipulationPlan.DontAlter;
     return base.VisitCycle(port, target, source);
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:Manipulator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ZedGraph.GraphPane类代码示例发布时间:2022-05-26
下一篇:
C# Core.Port类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap