Esempio n. 1
0
        public Option <CoeficientInfo> GetCoeficientInfoByDegree(int degree)
        {
            var coeficients = Coeficients
                              .Where(x => x.Degree == degree)
                              .Select(x => x.Coeficient)
                              .AsEnumerable();

            if (!coeficients.Any())
            {
                return(None.Value);
            }

            return(new CoeficientInfo(coeficients.Sum(), degree));
        }
Esempio n. 2
0
 public IEnumerable <int> GetDegreeCollection()
 => Coeficients
 .Select(x => x.Degree)
 .Distinct()
 .OrderBy(x => x)
 .AsEnumerable();