Example #1
0
        public static ResourceFormula operator +(ResourceFormula r1, ResourceFormula r2)
        {
            var result = new ResourceFormula(r1.Context ?? r2.Context);

            foreach (var key in r1.Keys.Union(r2.Keys))
            {
                result.Add(key, r1[key] + r2[key]);
            }
            return(result);
        }
Example #2
0
        public static ResourceFormula operator /(ResourceFormula r, double scalar)
        {
            var result = new ResourceFormula(r.Context);

            foreach (var key in r.Keys)
            {
                result.Add(key, r[key] / scalar);
            }
            return(result);
        }