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); }
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); }
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); }
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); }