private (NumberArgument argumentSum, NumberArgument[] argumentSet) Parse(string sum, string[] set) { var argumentSum = NumberArgument.Parse(sum); if (argumentSum.IsNeutral) { throw new ArgumentException("Sum can't be 0."); } var argumentSet = set .Select(NumberArgument.Parse) .Where(element => { if (element.IsNeutral) { logger.LogWarning($"{element.Original} is neutral and will be ignored."); return(false); } return(true); }).ToArray(); int maxFractionalPart = Math.Max(argumentSet.Max(element => element.FractionalPart.Length), argumentSum.FractionalPart.Length); argumentSum.ReduceFractionalPart(maxFractionalPart); foreach (var element in argumentSet) { element.ReduceFractionalPart(maxFractionalPart); } return(argumentSum, argumentSet); }
private AlgorithmType CalculateOptimalAlgorithmType(NumberArgument argumentSum, NumberArgument[] argumentSet) { return(AlgorithmType.Recursion); }