Exemplo n.º 1
0
        private static Dictionary <int, Subset> GetSecondPoint(List <BigInteger> listSet)
        {
            Dictionary <int, Subset> dictionaryBin = new Dictionary <int, Subset>();

            int maxBin = 0;

            foreach (var item in listSet)
            {
                var currentBin = MathMethods.Bin(item);
                if (dictionaryBin.ContainsKey(currentBin))
                {
                    dictionaryBin[currentBin].Values.Add(item);
                }
                else
                {
                    Subset _subset = new Subset();
                    _subset.Values = new List <BigInteger>();
                    _subset.Values.Add(item);
                    dictionaryBin.Add(currentBin, _subset);
                }
                if (maxBin < currentBin)
                {
                    maxBin = currentBin;
                }
            }
            return(dictionaryBin);
        }
Exemplo n.º 2
0
        private static BigInteger GetEulerSum(List <BigInteger> _list)
        {
            BigInteger result = 0;

            foreach (var _item in _list)
            {
                result += MathMethods.Euler(_item);
            }
            return(result);
        }