Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }