本文整理汇总了C#中MathIdentifier类的典型用法代码示例。如果您正苦于以下问题:C# MathIdentifier类的具体用法?C# MathIdentifier怎么用?C# MathIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MathIdentifier类属于命名空间,在下文中一共展示了MathIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterTheorems
public static void RegisterTheorems(ILibrary library)
{
Analysis.DerivativeTransformation.Provider.Add(
new Analysis.DerivativeTransformation(_entityId,
delegate(Port port, SignalSet manipulatedInputs, Signal variable, bool hasManipulatedInputs)
{
ReadOnlySignalSet squares = StdBuilder.Square(port.OutputSignals);
Signal one = IntegerValue.ConstantOne;
SignalSet outputs = new SignalSet();
for(int i = 0; i < manipulatedInputs.Count; i++)
outputs.Add((one + squares[i]) * manipulatedInputs[i]);
return outputs;
}));
MathIdentifier typeId = new MathIdentifier("TrigonometricSubstitute", "Std");
ITheoremProvider basicProvider;
if(!library.TryLookupTheoremType(typeId, out basicProvider))
{
basicProvider = Binder.GetInstance<ITransformationTheoremProvider, MathIdentifier>(typeId);
library.AddTheoremType(basicProvider);
}
((ITransformationTheoremProvider)basicProvider).Add(
new BasicTransformation(_entityId.DerivePostfix("TrigonometricSubstitute"), typeId,
delegate() { return new Pattern(new EntityCondition(_entityId)); },
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] = StdBuilder.Sine(transformedInputs[i]) / StdBuilder.Cosine(transformedInputs[i]);
return ret;
}));
}
示例2: RegisterTheorems
public static void RegisterTheorems(ILibrary library)
{
Analysis.DerivativeTransformation.Provider.Add(
new Analysis.DerivativeTransformation(_entityId,
delegate(Port port, SignalSet manipulatedInputs, Signal variable, bool hasManipulatedInputs)
{
Signal[] outputs = new Signal[manipulatedInputs.Count];
ReadOnlySignalSet cotangents = StdBuilder.Cotangent(port.InputSignals);
for(int i = 0; i < outputs.Length; i++)
outputs[i] = Std.Multiply(port.OutputSignals[i], cotangents[i], manipulatedInputs[i]);
return StdBuilder.Negate(outputs);
}));
MathIdentifier typeId = new MathIdentifier("TrigonometricSubstitute", "Std");
ITheoremProvider basicProvider;
if(!library.TryLookupTheoremType(typeId, out basicProvider))
{
basicProvider = Binder.GetInstance<ITransformationTheoremProvider, MathIdentifier>(typeId);
library.AddTheoremType(basicProvider);
}
((ITransformationTheoremProvider)basicProvider).Add(
new BasicTransformation(_entityId.DerivePostfix("TrigonometricSubstitute"), typeId,
delegate() { return new Pattern(new EntityCondition(_entityId)); },
delegate(Port port) { return ManipulationPlan.DoAlter; },
delegate(Port port, SignalSet transformedInputs, bool hasTransformedInputs)
{
return StdBuilder.Invert(StdBuilder.Sine(transformedInputs));
//Signal[] ret = new Signal[transformedInputs.Count];
//for(int i = 0; i < ret.Length; i++)
// ret[i] = Std.Invert(Std.Sine(transformedInputs[i]));
//return ret;
}));
}
示例3: MergeToCoalescedTree
public virtual void MergeToCoalescedTree(MathIdentifier patternId, List<CoalescedTreeNode> parents)
{
List<CoalescedTreeNode> nodes = _condition.MergeToCoalescedTree(parents);
MergeGroupToCoalescedTree(patternId, nodes);
foreach(CoalescedTreeNode node in nodes)
node.Subscribe(patternId);
}
示例4: NewPortCommand
protected NewPortCommand(SerializationInfo info, StreamingContext context)
: base(info, context)
{
_entityId = MathIdentifier.Parse(info.GetString("entityId"));
_inputCnt = info.GetInt32("inputCount");
_busCnt = info.GetInt32("busCount");
}
示例5: DerivativeTransformation
public DerivativeTransformation(MathIdentifier id, MathIdentifier supportedEntityId, EstimateDerivePlan plan, Derive derive)
{
_id = id;
_supportedEntityId = supportedEntityId;
_derive = derive;
_plan = plan;
}
示例6: AutoSimplifyTransformation
public AutoSimplifyTransformation(MathIdentifier id, CreatePattern pattern, EstimatePlan plan, ManipulatePort simplify)
{
_id = id;
_pattern = pattern;
_simplify = simplify;
_plan = plan;
}
示例7: AutoSimplifyTransformation
public AutoSimplifyTransformation(MathIdentifier id, Predicate<Port> supportsPort, EstimatePlan plan, ManipulatePort simplify)
{
_id = id;
_supportsPort = supportsPort;
_simplify = simplify;
_plan = plan;
}
示例8: GenericPropagationTheorem
public GenericPropagationTheorem(MathIdentifier id, MathIdentifier providedPropertyId, ImpliesProperty impliesProperty, BuildProperty buildProperty)
{
this.id = id;
this.providedPropertyId = providedPropertyId;
this.impliesProperty = impliesProperty;
this.buildProperty = buildProperty;
}
示例9: ConversionDistance
public ConversionDistance(MathIdentifier canConvertFrom, int cost, bool lossless, ConversionRouter nextHop, Converter<ValueStructure, ValueStructure> convert)
{
this.CanConvertFrom = canConvertFrom;
this.Cost = cost;
this.Lossless = lossless;
this.NextHop = nextHop;
this.Convert = convert;
}
示例10: ConversionRouter
public ConversionRouter(MathIdentifier structureId)
{
this.structureId = structureId;
this.losslessNeighbors = new Dictionary<MathIdentifier, ConversionRoute>();
this.lossyNeighbors = new Dictionary<MathIdentifier, ConversionRoute>();
this.targetNeighbors = new Dictionary<MathIdentifier, ConversionRouter>();
this.vector = new Dictionary<MathIdentifier, ConversionDistance>();
}
示例11: BasicTransformation
public BasicTransformation(MathIdentifier id, MathIdentifier transformationTypeId, Predicate<Port> supportsPort, EstimatePlan plan, ManipulatePort transform)
{
_id = id;
_transformationTypeId = transformationTypeId;
_supportsPort = supportsPort;
_transform = transform;
_plan = plan;
}
示例12: AddEntity
private List<IArchitectureFactory> AddEntity(MathIdentifier entityId)
{
List<IArchitectureFactory> value;
if(!_table.TryGetValue(entityId, out value))
{
value = new List<IArchitectureFactory>();
_table.Add(entityId, value);
}
return value;
}
示例13: GenericMathOpArchitecture
/// <summary>Port Instance Constructor</summary>
protected GenericMathOpArchitecture(MathIdentifier id, MathIdentifier entityId, Port port)
: base(id, entityId, true)
{
if(port == null) throw new ArgumentNullException("port");
//System.Diagnostics.Debug.Assert(SupportsPort(port));
SetPort(port);
for(int i = 0; i < port.OutputSignalCount; i++)
port.OutputSignals[i].PostNewValue(UndefinedSymbol.Instance);
}
示例14: GenericSimpleArchitecture
/// <summary>Port Instance Constructor</summary>
protected GenericSimpleArchitecture(MathIdentifier entityId, bool isMathematicalOperator, Port port, int internalSignalCount)
: base(entityId, entityId, isMathematicalOperator)
{
_internalSignals = new Signal[internalSignalCount];
for(int i = 0; i < _internalSignals.Length; i++)
_internalSignals[i] = Binder.CreateSignal();
//System.Diagnostics.Debug.Assert(SupportsPort(port));
SetPort(port);
_sensedSignals = new SignalSet();
SenseSignals(port.InputSignals, _internalSignals, port.Buses, port.OutputSignals);
Action(port.InputSignals, port.OutputSignals, _internalSignals, port.Buses);
}
示例15: CompoundArchitecture
public CompoundArchitecture(MathIdentifier id, MathIdentifier entityId, Port port, IMathSystem system)
: base(id, entityId, false)
{
this.inputSignals = port.InputSignals;
this.outputSignals = port.OutputSignals;
this.system = system;
this.system.OutputValueChanged += system_OutputValueChanged;
SetPort(port);
for(int i = 0; i < inputSignals.Count; i++)
inputSignals[i].ValueChanged += CompoundArchitecture_SignalValueChanged;
system.PushInputValueRange(inputSignals);
}