Exemple #1
0
        public ILinearCollection MultiplyAllValuesWith(double value)
        {
            LinearCollection <T> result = new LinearCollection <T>(this.Length);

            for (int i = 0; i < this.Length; i++)
            {
                result.SetTheValue(i, this.GetTheValue(i) * value);
            }

            return(result);
        }
Exemple #2
0
        public ILinearCollection DivideAllValuesAsDenominator(double numerator)
        {
            LinearCollection <T> result = new LinearCollection <T>(this.Length);

            for (int i = 0; i < this.Length; i++)
            {
                result.SetTheValue(i, numerator / this.GetTheValue(i));
            }

            return(result);
        }
Exemple #3
0
        public ILinearCollection SubtractAllValuesFrom(double value)
        {
            LinearCollection <T> result = new LinearCollection <T>(this.Length);

            for (int i = 0; i < this.Length; i++)
            {
                result.SetTheValue(i, value - this.GetTheValue(i));
            }

            return(result);
        }
Exemple #4
0
        public ILinearCollection Subtract(ILinearCollection array)
        {
            if (this.Length != array.Length)
            {
                throw new NotImplementedException();
            }

            LinearCollection <T> result = new LinearCollection <T>(this.Length);

            for (int i = 0; i < this.Length; i++)
            {
                result.SetValue(i, this.GetValue(i).Subtract(array.GetValue(i)));
            }

            return(result);
        }