コード例 #1
0
 public Add_SumRaisedToPower(Interface_Numerator num_f)
 {
     InitializeComponent();
     Num_F = num_f;
     Sum_To_Power = new SumRaisedToPower();
     this.Text = "New sum";
     SumTextBox.Enabled = false;
 }
コード例 #2
0
        private static Summand ConvertToSummand(string stringToParse)
        {
            Summand summand = new Summand();
            summand.Coefficient = FindCoefficient(stringToParse);
            summand.PolynomialDegree = FindPolynomialDegree(stringToParse);

            var elementaryFunctionList = FindElementaryFunction(stringToParse);

            foreach (var function in elementaryFunctionList)
            {
                summand.Multiplicands.Add(ConvertToElementaryFunction(function));
            }

            var sumsRaisedToPowerList = FindSumRaisedToPower(stringToParse);

            foreach (var sum in sumsRaisedToPowerList)
            {
                SumRaisedToPower sumRaisedToPower = new SumRaisedToPower();
                sumRaisedToPower.Degree = GetSumsRaisedToPowerDegree(sum);
                sumRaisedToPower.Sum = Parse(EliminateDegree(sum));
                summand.SumsRaisedToPower.Add(sumRaisedToPower);
            }

            return summand;
        }
コード例 #3
0
 public void Add_SumRaisedToPower_To_Summand(SumRaisedToPower sum)
 {
     if (All_Functions.SumsRaisedToPower == null)
         All_Functions.SumsRaisedToPower = new List<SumRaisedToPower>();
     All_Functions.SumsRaisedToPower.Add(sum);
 }
コード例 #4
0
        public static IEnumerable<Summand> RaiseSumToPower(SumRaisedToPower sumRaisedToPower)
        {
            var raisedInnerSums = sumRaisedToPower.Sum.SelectMany(RaiseSumsToPower);

            var returned = raisedInnerSums;

            for (int i = 2; i <= sumRaisedToPower.Degree; i++)
            {
                returned = DistributeIncludingElementaryFunctions(returned, raisedInnerSums);
            }

            return returned;
        }