Beispiel #1
0
        private void SumLeftCompatibles()
        {
            var newList = new List <Summand>();

            while (LeftSide.Count > 0)
            {
                var instance = LeftSide.First();
                LeftSide.RemoveAt(0);
                var compatibles = LeftSide.Where(x => x.Compatible(instance)).ToArray();
                foreach (var summand in compatibles)
                {
                    instance = instance.Sum(summand);
                    LeftSide.Remove(summand);
                }

                newList.Add(instance);
            }

            newList.RemoveAll(x => Math.Abs(x.Multiplier) < Helper.Epsilon);

            LeftSide = newList;
        }