예제 #1
0
        public static NameRmsedNumeralVector operator -(NameRmsedNumeralVector left, double right)
        {
            var result = new NameRmsedNumeralVector();

            foreach (var item in left)
            {
                result[item.Key] = item.Value - right;
            }
            return(result);
        }
예제 #2
0
        public static NameRmsedNumeralVector operator -(double left, NameRmsedNumeralVector right)
        {
            var result = new NameRmsedNumeralVector();

            foreach (var item in right)
            {
                result[item.Key] = left - item.Value;
            }
            return(result);
        }
예제 #3
0
        /// <summary>
        /// 获取四舍五入值,RMS默认为0
        /// </summary>
        /// <returns></returns>
        public new NameRmsedNumeralVector GetRound()
        {
            var result = new NameRmsedNumeralVector();

            foreach (var item in this.Data)
            {
                result[item.Key] = new RmsedNumeral(Math.Round(item.Value.Value), 1e-20);
            }
            return(result);
        }
예제 #4
0
        public static NameRmsedNumeralVector operator -(NameRmsedNumeralVector left, NameRmsedNumeralVector right)
        {
            var result = new NameRmsedNumeralVector();

            foreach (var item in left)
            {
                if (!right.Data.ContainsKey(item.Key))
                {
                    continue;
                }

                result[item.Key] = item.Value - right[item.Key];
            }
            return(result);
        }