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


C# Core.Signal类代码示例

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


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


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