Exemple #1
0
 private static VolatileDouble Add(VolatileDouble left, VolatileDouble right)
 {
     left.Set(left.Get() + right.Get());
     return(left.Get());
 }
Exemple #2
0
 /// <summary>
 /// Create a new EWMA with a specific smoothing constant.
 /// </summary>
 /// <param name="alpha">The smoothing constant</param>
 /// <param name="timeInterval">The expected tick interval</param>
 /// <param name="rate">Current rate</param>
 public EWMA(double alpha, double timeInterval, double rate)
 {
     _interval = timeInterval;
     _alpha    = alpha;
     _rate.Set(rate);
 }