Esempio n. 1
0
        public static MyVector <T> operator -(MyVector <T> obj1, MyVector <T> obj2)
        {
            var result = new MyVector <T>();

            for (var i = 0; i < obj1.Count; i++)
            {
                var subLeftAndRight = obj1[i].Subtraction(obj2[i]);
                result.Add(subLeftAndRight);
            }
            return(result);
        }
Esempio n. 2
0
        public static MyVector <T> operator +(MyVector <T> obj1, MyVector <T> obj2)
        {
            var result = new MyVector <T>();

            for (var i = 0; i < obj1.Count; i++)
            {
                var sum = obj1[i].Addition(obj2[i]);

                result.Add(sum);
            }

            return(result);
        }