Esempio n. 1
0
 protected override void Action(bool isInit, Signal origin)
 {
     if (Inputs.Length == 0)
     {
         PublishToOutputs(RealValue.MultiplicativeIdentity);
     }
     else
     {
         RealValue product = ConvertFrom(Inputs[0].Value);
         for (int i = 1; i < Inputs.Length; i++)
         {
             RealValue integer = ConvertFrom(Inputs[i].Value);
             product = product.Divide(integer);
         }
         PublishToOutputs(product);
     }
 }
Esempio n. 2
0
 protected override void Action(bool isInit, Signal origin)
 {
     if (Inputs.Length == 0)
     {
         PublishToOutputs(RealValue.AdditiveIdentity);
     }
     else
     {
         RealValue sum = ConvertFrom(Inputs[0].Value);
         for (int i = 1; i < Inputs.Length; i++)
         {
             RealValue integer = ConvertFrom(Inputs[i].Value);
             sum = sum.Subtract(integer);
         }
         PublishToOutputs(sum);
     }
 }
Esempio n. 3
0
 public static ComplexValue ConvertFrom(RealValue value)
 {
     return(new ComplexValue(value));
 }
Esempio n. 4
0
 public bool Equals(RealValue other)
 {
     return(other != null && _dataValue.IsReal && _dataValue.Real == other.Value);
 }
Esempio n. 5
0
 public ComplexValue(RealValue realValue, RealValue imagValue)
 {
     _dataValue = Complex.FromRealImaginary(realValue.Value, imagValue.Value);
 }
Esempio n. 6
0
 public ComplexValue(RealValue realValue)
 {
     _dataValue.Real = realValue.Value;
 }