public CombinableList <T> Multiply(double factor) { CombinableList <T> result = new CombinableList <T>(); for (int i = 0; i < Count; i++) { result.Add(this[i].Multiply(factor)); } return(result); }
public CombinableList <T> AbsMax(CombinableList <T> other) { if (Count == 0) { return(other); } CombinableList <T> result = new CombinableList <T>(); for (int i = 0; i < Count; i++) { if (!this[i].IsCompatibleWith(other[i])) { throw new ArgumentException("Lists are not compatible."); } result.Add(this[i].Abs().Max(other[i].Abs())); } return(result); }
public CombinableList <T> MultiplyAndAdd(double factor, CombinableList <T> other) { if (Count == 0) { return(other.Multiply(factor)); } CombinableList <T> result = new CombinableList <T>(); for (int i = 0; i < Count; i++) { if (!this[i].IsCompatibleWith(other[i])) { throw new ArgumentException("Lists are not compatible."); } result.Add(this[i].MultiplyAndAdd(factor, other[i])); } return(result); }