コード例 #1
0
 static AddToTree.Tree ReplaceXToFX(AddToTree.Tree Dummy, AddToTree.Tree FX)
 {
     if (Dummy.LeftSideAccess != null)
     {
         if (Dummy.LeftSideAccess.SampleAccess == "x")
         {
             Dummy.SetLefTandRightCommonlySide(FX, Dummy.RightSideAccess);
             Dummy.LeftSideAccess.ThreadAccess  = Dummy;
             Dummy.RightSideAccess.ThreadAccess = Dummy;
             return(Dummy);
         }
     }
     else
     {
         return(Dummy);
     }
     if (Dummy.RightSideAccess != null)
     {
         if (Dummy.RightSideAccess.SampleAccess == "x")
         {
             Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, FX);
             Dummy.LeftSideAccess.ThreadAccess  = Dummy;
             Dummy.RightSideAccess.ThreadAccess = Dummy;
             return(Dummy);
         }
     }
     else
     {
         return(Dummy);
     }
     Derivasion.ReplaceXToFX(Dummy.LeftSideAccess, FX);
     Derivasion.ReplaceXToFX(Dummy.RightSideAccess, FX);
     return(Dummy);
 }
コード例 #2
0
        static public AddToTree.Tree KnownIntegralFormullaFx(AddToTree.Tree Dummy)
        {
            try
            {
                if ((Dummy.LeftSideAccess != null) && (Dummy.RightSideAccess != null) && (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)) && (Dummy.SampleAccess == "/") && (Dummy.RightSideAccess.SampleAccess == "x"))
                {
                    AddToTree.Tree Ln = new AddToTree.Tree("Ln", false);
                    Ln.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), null);
                    Ln.LeftSideAccess.ThreadAccess = Ln;


                    Ln.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), Ln.CopyNewTree(Ln));
                    Ln.LeftSideAccess.ThreadAccess  = Ln;
                    Ln.RightSideAccess.ThreadAccess = Ln;
                    Ln.SampleAccess = "*";

                    Dummy = Ln;
                }
                else
                if ((Dummy.LeftSideAccess.SampleAccess.ToLower() == "x") && (Dummy.RightSideAccess == null) && (Dummy.SampleAccess.ToLower() == "ln"))
                {
                    AddToTree.Tree Ln = new AddToTree.Tree("Ln", false);
                    AddToTree.Tree X  = new AddToTree.Tree("X", false);

                    Ln.SetLefTandRightCommonlySide(X.CopyNewTree(X), null);
                    Ln.LeftSideAccess.ThreadAccess = Ln;


                    Ln.SetLefTandRightCommonlySide(X.CopyNewTree(X), Ln.CopyNewTree(Ln));
                    Ln.LeftSideAccess.ThreadAccess  = Ln;
                    Ln.RightSideAccess.ThreadAccess = Ln;
                    Ln.SampleAccess = "*";

                    Ln.SetLefTandRightCommonlySide(Ln.CopyNewTree(Ln), X);
                    Ln.LeftSideAccess.ThreadAccess  = Ln;
                    Ln.RightSideAccess.ThreadAccess = Ln;
                    Ln.SampleAccess = "-";

                    Dummy = Ln;
                }
                else
                if (true)
                {
                    Dummy = null;
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); Dummy = null; }
            return(Dummy);
        }
コード例 #3
0
        static public bool IsEqualWithOutThreadConsiderationByDivision(AddToTree.Tree T1, AddToTree.Tree T2, ref UknownIntegralSolver UIS)
        {
            bool Is = false;

            AddToTree.Tree Code = new AddToTree.Tree("/", false);
            Code.SetLefTandRightCommonlySide(T1.CopyNewTree(T1), T2.CopyNewTree(T2));
            try
            {
                Code.LeftSideAccess.ThreadAccess = Code;
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            try
            {
                Code.RightSideAccess.ThreadAccess = Code;
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }

            Code = Simplifier.SimplifierFx(Code, ref UIS);



            if ((Code.SampleAccess == "1") && (Code.LeftSideAccess == null) && (Code.RightSideAccess == null))
            {
                Is = true;
            }

            return(Is);
        }
コード例 #4
0
 static AddToTree.Tree MinuseToPluSeconverterActionFx(AddToTree.Tree Dummy)
 {
     if (Dummy == null)
     {
         return(null);
     }
     try
     {
         if (Dummy.SampleAccess == "-")
         {
             if (Dummy.ThreadAccess.SampleAccess == "-")
             {
                 if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.RightSideAccess, Dummy))
                 {
                     Dummy.ThreadAccess.SampleAccess = "+";
                     AddToTree.Tree CONVERT = new AddToTree.Tree("*", false);
                     AddToTree.Tree Minuse  = new AddToTree.Tree("-1", false);
                     CONVERT.SetLefTandRightCommonlySide(Minuse, Dummy.CopyNewTree(Dummy.LeftSideAccess));
                     CONVERT.LeftSideAccess.ThreadAccess  = CONVERT;
                     CONVERT.RightSideAccess.ThreadAccess = CONVERT;
                     CONVERT.ThreadAccess = Dummy;
                     Dummy.LeftSideAccess = CONVERT;
                 }
             }
         }
     }
     catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
     MinuseToPluSeconverter.MinuseToPluSeconverterActionFx(Dummy.LeftSideAccess);
     MinuseToPluSeconverter.MinuseToPluSeconverterActionFx(Dummy.RightSideAccess);
     return(Dummy);
 }
コード例 #5
0
 static public Tree DeleteTree(AddToTree.Tree Exsit, AddToTree.Tree Deleted)
 {
     if (Exsit == null)
     {
         return(null);
     }
     if (Deleted == null)
     {
         return(null);
     }
     AddToTree.Tree Current = new AddToTree.Tree(null, false);
     if (!Formulas.EqualToObject.IsEqualWithThreadConsiderationCommonly(Exsit, Deleted))
     {
         try
         {
             Current.SampleAccess = Exsit.SampleAccess;
             Current.SetLefTandRightCommonlySide(AddToTree.Tree.DeleteTree(Exsit.LeftSideAccess, Deleted), AddToTree.Tree.DeleteTree(Exsit.RightSideAccess, Deleted));
             //ERRORCORECTION091824098.refer to page 177.
             Current.LeftSideAccess.ThreadAccess  = Exsit.LeftSideAccess.ThreadAccess;
             Current.RightSideAccess.ThreadAccess = Exsit.RightSideAccess.ThreadAccess;
         }
         catch (NullReferenceException t)
         { Formulas.ExceptionClass.ExceptionClassMethod(t); }
     }
     else
     {
         Tree.DeleteTree(Exsit.LeftSideAccess, Deleted.LeftSideAccess);
         Tree.DeleteTree(Exsit.RightSideAccess, Deleted.RightSideAccess);
     }
     return(Current);
 }
コード例 #6
0
        static AddToTree.Tree ArrangmentNumberAndX(AddToTree.Tree Dummy)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            if (Dummy.LeftSideAccess != null)
            {
                if (Dummy.RightSideAccess != null)
                {
                    if ((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "+"))
                    {
                        if (Dummy.ThreadAccess != null)
                        {
                            if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.LeftSideAccess, Dummy))
                            {
                                //if (IS.ISindependenceVaribaleOrNumber(Dummy.LeftSideAccess.SampleAccess))
                                //if (!IS.IsOperator(Dummy.LeftSideAccess.SampleAccess))
                                if (IS.IsDiv(Dummy.RightSideAccess.SampleAccess))
                                {
                                    Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
                                }
                            }
                            else
                            if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.RightSideAccess, Dummy))
                            {
                                //if (IS.ISindependenceVaribaleOrNumber(Dummy.RightSideAccess.SampleAccess))
                                //if(!IS.IsOperator(Dummy.RightSideAccess.SampleAccess))
                                if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess))
                                {
                                    Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
                                }
                            }
                        }

                        /*
                         * if (IS.ISindependenceVaribaleOrNumber(Dummy.LeftSideAccess.SampleAccess))
                         * Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
                         */
                    }
                }
            }

            MulDivisionSorter.ArrangmentNumberAndX(Dummy.LeftSideAccess);
            MulDivisionSorter.ArrangmentNumberAndX(Dummy.RightSideAccess);
            return(Dummy);
        }
コード例 #7
0
 static AddToTree.Tree SimplifierCommonSubFactorActionRightSideFx(AddToTree.Tree Dummy, AddToTree.Tree COMMONSUBFACTOR, ref bool END, AddToTreeTreeLinkList NOTFACTOR)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     if (Dummy.SampleAccess != "*")
     {
         if (NOTFACTOR.FINDTreeWithOutThreadConsideration(Dummy))
         {
             return(Dummy);
         }
     }
     if (END)
     {
         return(Dummy);
     }
     try
     {   //ERROCRECTIOn98217487 :the last condition (Dummy.ThreadAccess.SampleAccess) is Div.
         if ((EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR) && (Dummy.ThreadAccess.SampleAccess == "*") || (Dummy.ThreadAccess.SampleAccess == "/")))
         {
             Dummy.SetLefTandRightCommonlySide(null, null);
             Dummy.SampleAccess = "1";
             END = true;
         }
         else
         if ((Dummy.ThreadAccess.SampleAccess == "^") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR)) && (IS.IsNumber(Dummy.ThreadAccess.RightSideAccess.SampleAccess)))
         {
             float NUM = (float)System.Convert.ToDouble(Dummy.ThreadAccess.RightSideAccess.SampleAccess);
             NUM = NUM - 1;
             if (NUM > 0)
             {
                 Dummy.ThreadAccess.RightSideAccess.SampleAccess = NUM.ToString();
             }
             else
             {
                 Dummy.SetLefTandRightCommonlySide(null, null);
                 Dummy.SampleAccess = "1";
             }
             END = true;
         }
     }
     catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
     Dummy.LeftSideAccess  = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.LeftSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR);
     Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.RightSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR);
     return(Dummy);
 }
コード例 #8
0
        static AddToTree.Tree SimplifierCommonSubFactorActionLeftSideFx(AddToTree.Tree Dummy, AddToTree.Tree COMMONSUBFACTOR, ref bool END, AddToTreeTreeLinkList NOTFACTOR)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            if (Dummy.SampleAccess != "*")
            {
                if (NOTFACTOR.FINDTreeWithOutThreadConsideration(Dummy))
                {
                    return(Dummy);
                }
            }
            if (END)
            {
                return(Dummy);
            }
            if ((Dummy.ThreadAccess.SampleAccess == "*") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, COMMONSUBFACTOR)))
            {
                Dummy.SetLefTandRightCommonlySide(null, null);
                Dummy.SampleAccess = "1";
                END = true;
            }
            else
            if ((Dummy.ThreadAccess.SampleAccess == "^") && (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.ThreadAccess.LeftSideAccess, COMMONSUBFACTOR)) && (IS.IsNumber(Dummy.ThreadAccess.RightSideAccess.SampleAccess)))
            {
                float NUM = (float)System.Convert.ToDouble(Dummy.ThreadAccess.RightSideAccess.SampleAccess);
                NUM = NUM - 1;
                if (NUM > 0)
                {
                    Dummy.ThreadAccess.RightSideAccess.SampleAccess = NUM.ToString();
                }
                else
                {
                    Dummy.SetLefTandRightCommonlySide(null, null);
                    Dummy.SampleAccess = "1";
                }
                END = true;
            }

            Dummy.LeftSideAccess  = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.LeftSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR);
            Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.RightSideAccess, COMMONSUBFACTOR, ref END, NOTFACTOR);
            return(Dummy);
        }
コード例 #9
0
        static AddToTree.Tree ConvertAllMinuseToPluseActionFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            int  INCREASE = 2147483647 / 3;
            bool SecOND   = true;

            try
            {
                UIS.SetProgressValue(UIS.progressBar5, 0);

                if ((Dummy.ThreadAccess.SampleAccess == "-") && (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.RightSideAccess, Dummy)))
                {
                    AddToTree.Tree ONE = new AddToTree.Tree("-1", false);
                    AddToTree.Tree ADD = new AddToTree.Tree("*", false);
                    //Dummy = Dummy.LeftSideAccess;
                    ADD.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), ONE);
                    ADD.LeftSideAccess.ThreadAccess  = ADD;
                    ADD.RightSideAccess.ThreadAccess = ADD;
                    Dummy = Dummy.ThreadAccess;
                    Dummy.SampleAccess   = "+";
                    Dummy.LeftSideAccess = ADD;
                    Dummy.LeftSideAccess.ThreadAccess = Dummy;
                    SecOND = false;
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            UIS.SetProgressValue(UIS.progressBar5, INCREASE + UIS.progressBar5.Value);

            try
            {
                if ((Dummy.SampleAccess == "-") && (SecOND))
                {
                    AddToTree.Tree ONE = new AddToTree.Tree("-1", false);
                    AddToTree.Tree ADD = new AddToTree.Tree("*", false);
                    ADD.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), ONE);
                    ADD.LeftSideAccess.ThreadAccess  = ADD;
                    ADD.RightSideAccess.ThreadAccess = ADD;
                    Dummy.SampleAccess    = "+";
                    Dummy.RightSideAccess = ADD;
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            UIS.SetProgressValue(UIS.progressBar5, 2147483647);
            Dummy.LeftSideAccess  = ConvertAllMinuseToPluse.ConvertAllMinuseToPluseActionFx(Dummy.LeftSideAccess, ref UIS);
            Dummy.RightSideAccess = ConvertAllMinuseToPluse.ConvertAllMinuseToPluseActionFx(Dummy.RightSideAccess, ref UIS);
            return(Dummy);
        }
コード例 #10
0
        static private AddToTree.Tree RecursiveIntegralFxAdditionForLinearEquationOneDegrees(AddToTree.Tree Node, AddToTree.Tree Dummy, float Queficient)
        {
            if (Node == null || Node.LeftSideAccess == null)
            {
                return(null);
            }
            if (Queficient != 0)
            {
                AddToTree.Tree NUM  = new AddToTree.Tree(Queficient.ToString(), false);
                AddToTree.Tree Copy = new AddToTree.Tree("/", false);

                float NUMCopy = 0;

                if (IS.IsNumber(Node.LeftSideAccess.SampleAccess))
                {
                    if (Node.SampleAccess == "*")
                    {
                        NUMCopy = (float)System.Convert.ToDouble(Node.LeftSideAccess.SampleAccess);
                    }
                    else
                    {
                        NUMCopy = 1;
                    }
                    //ERROR198274897234 :The Queficient must subtract to num.refer to page 221.
                    NUMCopy = NUMCopy - Queficient;
                }
                else
                if (IS.IsNumber(Node.RightSideAccess.SampleAccess))
                {
                    //ERRORCORECTION9827438 :Invalid Number detection.refer to page 223.
                    if (Node.SampleAccess == "*")
                    {
                        NUMCopy = (float)System.Convert.ToDouble(Node.RightSideAccess.SampleAccess);
                    }
                    else
                    {
                        NUMCopy = 1;
                    }
                    //ERROR198274897234 :The Queficient must subtract to num.refer to page 221.
                    NUMCopy = NUMCopy - Queficient;
                }
                NUM.SampleAccess = System.Convert.ToString(NUMCopy);
                Copy.SetLefTandRightCommonlySide(Dummy, NUM);
                Copy.LeftSideAccess.ThreadAccess  = Copy;
                Copy.RightSideAccess.ThreadAccess = Copy;
                //ERRORCORRECTION872318712 :The Dummy has no ay effect.refer to page 218.
                Dummy = Copy;
            }
            return(Dummy);
        }
コード例 #11
0
 static AddToTree.Tree ArrangmentToDeleteingMul(AddToTree.Tree Dummy)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     DeletingMultaplification.ArrangmentToDeleteingMul(Dummy.LeftSideAccess);
     DeletingMultaplification.ArrangmentToDeleteingMul(Dummy.RightSideAccess);
     if (Dummy.SampleAccess == "*")
     {
         if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))
         {
             Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
         }
     }
     if (Dummy.SampleAccess == "*")
     {
         if (IS.IsMulOrDiv(Dummy.LeftSideAccess.SampleAccess))
         {
             Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
         }
     }
     return(Dummy);
 }
コード例 #12
0
 static AddToTree.Tree ConvertExtraFactorsToone(AddToTree.Tree Dummy, AddToTree.Tree Factors, ref bool Action, bool Current)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     if ((EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy, Factors)) && (!Action) && (!Current))
     {
         Action = true;
         Dummy.SetLefTandRightCommonlySide(null, null);
         Dummy.SampleAccess = "1";
     }
     Dummy.LeftSideAccess  = FactorActivation.ConvertExtraFactorsToone(Dummy.LeftSideAccess, Factors, ref Action, Current);
     Dummy.RightSideAccess = FactorActivation.ConvertExtraFactorsToone(Dummy.RightSideAccess, Factors, ref Action, Current);
     return(Dummy);
 }
コード例 #13
0
 static AddToTree.Tree ArrangmentToDeleteingMinusPluse(AddToTree.Tree Dummy)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     DeleteingMinusPluseTree.ArrangmentToDeleteingMinusPluse(Dummy.LeftSideAccess);
     DeleteingMinusPluseTree.ArrangmentToDeleteingMinusPluse(Dummy.RightSideAccess);
     if (Dummy.SampleAccess == "+")
     {
         if (IS.IsMinuseOrPluse(Dummy.LeftSideAccess.SampleAccess))
         {
             Dummy.SetLefTandRightCommonlySide(Dummy.RightSideAccess, Dummy.LeftSideAccess);
         }
     }
     return(Dummy);
 }
コード例 #14
0
        static AddToTree.Tree FactorActivationDivActionFx(AddToTree.Tree Dummy, AddToTree.Tree Factor, ref bool Action, ref bool Mul, AddToTreeTreeLinkList CopyOfFactors)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            bool Current = false;

            try
            {
                if (Mul && Action && (IS.IsMinusAndPluseFirstNode(Dummy.ThreadAccess) && (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.RightSideAccess, Dummy))))
                {
                    Action = false;
                    Mul    = false;
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            if ((IS.IsMinusAndPluseFirstNode(Dummy)) && (!Mul) && ((Factor != null)))
            {
                AddToTree.Tree Copy = new AddToTree.Tree("*", false);
                Copy.SetLefTandRightCommonlySide(Factor.CopyNewTree(Factor), Dummy.CopyNewTree(Dummy));
                Copy.LeftSideAccess.ThreadAccess  = Copy;
                Copy.RightSideAccess.ThreadAccess = Copy;
                Copy.ThreadAccess = Dummy.ThreadAccess;
                Dummy             = Copy;
                Mul     = true;
                Current = true;
            }
            else//CAUSEDERROR2983747 :This Section because of Loss Factors not is not become one extra factors.
            {
                Dummy = FactorActivation.ConvertExtraFactorsTooneFx(Dummy, Factor, ref Action, Current);
            }

            if (Current)
            {
                Dummy = Dummy.RightSideAccess;
                //Dummy = Dummy.RightSideAccess;
                Current = false;
            }

            Dummy.LeftSideAccess  = FactorActivation.FactorActivationDivActionFx(Dummy.LeftSideAccess, Factor, ref Action, ref Mul, CopyOfFactors);
            Dummy.RightSideAccess = FactorActivation.FactorActivationDivActionFx(Dummy.RightSideAccess, Factor, ref Action, ref Mul, CopyOfFactors);

            return(Dummy);
        }
コード例 #15
0
ファイル: ConvertClass.cs プロジェクト: tetrashop/Refrigitz
        private static AddToTree.Tree ConverSetToAddTreeActionFx(Set Dummy)
        {
            if (Dummy == null)
            {
                return(null);
            }
            AddToTree.Tree TreeDummy = new AddToTree.Tree(null, false);
            try
            {
                TreeDummy.SampleAccess = Dummy.StringSampleAccess;
                TreeDummy.LeftSideAccess.ThreadAccess  = TreeDummy;
                TreeDummy.RightSideAccess.ThreadAccess = TreeDummy;
            }
            catch (NullReferenceException T) { ExceptionClass.ExceptionClassMethod(T); }
            TreeDummy.SetLefTandRightCommonlySide(ConvertClass.ConverSetToAddTreeActionFx(Dummy.LeftSideAccess), ConvertClass.ConverSetToAddTreeActionFx(Dummy.RightSideAccess));

            return(TreeDummy);
        }
コード例 #16
0
 public Tree CopyNewTreeAction(AddToTree.Tree Exsit)
 {
     if (Exsit == null)
     {
         return(null);
     }
     AddToTree.Tree Current = new AddToTree.Tree(null, false);
     try
     {
         Current.SampleAccess = Exsit.SampleAccess;
         Current.SetLefTandRightCommonlySide(Exsit.CopyNewTreeAction(Exsit.LeftSideAccess), Exsit.CopyNewTreeAction(Exsit.RightSideAccess));
         //ERRORCORECTION091824098.refer to page 177.
         //ERRORCORECTION9812738 :Refet  top age 190.
         Current.LeftSideAccess.ThreadAccess  = Current;
         Current.RightSideAccess.ThreadAccess = Current;
     }
     catch (NullReferenceException t)
     { Formulas.ExceptionClass.ExceptionClassMethod(t); }
     return(Current);
 }
コード例 #17
0
 static AddToTree.Tree AddingDivisionToThreeDivStructureActionFx(AddToTree.Tree Dummy)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     if (Dummy.SampleAccess == "/")
     {
         if (Dummy.LeftSideAccess.SampleAccess == "/")
         {
             if (Dummy.RightSideAccess.SampleAccess != "/")
             {
                 AddToTree.Tree Div = new AddToTree.Tree("/", false);
                 AddToTree.Tree One = new AddToTree.Tree("1", false);
                 Div.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), One);
                 Div.LeftSideAccess.ThreadAccess  = Div;
                 Div.RightSideAccess.ThreadAccess = Div;
                 Div.ThreadAccess      = Dummy;
                 Dummy.RightSideAccess = Div;
             }
         }
         if (Dummy.LeftSideAccess.SampleAccess != "/")
         {
             if (Dummy.RightSideAccess.SampleAccess == "/")
             {
                 AddToTree.Tree Div = new AddToTree.Tree("/", false);
                 AddToTree.Tree One = new AddToTree.Tree("1", false);
                 Div.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), One);
                 Div.LeftSideAccess.ThreadAccess  = Div;
                 Div.RightSideAccess.ThreadAccess = Div;
                 Div.ThreadAccess     = Dummy;
                 Dummy.LeftSideAccess = Div;
             }
         }
     }
     Dummy.LeftSideAccess  = AddingDivisionToThreeDivStructure.AddingDivisionToThreeDivStructureActionFx(Dummy.LeftSideAccess);
     Dummy.RightSideAccess = AddingDivisionToThreeDivStructure.AddingDivisionToThreeDivStructureActionFx(Dummy.RightSideAccess);
     return(Dummy);
 }
コード例 #18
0
        static AddToTree.Tree CommonFactorSimlificationActionFx(AddToTree.Tree Dummy, ref bool CONTINUE, ref UknownIntegralSolver UIS)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            Dummy.LeftSideAccess  = CommonFactorSimlification.CommonFactorSimlificationActionFx(Dummy.LeftSideAccess, ref CONTINUE, ref UIS);
            Dummy.RightSideAccess = CommonFactorSimlification.CommonFactorSimlificationActionFx(Dummy.RightSideAccess, ref CONTINUE, ref UIS);
            //Dummy = CommonFactorSimlification.CommonFactorSuitable(Dummy,ref CONTINUE);
            int INCREASE = 2147483647 / 20;

            UIS.SetProgressValue(UIS.progressBar7, 0);
            if (IS.IsMinuseOrPluse(Dummy.CopyNewTree(Dummy).SampleAccess))
            {
                if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess) && (IS.IsDiv(Dummy.RightSideAccess.SampleAccess)))
                {
                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    AddToTree.Tree COMMONFACTOR = CommonFactor.CommonFactorFx(Dummy.LeftSideAccess.RightSideAccess, Dummy.RightSideAccess.RightSideAccess);
                    AddToTree.Tree COMMONFACTORSIMPLIFICATIONONE   = new AddToTree.Tree(null, false);
                    AddToTree.Tree COMMONFACTORSIMPLIFICATIONTOW   = new AddToTree.Tree(null, false);
                    AddToTree.Tree COMMONFACTORSIMPLIFICATIONTHREE = new AddToTree.Tree(null, false);
                    AddToTree.Tree COMMONFACTORSIMPLIFICATIONFOUR  = new AddToTree.Tree(null, false);
                    AddToTree.Tree COMMONFACTORSIMPLIFICATION      = new AddToTree.Tree(null, false);

                    /*COMMONFACTORSIMPLIFICATIONONE.SetLefTandRightCommonlySide(COMMONFACTOR.CopyNewTree(COMMONFACTOR),Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess));
                     * COMMONFACTORSIMPLIFICATIONONE.LeftSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONONE;
                     * COMMONFACTORSIMPLIFICATIONONE.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONONE;
                     * COMMONFACTORSIMPLIFICATIONONE.SampleAccess = "/";
                     */
                    COMMONFACTORSIMPLIFICATIONONE = Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess);

                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    COMMONFACTORSIMPLIFICATIONTOW.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONONE, Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess));
                    COMMONFACTORSIMPLIFICATIONTOW.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONTOW;
                    COMMONFACTORSIMPLIFICATIONTOW.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONTOW;
                    COMMONFACTORSIMPLIFICATIONTOW.SampleAccess = "*";

                    /*COMMONFACTORSIMPLIFICATIONTHREE.SetLefTandRightCommonlySide(COMMONFACTOR.CopyNewTree(COMMONFACTOR), Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess));
                     * COMMONFACTORSIMPLIFICATIONTHREE.LeftSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONTHREE;
                     * COMMONFACTORSIMPLIFICATIONTHREE.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONTHREE;
                     * COMMONFACTORSIMPLIFICATIONTHREE.SampleAccess = "/";
                     */
                    //ERRORCORECTION30704050  :Refer to page 302.
                    COMMONFACTORSIMPLIFICATIONTHREE = Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess);

                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    COMMONFACTORSIMPLIFICATIONFOUR.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONTHREE, Dummy.CopyNewTree(Dummy.RightSideAccess.LeftSideAccess));
                    COMMONFACTORSIMPLIFICATIONFOUR.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONFOUR;
                    COMMONFACTORSIMPLIFICATIONFOUR.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONFOUR;
                    COMMONFACTORSIMPLIFICATIONFOUR.SampleAccess = "*";

                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    COMMONFACTORSIMPLIFICATION.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONTOW, COMMONFACTORSIMPLIFICATIONFOUR);
                    COMMONFACTORSIMPLIFICATION.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATION;
                    COMMONFACTORSIMPLIFICATION.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATION;
                    COMMONFACTORSIMPLIFICATION.SampleAccess = Dummy.SampleAccess;

                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    COMMONFACTORSIMPLIFICATION.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATION.CopyNewTree(COMMONFACTORSIMPLIFICATION), COMMONFACTOR.CopyNewTree(COMMONFACTOR));
                    COMMONFACTORSIMPLIFICATION.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATION;
                    COMMONFACTORSIMPLIFICATION.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATION;
                    COMMONFACTORSIMPLIFICATION.SampleAccess = "/";

                    UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                    COMMONFACTORSIMPLIFICATION.ThreadAccess = Dummy.ThreadAccess;
                    //ERROCOCRECTIOn8912739879874 :The thread must be refernces to befor node.
                    Dummy    = COMMONFACTORSIMPLIFICATION;
                    CONTINUE = true;
                }
                else
                {
                    UIS.SetProgressValue(UIS.progressBar7, 2147483647 / 3);
                    if (IS.IsDiv(Dummy.LeftSideAccess.SampleAccess))
                    {
                        UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                        AddToTree.Tree COMMONFACTORSIMPLIFICATIONONE = new AddToTree.Tree(null, false);
                        AddToTree.Tree COMMONFACTORSIMPLIFICATIONTOW = new AddToTree.Tree(null, false);
                        AddToTree.Tree COMMONFACTORSIMPLIFICATION    = new AddToTree.Tree(null, false);

                        COMMONFACTORSIMPLIFICATIONONE.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess), Dummy.CopyNewTree(Dummy.RightSideAccess));
                        COMMONFACTORSIMPLIFICATIONONE.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONONE;
                        COMMONFACTORSIMPLIFICATIONONE.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONONE;
                        COMMONFACTORSIMPLIFICATIONONE.SampleAccess = "*";

                        UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                        COMMONFACTORSIMPLIFICATIONTOW.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), COMMONFACTORSIMPLIFICATIONONE.CopyNewTree(COMMONFACTORSIMPLIFICATIONONE));
                        COMMONFACTORSIMPLIFICATIONTOW.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONTOW;
                        COMMONFACTORSIMPLIFICATIONTOW.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONTOW;
                        COMMONFACTORSIMPLIFICATIONTOW.SampleAccess = Dummy.SampleAccess;

                        UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                        COMMONFACTORSIMPLIFICATION.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONTOW, Dummy.CopyNewTree(Dummy.LeftSideAccess.RightSideAccess));
                        COMMONFACTORSIMPLIFICATION.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATION;
                        COMMONFACTORSIMPLIFICATION.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATION;
                        COMMONFACTORSIMPLIFICATION.SampleAccess = "/";

                        COMMONFACTORSIMPLIFICATION.ThreadAccess = Dummy.ThreadAccess;
                        //ERROCOCRECTIOn8912739879874 :The thread must be refernces to befor node.
                        Dummy    = COMMONFACTORSIMPLIFICATION;
                        CONTINUE = true;

                        UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);
                    }
                    else
                    {
                        UIS.SetProgressValue(UIS.progressBar7, (2147483647 / 3) * 2);
                        if (IS.IsDiv(Dummy.RightSideAccess.SampleAccess))
                        {
                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                            AddToTree.Tree COMMONFACTORSIMPLIFICATIONONE = new AddToTree.Tree(null, false);
                            AddToTree.Tree COMMONFACTORSIMPLIFICATIONTOW = new AddToTree.Tree(null, false);
                            AddToTree.Tree COMMONFACTORSIMPLIFICATION    = new AddToTree.Tree(null, false);

                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                            COMMONFACTORSIMPLIFICATIONONE.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess), Dummy.CopyNewTree(Dummy.LeftSideAccess));
                            COMMONFACTORSIMPLIFICATIONONE.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONONE;
                            COMMONFACTORSIMPLIFICATIONONE.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONONE;
                            COMMONFACTORSIMPLIFICATIONONE.SampleAccess = "*";

                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                            COMMONFACTORSIMPLIFICATIONTOW.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONONE.CopyNewTree(COMMONFACTORSIMPLIFICATIONONE), Dummy.CopyNewTree(Dummy.RightSideAccess.LeftSideAccess));
                            COMMONFACTORSIMPLIFICATIONTOW.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATIONTOW;
                            COMMONFACTORSIMPLIFICATIONTOW.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATIONTOW;
                            COMMONFACTORSIMPLIFICATIONTOW.SampleAccess = Dummy.SampleAccess;

                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                            COMMONFACTORSIMPLIFICATION.SetLefTandRightCommonlySide(COMMONFACTORSIMPLIFICATIONTOW, Dummy.CopyNewTree(Dummy.RightSideAccess.RightSideAccess));
                            COMMONFACTORSIMPLIFICATION.LeftSideAccess.ThreadAccess  = COMMONFACTORSIMPLIFICATION;
                            COMMONFACTORSIMPLIFICATION.RightSideAccess.ThreadAccess = COMMONFACTORSIMPLIFICATION;
                            COMMONFACTORSIMPLIFICATION.SampleAccess = "/";
                            //ERROCOCRECTIOn8912739879874 :The thread must be refernces to befor node.

                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);

                            COMMONFACTORSIMPLIFICATION.ThreadAccess = Dummy.ThreadAccess;

                            Dummy    = COMMONFACTORSIMPLIFICATION;
                            CONTINUE = true;

                            UIS.SetProgressValue(UIS.progressBar7, INCREASE + UIS.progressBar7.Value);
                        }
                    }
                }
            }
            UIS.SetProgressValue(UIS.progressBar7, 2147483647);


            return(Dummy);
        }
コード例 #19
0
        static AddToTree.Tree DerivasionCalculator(AddToTree.Tree Node, AddToTree.Tree Dummy, ref UknownIntegralSolver UIS)
        {
            if (Node == null)
            {
                return(Dummy);
            }
            if (Node.SampleAccess == "x")
            {
                Dummy.SampleAccess = "1";
                return(Dummy);
            }
            //ERROR317142 :The structure is ok.refer to page 155.

            //ERRORCORECTION30704012 :The error correced.refer to page 155.
            if (Node.LeftSideAccess != null)
            {
                if (Node.LeftSideAccess.LeftSideAccess == null)
                {
                    if (Node.LeftSideAccess.RightSideAccess == null)
                    {
                        if (IS.IsFunction(Node.SampleAccess))
                        {
                            Dummy = Derivasion.ConsTantFuctionDerivasion(Node);
                            return(Dummy);
                        }
                        else
                        if (IS.IsNumber(Dummy.SampleAccess))
                        {
                            Dummy = null;
                            return(Dummy);
                        }
                    }
                }
            }
            if (Node.SampleAccess == "/")
            {
                AddToTree.Tree Minuse = new AddToTree.Tree("-", false);
                AddToTree.Tree MulL   = new AddToTree.Tree("*", false);
                AddToTree.Tree MulR   = new AddToTree.Tree("*", false);
                AddToTree.Tree Power  = new AddToTree.Tree("^", false);
                AddToTree.Tree DFX    = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX    = new AddToTree.Tree(null, false);
                AddToTree.Tree NRMulL = new AddToTree.Tree(null, false);
                AddToTree.Tree NRMulR = new AddToTree.Tree(null, false);
                AddToTree.Tree GX     = Node.CopyNewTree(Node.RightSideAccess);
                AddToTree.Tree IND    = new AddToTree.Tree("2", false);

                DFX    = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS);
                NRMulL = Node.RightSideAccess;

                MulL.SetLefTandRightCommonlySide(DFX, NRMulL);
                MulL.LeftSideAccess.ThreadAccess  = MulL;
                MulL.RightSideAccess.ThreadAccess = MulL;

                DGX    = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS);
                NRMulR = Node.LeftSideAccess;

                MulR.SetLefTandRightCommonlySide(DGX, NRMulR);
                MulR.LeftSideAccess.ThreadAccess  = MulR;
                MulR.RightSideAccess.ThreadAccess = MulR;

                Minuse.SetLefTandRightCommonlySide(MulL, MulR);
                Minuse.LeftSideAccess.ThreadAccess  = Minuse;
                Minuse.RightSideAccess.ThreadAccess = Minuse;

                Power.SetLefTandRightCommonlySide(GX, IND);
                Power.LeftSideAccess.ThreadAccess  = Power;
                Power.RightSideAccess.ThreadAccess = Power;

                Dummy.SampleAccess = "/";
                Dummy.SetLefTandRightCommonlySide(Minuse, Power);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess == "*")
            {
                AddToTree.Tree MulL   = new AddToTree.Tree("*", false);
                AddToTree.Tree MulR   = new AddToTree.Tree("*", false);
                AddToTree.Tree DFX    = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX    = new AddToTree.Tree(null, false);
                AddToTree.Tree NRMulL = new AddToTree.Tree(null, false);
                AddToTree.Tree NRMulR = new AddToTree.Tree(null, false);

                DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS);
                DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS);

                NRMulL = Node.LeftSideAccess;
                NRMulR = Node.RightSideAccess;

                MulL.SetLefTandRightCommonlySide(DFX, NRMulR);
                MulL.LeftSideAccess.ThreadAccess = MulL;
                if (NRMulR.SampleAccess != null)
                {
                    MulL.RightSideAccess.ThreadAccess = MulL;
                }

                MulR.SetLefTandRightCommonlySide(Node.LeftSideAccess, DGX);
                MulR.LeftSideAccess.ThreadAccess = MulR;
                if (DGX.SampleAccess != null)
                {
                    MulR.RightSideAccess.ThreadAccess = MulR;
                }

                Dummy.SampleAccess = "+";
                Dummy.SetLefTandRightCommonlySide(MulL, MulR);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess == "-")
            {
                AddToTree.Tree DFX = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX = new AddToTree.Tree(null, false);

                DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS);
                DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS);

                Dummy.SampleAccess = "-";
                Dummy.SetLefTandRightCommonlySide(DFX, DGX);

                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess == "+")
            {
                AddToTree.Tree DFX = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX = new AddToTree.Tree(null, false);

                DFX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS);
                DGX = Derivasion.DerivasionOfFX(Node.RightSideAccess, ref UIS);

                Dummy.SampleAccess = "+";
                Dummy.SetLefTandRightCommonlySide(DFX, DGX);

                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess == "^")
            {
                AddToTree.Tree ADD          = new AddToTree.Tree("+", false);
                AddToTree.Tree Copy         = Node.CopyNewTree(Node);
                AddToTree.Tree LnFX         = new AddToTree.Tree("Ln", false);
                AddToTree.Tree FXONE        = Node.CopyNewTree(Node.LeftSideAccess);
                AddToTree.Tree FXTOW        = Node.CopyNewTree(Node.LeftSideAccess);
                AddToTree.Tree GX           = Node.CopyNewTree(Node.RightSideAccess);
                AddToTree.Tree DFX          = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX          = new AddToTree.Tree(null, false);
                AddToTree.Tree MulLevelTowL = new AddToTree.Tree("*", false);
                AddToTree.Tree MulLevelTowR = new AddToTree.Tree("*", false);
                AddToTree.Tree DIVThree     = new AddToTree.Tree("/", false);

                FXONE.ThreadAccess = null;
                DFX             = Derivasion.DerivasionOfFX(FXONE, ref UIS);
                GX.ThreadAccess = null;
                DGX             = Derivasion.DerivasionOfFX(GX, ref UIS);


                DIVThree.SetLefTandRightCommonlySide(DFX, FXONE);
                DIVThree.LeftSideAccess.ThreadAccess  = DIVThree;
                DIVThree.RightSideAccess.ThreadAccess = DIVThree;

                MulLevelTowR.SetLefTandRightCommonlySide(GX, DIVThree);
                MulLevelTowR.LeftSideAccess.ThreadAccess  = MulLevelTowR;
                MulLevelTowR.RightSideAccess.ThreadAccess = MulLevelTowR;

                LnFX.SetLefTandRightCommonlySide(FXTOW, null);
                LnFX.LeftSideAccess.ThreadAccess = LnFX;
                LnFX.RightSideAccess             = null;

                MulLevelTowL.SetLefTandRightCommonlySide(DGX, LnFX);
                MulLevelTowL.LeftSideAccess.ThreadAccess  = MulLevelTowL;
                MulLevelTowL.RightSideAccess.ThreadAccess = MulLevelTowL;

                ADD.SetLefTandRightCommonlySide(MulLevelTowL, MulLevelTowR);
                ADD.LeftSideAccess.ThreadAccess  = ADD;
                ADD.RightSideAccess.ThreadAccess = ADD;

                Dummy.SampleAccess = "*";
                Dummy.SetLefTandRightCommonlySide(Copy, ADD);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (IS.IsFunction(Node.SampleAccess))
            {
                AddToTree.Tree DFoGX = Node.CopyNewTree(Node);
                AddToTree.Tree FX    = (Node);
                AddToTree.Tree GX    = Node.RightSideAccess;
                AddToTree.Tree DFX   = new AddToTree.Tree(null, false);
                AddToTree.Tree DGX   = new AddToTree.Tree(null, false);


                FX.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                FX.LeftSideAccess.SampleAccess = "x";

                DFX = Derivasion.DerivasionOfFX(FX, ref UIS);
                DGX = Derivasion.DerivasionOfFX(Node.LeftSideAccess, ref UIS);

                /*DFoGX.SetLefTandRightCommonlySide(DFX,null);
                 * DFoGX.SampleAccess = DFX.SampleAccess;
                 * DFoGX.LeftSideAccess.ThreadAccess = DFoGX;
                 * if(DFoGX.RightSideAccess!=null)
                 * DFoGX.RightSideAccess.ThreadAccess = DFoGX;
                 */
                DFoGX = Derivasion.ReplaceXToFX(DFX, Node.RightSideAccess);

                Dummy.SampleAccess = "*";
                Dummy.SetLefTandRightCommonlySide(DGX, DFoGX);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            return(Dummy);
        }
コード例 #20
0
        static AddToTree.Tree ConsTantFuctionDerivasion(AddToTree.Tree Node)
        {
            AddToTree.Tree Dummy = new AddToTree.Tree(null, false);
            if (Node.SampleAccess.ToString().ToLower() == "sin")
            {
                AddToTree.Tree X = new AddToTree.Tree("x", false);
                Dummy.SampleAccess = "Cos";
                Dummy.SetLefTandRightCommonlySide(X, null);
                Dummy.LeftSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "cos")
            {
                AddToTree.Tree X   = new AddToTree.Tree("x", false);
                AddToTree.Tree NUM = new AddToTree.Tree("-1", false);
                AddToTree.Tree MUL = new AddToTree.Tree("*", false);

                Dummy.SampleAccess = "Sin";
                Dummy.SetLefTandRightCommonlySide(X, null);
                Dummy.LeftSideAccess.ThreadAccess = Dummy;

                MUL.SetLefTandRightCommonlySide(NUM, Dummy);
                MUL.LeftSideAccess.ThreadAccess  = MUL;
                MUL.RightSideAccess.ThreadAccess = MUL;

                Dummy = MUL;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "tan")
            {
                AddToTree.Tree TanX  = new AddToTree.Tree("Tan", false);
                AddToTree.Tree Power = new AddToTree.Tree("^", false);
                AddToTree.Tree X     = new AddToTree.Tree("x", false);
                AddToTree.Tree NUML  = new AddToTree.Tree("1", false);
                AddToTree.Tree NUMR  = new AddToTree.Tree("2", false);


                TanX.SetLefTandRightCommonlySide(X, null);
                TanX.LeftSideAccess.ThreadAccess = TanX;

                Power.SetLefTandRightCommonlySide(TanX, NUMR);
                Power.LeftSideAccess.ThreadAccess  = Power;
                Power.RightSideAccess.ThreadAccess = Power;

                Dummy.SetLefTandRightCommonlySide(NUML, Power);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "cot")
            {
                AddToTree.Tree ADD   = new AddToTree.Tree("+", false);
                AddToTree.Tree CotX  = new AddToTree.Tree("Cot", false);
                AddToTree.Tree Power = new AddToTree.Tree("^", false);
                AddToTree.Tree X     = new AddToTree.Tree("x", false);
                AddToTree.Tree NUM   = new AddToTree.Tree("-1", false);
                AddToTree.Tree NUML  = new AddToTree.Tree("1", false);
                AddToTree.Tree NUMR  = new AddToTree.Tree("2", false);
                AddToTree.Tree MUL   = new AddToTree.Tree("*", false);

                CotX.SetLefTandRightCommonlySide(X, null);
                CotX.LeftSideAccess.ThreadAccess = CotX;

                Power.SetLefTandRightCommonlySide(CotX, NUMR);
                Power.LeftSideAccess.ThreadAccess  = Power;
                Power.RightSideAccess.ThreadAccess = Power;

                ADD.SetLefTandRightCommonlySide(NUML, Power);
                ADD.LeftSideAccess.ThreadAccess  = ADD;
                ADD.RightSideAccess.ThreadAccess = ADD;

                Dummy.SetLefTandRightCommonlySide(NUM, ADD);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "ln")
            {
                AddToTree.Tree X   = new AddToTree.Tree("x", false);
                AddToTree.Tree NUM = new AddToTree.Tree("1", false);

                Dummy.SampleAccess = "/";
                Dummy.SetLefTandRightCommonlySide(NUM, X);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "log")
            {
                AddToTree.Tree X    = new AddToTree.Tree("x", false);
                AddToTree.Tree NUMR = new AddToTree.Tree("1", false);
                AddToTree.Tree Ln   = new AddToTree.Tree("Ln", false);
                AddToTree.Tree NUML = new AddToTree.Tree("10", false);
                AddToTree.Tree DIV  = new AddToTree.Tree("/", false);


                Ln.SetLefTandRightCommonlySide(NUML, null);
                Ln.LeftSideAccess.ThreadAccess  = Ln;
                Ln.RightSideAccess.ThreadAccess = Ln;

                DIV.SetLefTandRightCommonlySide(NUMR, X);
                DIV.LeftSideAccess.ThreadAccess  = DIV;
                DIV.RightSideAccess.ThreadAccess = DIV;

                Dummy.SampleAccess = "*";
                Dummy.SetLefTandRightCommonlySide(Ln, DIV);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "sec")
            {
                AddToTree.Tree Sin   = new AddToTree.Tree("Sin", false);
                AddToTree.Tree Cos   = new AddToTree.Tree("Cos", false);
                AddToTree.Tree POWER = new AddToTree.Tree("^", false);
                AddToTree.Tree X     = new AddToTree.Tree("x", false);
                AddToTree.Tree MUL   = new AddToTree.Tree("*", false);
                AddToTree.Tree NUMR  = new AddToTree.Tree("2", false);
                AddToTree.Tree NUML  = new AddToTree.Tree("-1", false);

                Sin.SetLefTandRightCommonlySide(X, null);
                Sin.LeftSideAccess.ThreadAccess  = Sin;
                Sin.RightSideAccess.ThreadAccess = Sin;

                MUL.SetLefTandRightCommonlySide(NUML, Sin);
                MUL.LeftSideAccess.ThreadAccess  = MUL;
                MUL.RightSideAccess.ThreadAccess = MUL;

                Cos.SetLefTandRightCommonlySide(Cos, null);
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;

                POWER.SetLefTandRightCommonlySide(Cos, NUMR);
                POWER.LeftSideAccess.ThreadAccess  = POWER;
                POWER.RightSideAccess.ThreadAccess = POWER;

                Dummy.SetLefTandRightCommonlySide(MUL, POWER);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "csc")
            {
                AddToTree.Tree Sin   = new AddToTree.Tree("Sin", false);
                AddToTree.Tree Cos   = new AddToTree.Tree("Cos", false);
                AddToTree.Tree POWER = new AddToTree.Tree("^", false);
                AddToTree.Tree X     = new AddToTree.Tree("x", false);
                AddToTree.Tree NUMR  = new AddToTree.Tree("2", false);



                Sin.SetLefTandRightCommonlySide(X, null);
                Sin.LeftSideAccess.ThreadAccess  = Sin;
                Sin.RightSideAccess.ThreadAccess = Sin;


                Cos.SetLefTandRightCommonlySide(Cos, null);
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;

                POWER.SetLefTandRightCommonlySide(Sin, NUMR);
                POWER.LeftSideAccess.ThreadAccess  = POWER;
                POWER.RightSideAccess.ThreadAccess = POWER;

                Dummy.SetLefTandRightCommonlySide(Cos, POWER);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }
            else
            if (Node.SampleAccess.ToString().ToLower() == "root")
            {
                AddToTree.Tree Root   = new AddToTree.Tree("Root", false);
                AddToTree.Tree X      = new AddToTree.Tree("x", false);
                AddToTree.Tree MUL    = new AddToTree.Tree("*", false);
                AddToTree.Tree NUMTOW = new AddToTree.Tree("2", false);
                AddToTree.Tree NUMONE = new AddToTree.Tree("1", false);

                Root.SetLefTandRightCommonlySide(X, null);
                Root.LeftSideAccess.ThreadAccess = Root;
                //Root.RightSideAccess.ThreadAccess = Root;

                MUL.SetLefTandRightCommonlySide(NUMTOW, MUL);
                MUL.LeftSideAccess.ThreadAccess  = MUL;
                MUL.RightSideAccess.ThreadAccess = MUL;

                Dummy.SetLefTandRightCommonlySide(NUMONE, MUL);
                Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                Dummy.RightSideAccess.ThreadAccess = Dummy;
            }

            return(Dummy);
        }
コード例 #21
0
 static AddToTree.Tree SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, out bool Suitable, out bool MinuseTruePlusFalse, out bool SimplifiedTrueOtherWiseFalse, out float Num)
 {
     if (Dummy == null)
     {
         Num                          = 0;
         Suitable                     = false;
         MinuseTruePlusFalse          = false;
         SimplifiedTrueOtherWiseFalse = false;
         return(Dummy);
     }
     try
     {
         if (IS.IsMinuseOrPluse(Dummy.SampleAccess))
         {
             if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.LeftSideAccess) == null)
             {
                 if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                 {
                     Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess));
                     try
                     {
                         if ((ToSimplified.ThreadAccess.ThreadAccess == null) && (Dummy.SampleAccess == "-"))
                         {
                             SimplifiedTrueOtherWiseFalse = true;
                             MinuseTruePlusFalse          = true;
                             //LOCATION81726487 :refer to page 265.
                             AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                             Dummy = Dummy.ThreadAccess;
                             if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                             {
                                 Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null);
                                 Dummy.RightSideAccess.SampleAccess = null;
                             }
                             else
                             if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                             {
                                 //        Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy;
                                 //      Dummy.LeftSideAccess = Dummy.LeftSideAccess.RightSideAccess;
                                 Dummy.SetLefTandRightCommonlySide(null, null);
                                 Dummy.LeftSideAccess.SampleAccess = null;
                             }
                             Suitable = true;
                             return(Dummy);
                         }
                         else
                         if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.ThreadAccess.SampleAccess == "-"))
                         {
                             if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "+") && (Dummy.ThreadAccess.SampleAccess == "-"))
                             {
                                 SimplifiedTrueOtherWiseFalse = true;
                                 MinuseTruePlusFalse          = true;
                                 //LOCATION81987526487 :refer to page 265.
                                 AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                                 Dummy = Dummy.ThreadAccess;
                                 if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                                 {
                                     Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy;
                                     Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess;
                                 }
                                 else
                                 if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                                 {
                                     Dummy.SetLefTandRightCommonlySide(null, null);
                                     Dummy.LeftSideAccess.SampleAccess = null;
                                 }
                                 Suitable = true;
                                 return(Dummy);
                             }
                             else
                             if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.ThreadAccess.SampleAccess == "+"))
                             {
                                 if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "-") && (Dummy.ThreadAccess.SampleAccess == "+"))
                                 {
                                     SimplifiedTrueOtherWiseFalse = true;
                                     MinuseTruePlusFalse          = false;
                                     //LOCATION81987526487 :refer to page 265.
                                     AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                                     Dummy = Dummy.ThreadAccess;
                                     if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                                     {
                                         Dummy.RightSideAccess.RightSideAccess.ThreadAccess = Dummy;
                                         Dummy.RightSideAccess = Dummy.RightSideAccess.RightSideAccess;
                                     }
                                     else
                                     if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                                     {
                                         Dummy.SetLefTandRightCommonlySide(null, null);
                                         Dummy.LeftSideAccess.SampleAccess = null;
                                     }
                                     Suitable = true;
                                     return(Dummy);
                                 }
                             }
                         }
                     }
                     catch (NullReferenceException t)
                     { ExceptionClass.ExceptionClassMethod(t); }
                 }
                 else
                 if (Dummy.FINDTreeWithThreadConsideration(ToSimplified, Dummy.RightSideAccess) == null)
                 {
                     if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))
                     {
                         Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess));
                         Dummy.RightSideAccess.SampleAccess = null;
                         try
                         {
                             if ((ToSimplified.ThreadAccess.ThreadAccess == null) && (Dummy.SampleAccess == "-"))
                             {
                                 SimplifiedTrueOtherWiseFalse = true;
                                 MinuseTruePlusFalse          = true;
                                 //LOCATION81726487 :refer to page 265.
                                 AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                                 Dummy = Dummy.ThreadAccess;
                                 if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                                 {
                                     Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy;
                                     Dummy.RightSideAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 }
                                 else
                                 if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                                 {
                                     Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                                     Dummy.LeftSideAccess.SampleAccess = null;
                                 }
                                 Suitable = true;
                                 return(Dummy);
                             }
                             else
                             if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.SampleAccess == "-"))
                             {
                                 if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "+") && (Dummy.SampleAccess == "-"))
                                 {
                                     SimplifiedTrueOtherWiseFalse = true;
                                     MinuseTruePlusFalse          = true;
                                     //LOCATION81987526487 :refer to page 265.
                                     AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                                     Dummy = Dummy.ThreadAccess;
                                     if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                                     {
                                         Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy;
                                         Dummy.RightSideAccess = Dummy.RightSideAccess.LeftSideAccess;
                                     }
                                     else
                                     if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                                     {
                                         Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                                         Dummy.LeftSideAccess.SampleAccess = null;
                                     }
                                     Suitable = true;
                                     return(Dummy);
                                 }
                                 else
                                 if ((ToSimplified.ThreadAccess.ThreadAccess != null) && (Dummy.SampleAccess == "+"))
                                 {
                                     if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "-") && (Dummy.SampleAccess == "+"))
                                     {
                                         SimplifiedTrueOtherWiseFalse = true;
                                         MinuseTruePlusFalse          = false;
                                         //LOCATION81987526487 :refer to page 265.
                                         AddToTree.Tree HOLDER = Dummy.CopyNewTree(Dummy);
                                         Dummy = Dummy.ThreadAccess;
                                         if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, HOLDER))
                                         {
                                             Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy;
                                             Dummy.RightSideAccess = Dummy.RightSideAccess.LeftSideAccess;
                                         }
                                         else
                                         if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, HOLDER))
                                         {
                                             Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                                             Dummy.LeftSideAccess.SampleAccess = null;
                                         }
                                         Suitable = true;
                                         return(Dummy);
                                     }
                                 }
                             }
                         }
                         catch (NullReferenceException t)
                         { ExceptionClass.ExceptionClassMethod(t); }
                     }
                 }
             }
         }
         else
         {
             Num                          = 0;
             Suitable                     = false;
             MinuseTruePlusFalse          = false;
             SimplifiedTrueOtherWiseFalse = false;
             return(Dummy);
         }
     }
     catch (NullReferenceException t)
     { ExceptionClass.ExceptionClassMethod(t); }
     LocalSearchMinusPlusTowNumberSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.LeftSideAccess, ToSimplified, out Suitable, out MinuseTruePlusFalse, out SimplifiedTrueOtherWiseFalse, out Num);
     LocalSearchMinusPlusTowNumberSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, ToSimplified, out Suitable, out MinuseTruePlusFalse, out SimplifiedTrueOtherWiseFalse, out Num);
     return(Dummy);
 }
コード例 #22
0
ファイル: RadicalUX.cs プロジェクト: tetrashop/Refrigitz
        static public AddToTree.Tree RadicalUXFX()
        {
            AddToTree.Tree UX         = new AddToTree.Tree("UX", false);
            AddToTree.Tree UXFUNCTION = new AddToTree.Tree("/", false);

            AddToTree.Tree B                            = new AddToTree.Tree("b", false);
            AddToTree.Tree BPOWTOW                      = new AddToTree.Tree("b", false);
            AddToTree.Tree APOWTOW                      = new AddToTree.Tree("a", false);
            AddToTree.Tree BPOWTOWDIVAPOWTOW            = new AddToTree.Tree("/", false);
            AddToTree.Tree BPOWTOWDIVAPOWTOWMULXMINUSX0 = new AddToTree.Tree("*", false);
            AddToTree.Tree BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0 = new AddToTree.Tree("-", false);
            AddToTree.Tree TOW      = new AddToTree.Tree("2", false);
            AddToTree.Tree POW      = new AddToTree.Tree("^", false);
            AddToTree.Tree A        = new AddToTree.Tree("a", false);
            AddToTree.Tree X0       = new AddToTree.Tree("X0", false);
            AddToTree.Tree X        = new AddToTree.Tree("X", false);
            AddToTree.Tree XMINUSX0 = new AddToTree.Tree("-", false);
            AddToTree.Tree DIV      = new AddToTree.Tree("/", false);
            UX.SetLefTandRightCommonlySide(UX, null);
            UX.LeftSideAccess.ThreadAccess  = UX;
            UX.RightSideAccess.ThreadAccess = UX;

            BPOWTOW.SetLefTandRightCommonlySide(BPOWTOW.CopyNewTree(BPOWTOW), TOW.CopyNewTree(TOW));
            BPOWTOW.LeftSideAccess.ThreadAccess  = BPOWTOW;
            BPOWTOW.RightSideAccess.ThreadAccess = BPOWTOW;

            APOWTOW.SetLefTandRightCommonlySide(APOWTOW.CopyNewTree(APOWTOW), TOW.CopyNewTree(TOW));
            APOWTOW.LeftSideAccess.ThreadAccess  = APOWTOW;
            APOWTOW.RightSideAccess.ThreadAccess = APOWTOW;


            BPOWTOWDIVAPOWTOW.SetLefTandRightCommonlySide(BPOWTOW.CopyNewTree(BPOWTOW), APOWTOW.CopyNewTree(APOWTOW));
            BPOWTOWDIVAPOWTOW.LeftSideAccess.ThreadAccess  = BPOWTOWDIVAPOWTOW;
            BPOWTOWDIVAPOWTOW.RightSideAccess.ThreadAccess = BPOWTOWDIVAPOWTOW;


            BPOWTOW.SetLefTandRightCommonlySide(BPOWTOW.CopyNewTree(BPOWTOW), TOW.CopyNewTree(TOW));
            BPOWTOW.LeftSideAccess.ThreadAccess  = BPOWTOW;
            BPOWTOW.RightSideAccess.ThreadAccess = BPOWTOW;
            BPOWTOW.SampleAccess = "*";


            APOWTOW.SetLefTandRightCommonlySide(APOWTOW.CopyNewTree(APOWTOW), TOW.CopyNewTree(TOW));
            APOWTOW.LeftSideAccess.ThreadAccess  = APOWTOW;
            APOWTOW.RightSideAccess.ThreadAccess = APOWTOW;
            APOWTOW.SampleAccess = "*";


            XMINUSX0.SetLefTandRightCommonlySide(X.CopyNewTree(X), X0.CopyNewTree(X0));
            XMINUSX0.LeftSideAccess.ThreadAccess  = XMINUSX0;
            XMINUSX0.RightSideAccess.ThreadAccess = XMINUSX0;

            XMINUSX0.SetLefTandRightCommonlySide(XMINUSX0.CopyNewTree(XMINUSX0), TOW.CopyNewTree(TOW));
            XMINUSX0.LeftSideAccess.ThreadAccess  = XMINUSX0;
            XMINUSX0.RightSideAccess.ThreadAccess = XMINUSX0;
            XMINUSX0.LeftSideAccess.ThreadAccess  = XMINUSX0;
            XMINUSX0.SampleAccess = "^";

            BPOWTOWDIVAPOWTOWMULXMINUSX0.SetLefTandRightCommonlySide(BPOWTOWDIVAPOWTOW, XMINUSX0);
            BPOWTOWDIVAPOWTOWMULXMINUSX0.LeftSideAccess.ThreadAccess  = BPOWTOWDIVAPOWTOWMULXMINUSX0;
            BPOWTOWDIVAPOWTOWMULXMINUSX0.RightSideAccess.ThreadAccess = BPOWTOWDIVAPOWTOWMULXMINUSX0;

            BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0.SetLefTandRightCommonlySide(BPOWTOW.CopyNewTree(BPOWTOW), BPOWTOWDIVAPOWTOWMULXMINUSX0);
            BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0.LeftSideAccess.ThreadAccess  = BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0;
            BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0.RightSideAccess.ThreadAccess = BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0;


            UXFUNCTION.SetLefTandRightCommonlySide(BPOWTOW, BPOWTOWMINUSEBPOWTOWDIVAPOWTOWMULXMINUSX0);
            UXFUNCTION.LeftSideAccess.ThreadAccess  = UXFUNCTION;
            UXFUNCTION.RightSideAccess.ThreadAccess = UXFUNCTION;

            UX.SetLefTandRightCommonlySide(UXFUNCTION, null);
            UX.LeftSideAccess.ThreadAccess = UX;

            return(UX);
        }
 static AddToTree.Tree SuitableToSimplifierLocalThatDivIsLocatedAtDown(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MulTrueDivFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num, ref bool RETURNED)
 {
     if (Dummy == null)
     {
         return(Dummy);
     }
     if (RETURNED)
     {
         return(Dummy);
     }
     try
     {
         if (IS.IsMul(Dummy.SampleAccess))
         {
         }
         else
         if (IS.IsDiv(Dummy.SampleAccess))
         {
             if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified.RightSideAccess)) && (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess)))
             {
                 Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess);
                 try
                 {
                     if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "*") && (Dummy.SampleAccess == "/"))
                     {
                         RETURNED = true;
                         SimplifiedTrueOtherWiseFalse = true;
                         MulTrueDivFalse = false;
                         Dummy.SetLefTandRightCommonlySide(null, null);
                         Dummy.SampleAccess = "1";
                     }
                 }
                 catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
                 Suitable = true;
             }
             else
             if ((EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess.LeftSideAccess, ToSimplified.RightSideAccess)) && (IS.IsMul(Dummy.RightSideAccess.SampleAccess) && (Dummy.SampleAccess == "/")))
             {        //ERRORCORECTION9812737 Private state for Page 292.
                 try
                 {
                     if ((ToSimplified.ThreadAccess.SampleAccess == "*"))
                     {
                         RETURNED = true;
                         SimplifiedTrueOtherWiseFalse = true;
                         MulTrueDivFalse = false;
                         Dummy.RightSideAccess.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                         Dummy.RightSideAccess.LeftSideAccess.SampleAccess = "1";
                         Num = 1;
                     }
                 }
                 catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
             }
             else
             {
                 Suitable = false;
                 return(Dummy);
             }
         }
         else
         {
             RETURNED = true;
             return(Dummy);
         }
     }
     catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
     LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
     LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
     return(Dummy);
 }
コード例 #24
0
ファイル: ChangeFunction.cs プロジェクト: tetrashop/Refrigitz
        static AddToTree.Tree  ChangeFunctionFxAction(AddToTree.Tree Dummy)
        {
            if (Dummy == null)
            {
                return(null);
            }
            if ((Dummy.SampleAccess == "^") && (Dummy.LeftSideAccess.SampleAccess.ToLower() == "sin") && (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)))
            {
                AddToTree.Tree Cos = new AddToTree.Tree("Cos", false);
                AddToTree.Tree TOW = new AddToTree.Tree("2", false);
                AddToTree.Tree ONE = new AddToTree.Tree("1", false);

                float NUM = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess);
                if (NUM <= 1)
                {
                    return(Dummy);
                }
                NUM = NUM - 2;

                Cos.LeftSideAccess = new AddToTree.Tree(null, false);
                Cos.LeftSideAccess.ThreadAccess = Cos;

                Cos = Cos.LeftSideAccess;


                Cos.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), TOW.CopyNewTree(TOW));
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "*";

                Cos = Cos.ThreadAccess;

                Cos.SetLefTandRightCommonlySide(ONE, Cos.CopyNewTree(Cos));
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "-";

                Cos.SetLefTandRightCommonlySide(Cos.CopyNewTree(Cos), TOW);
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "/";

                AddToTree.Tree HOLDER      = Dummy.CopyNewTree(Dummy.ThreadAccess);
                AddToTree.Tree HOLDERDummy = Dummy.CopyNewTree(Dummy.LeftSideAccess);
                AddToTree.Tree NUMDummy    = new AddToTree.Tree(null, false);
                if (NUM > 0)
                {
                    Dummy.LeftSideAccess = Cos;
                    Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.LeftSideAccess;
                    Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess;

                    NUMDummy.SampleAccess = NUM.ToString();

                    HOLDERDummy.SetLefTandRightCommonlySide(HOLDERDummy.CopyNewTree(HOLDERDummy), NUMDummy);
                    HOLDERDummy.RightSideAccess.ThreadAccess = HOLDERDummy;
                    HOLDERDummy.LeftSideAccess.ThreadAccess  = HOLDERDummy;
                    HOLDERDummy.SampleAccess = "^";

                    Dummy.RightSideAccess = HOLDERDummy;
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                    Dummy.SampleAccess = "*";
                }
                else
                {
                    Dummy = Cos;
                }
                Dummy.ThreadAccess = HOLDER;
            }
            if ((Dummy.SampleAccess == "^") && (Dummy.LeftSideAccess.SampleAccess.ToLower() == "cos") && (IS.IsNumber(Dummy.RightSideAccess.SampleAccess)))
            {
                AddToTree.Tree Cos = new AddToTree.Tree("Cos", false);
                AddToTree.Tree TOW = new AddToTree.Tree("2", false);
                AddToTree.Tree ONE = new AddToTree.Tree("1", false);

                float NUM = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess);
                if (NUM <= 1)
                {
                    return(Dummy);
                }
                NUM = NUM - 2;

                Cos.LeftSideAccess = new AddToTree.Tree(null, false);
                Cos.LeftSideAccess.ThreadAccess = Cos;

                Cos = Cos.LeftSideAccess;


                Cos.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess.LeftSideAccess), TOW.CopyNewTree(TOW));
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "*";

                Cos = Cos.ThreadAccess;

                Cos.SetLefTandRightCommonlySide(ONE, Cos.CopyNewTree(Cos));
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "+";

                Cos.SetLefTandRightCommonlySide(Cos.CopyNewTree(Cos), TOW);
                Cos.LeftSideAccess.ThreadAccess  = Cos;
                Cos.RightSideAccess.ThreadAccess = Cos;
                Cos.SampleAccess = "/";

                AddToTree.Tree HOLDER      = Dummy.CopyNewTree(Dummy.ThreadAccess);
                AddToTree.Tree HOLDERDummy = Dummy.CopyNewTree(Dummy.LeftSideAccess);
                AddToTree.Tree NUMDummy    = new AddToTree.Tree(null, false);
                if (NUM > 0)
                {
                    Dummy.LeftSideAccess = Cos;
                    Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.LeftSideAccess;
                    Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess;

                    NUMDummy.SampleAccess = NUM.ToString();

                    HOLDERDummy.SetLefTandRightCommonlySide(HOLDERDummy.CopyNewTree(HOLDERDummy), NUMDummy);
                    HOLDERDummy.RightSideAccess.ThreadAccess = HOLDERDummy;
                    HOLDERDummy.LeftSideAccess.ThreadAccess  = HOLDERDummy;
                    HOLDERDummy.SampleAccess = "^";

                    Dummy.RightSideAccess = HOLDERDummy;
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                    Dummy.SampleAccess = "*";
                }
                else
                {
                    Dummy = Cos;
                }
                Dummy.ThreadAccess = HOLDER;
            }
            return(Dummy);
        }
コード例 #25
0
        public bool AddOprations(String Sample, String LeftSentence, String RightSentecne, bool INT, AddToTree.Tree DummyTree, ref bool ACT)
        {
            Tree Dummy          = new Tree(null, false);
            Tree DummyRightSide = new Tree(null, false);
            Tree DummyLeftSide  = new Tree(null, false);

            Dummy = Node;

            //For parantez condition.
            if (DummyTree == null)
            {
                if (Dummy != null)
                {
                    while (Dummy.RightSideAccess != null)
                    {
                        Dummy = Dummy.RightSideAccess;
                    }
                }
            }
            else
            {
                Dummy = DummyTree;
            }
            Tree LeftDummy  = new Tree(null, INT);
            Tree RightDummy = new Tree(null, INT);

            if (Dummy.GetSample() != null)
            {
                if (Sample == null)
                {
                    if (LeftSentence == null)
                    {//tL
                        RightDummy.SampleAccess = RightSentecne;
                        Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                        //test
                        Dummy.RightSideAccess.ThreadAccess = Dummy;
                        ACT = true;
                    }
                }

                if ((this.IsOperator(Sample)) && (this.IsNumber(RightSentecne)))
                {
                    //txj
                    RightDummy.SampleAccess = Sample;
                    LeftDummy.SampleAccess  = RightSentecne;
                    RightDummy.SetLefTandRightCommonlySide(LeftDummy, null);
                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                    //test
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                }
                if ((this.IsFunction(Sample)) && (this.IsNumber(RightSentecne)))
                {
                    //txi
                    RightDummy.SampleAccess = Sample;
                    LeftDummy.SampleAccess  = RightSentecne;
                    RightDummy.SetLefTandRightCommonlySide(LeftDummy, null);
                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                    //test
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                }
                //ERORRCORECTION890758746789 :The Last Sample of Parantez Closeed. refer to page 93.
                if (this.IsFunction(Sample) || this.ISindependenceVaribale(Sample) || this.IsNumber(Sample))
                {
                    if (RightSentecne == null)
                    {
                        if (LeftSentence == null)
                        {
                            //tw
                            //ERRORCORECTION786543679086 : if let side is empty do this else do else
                            if (Dummy.LeftSideAccess == null)
                            {
                                //ERRORCORECTION760947638 : The condition added.
                                if (!this.IsFunction(Dummy.GetSample()))
                                {
                                    LeftDummy.SampleAccess = Sample;
                                    Dummy.SetLefTandRightCommonlySide(LeftDummy, null);
                                    //test
                                    Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                    ACT = true;
                                }
                                else
                                {
                                    RightDummy.SampleAccess = Sample;
                                    Dummy.SetLefTandRightCommonlySide(null, RightDummy);
                                    //test
                                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                                    ACT = true;
                                }
                            }
                            else
                            {
                                RightDummy.SampleAccess = Sample;
                                Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                                //test
                                Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                ACT = true;
                            }
                        }
                    }
                }
                if ((this.IsOperator(Sample)) && (this.ISindependenceVaribale(LeftSentence)))
                {   //tziep
                    RightDummy.SampleAccess = Sample;
                    LeftDummy.SampleAccess  = LeftSentence;
                    RightDummy.SetLefTandRightCommonlySide(LeftDummy, null);
                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                    //test
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                }
                if (this.IsParantez(Sample))
                {   //y
                    RightDummy.SampleAccess = RightSentecne;
                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                    //test
                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                }
                //ERRORCORECTION981274 :The Structure is corected.refer to page 108.
                if (this.IsEqualWithThreadConsiderationCommonly(Sample))
                {
                    DummyRightSide.SampleAccess = RightSentecne;
                    Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, DummyRightSide);
                    //ERRORCORECTION281319238 :refer top page 120.
                    DummyRightSide.ThreadAccess = Dummy;
                    ACT = true;
                }
            }
            else//
            {
                if ((this.ISindependenceVaribale(Sample)) && (this.IsOperator(RightSentecne)))
                {
                    //t
                    LeftDummy.SampleAccess = RightSentecne;
                    Dummy.SampleAccess     = Sample;
                    Dummy.SetLefTandRightCommonlySide(LeftDummy, null);
                    //test
                    Dummy.LeftSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                }
                //ERROR9823748 :The Structure is not valid.In x^2+x-2.refer to page 103.error occured when next condition is taken also.
                //ERRORCORECTION1897246872 :goto added.
                if (this.IsOperator(Sample))
                {
                    //t
                    Dummy.SampleAccess = Sample;
                    //RightDummy.SetSample(RightSentecne);
                    LeftDummy.SampleAccess = LeftSentence;
                    Dummy.SetLefTandRightCommonlySide(LeftDummy, null);
                    //test
                    Dummy.LeftSideAccess.ThreadAccess = Dummy;
                    ACT = true;
                    goto End;
                }
            }
            if (this.IsOperator(Sample) && ((this.ISindependenceVaribale(LeftSentence) || (this.IsNumber(LeftSentence)))))
            {
                if (Dummy.RightSideAccess == null)
                {
                    //ERROR31078472 :The condistion is not valid(below)
                    //if ((RightSentecne != null) && (LeftSentence != null) & (Sample != null))

                    {
                        if (Dummy.ThreadAccess != null)
                        {
                            //Dummy.SetSample(Sample);
                            //RightDummy.SetSample(RightSentecne);
                            //LeftDummy.SetSample(LeftSentence);
                            //Dummy.SetLefTandRightCommonlySide(LeftDummy, null);
                            //test
                            //Dummy.LeftSideAccess.SetThread(Dummy);
                            //ERRORCORECTION1872498 :The ERROR31725 (of Equation Class) Error Correction.refer to page 102.
                            //ERRORCUASE273275  :The strucure is constructed incorrectly.
                            AddToTree.Tree ChangerLocation = new AddToTree.Tree(null, false);
                            //LeftDummy.SetSample(Sample);
                            //ERRORCUASE273275  :The strucure is constructed incorrectly. ChangerLocation.SetSample(LeftSentence);
                            //ERRORCORECTION9807 :The set sample is done.
                            //ERRORCAUSE3172 :refer top page 117.
                            //ERRORCAUSE3178324 :refer top page 120.
                            RightDummy.SampleAccess = LeftSentence;
                            Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                            ChangerLocation.SetLefTandRightCommonlySide(Dummy, ChangerLocation.RightSideAccess);
                            ChangerLocation.SampleAccess = Sample;
                            ChangerLocation.ThreadAccess = Dummy.ThreadAccess;
                            //ERROR3070403258 :refer to page 121.
                            Dummy.ThreadAccess.SetLefTandRightCommonlySide(Dummy.ThreadAccess.LeftSideAccess, ChangerLocation);
                            //ERROR239874897 :The Structre is incoreced.
                            //ERRORCORECTION238748 :The Structure is Constructed.

                            /*while (Dummy.ThreadAccess != null)
                             *  Dummy = Dummy.ThreadAccess;
                             * Node = Dummy;
                             */
                            ACT = true;
                        }
                        else
                        {
                            //ERRORCORECTION862134 :The condition added.refer top apge 121.and else.
                            AddToTree.Tree ChangerLocation = new AddToTree.Tree(null, false);
                            RightDummy.SampleAccess = LeftSentence;
                            Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                            RightDummy.ThreadAccess      = Dummy;
                            ChangerLocation.SampleAccess = Sample;
                            ChangerLocation.SetLefTandRightCommonlySide(Dummy, ChangerLocation.RightSideAccess);
                            Dummy.ThreadAccess = ChangerLocation;
                            while (Dummy.ThreadAccess != null)
                            {
                                Dummy = Dummy.ThreadAccess;
                            }
                            this.NodeAcess = Dummy;
                            ACT            = true;
                            //Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                        }
                    }
                    //ERRORCORECTION8917238973 :The condition added.refr t

                    /*ERROR31078472 :refer to page 120.
                     * else
                     * if((Sample!=null)&&(LeftSentence!=null)&&(RightSentecne==null))
                     * {
                     *
                     *  AddToTree.Tree ChangerLocation = new AddToTree.Tree(null, false);
                     *  RightDummy.SetSample(LeftSentence);
                     *  ChangerLocation.SetSample(Sample);
                     *  Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, RightDummy);
                     *  RightDummy.SetLefTandRightCommonlySide(ChangerLocation, RightDummy.RightSideAccess);
                     *  ChangerLocation.SetThread(RightDummy);
                     *  RightDummy.SetThread(Dummy);
                     * }
                     */
                }
            }
End:
            return(true);
        }
        static AddToTree.Tree SuitableToSimplifierLocalThatDivIsLocatedAtUp(AddToTree.Tree Dummy, AddToTree.Tree ToSimplified, ref bool Suitable, ref bool MulTrueDivFalse, ref bool SimplifiedTrueOtherWiseFalse, ref float Num, ref bool RETURNED)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            if (RETURNED)
            {
                return(Dummy);
            }
            try
            {
                if (IS.IsMul(Dummy.SampleAccess))
                {
                    //if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified))
                    if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, ToSimplified.RightSideAccess))
                    {
                        if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                        {
                            Num = (float)System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess);
                            try
                            {
                                if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "/") && (Dummy.SampleAccess == "*"))
                                {
                                    RETURNED = true;
                                    SimplifiedTrueOtherWiseFalse = true;
                                    MulTrueDivFalse = true;
                                    Dummy.SetLefTandRightCommonlySide(null, null);
                                    Dummy.SampleAccess = "1";
                                    Suitable           = true;
                                    return(Dummy);
                                }
                            }
                            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
                        }

                        /*else
                         * {  //ERRORCORECTION13175402 :Considerable.
                         *  RETURNED = true;
                         *  SimplifiedTrueOtherWiseFalse = true;
                         *  MulTrueDivFalse = true;
                         *  Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null);
                         *  Dummy.RightSideAccess.SampleAccess = "1";
                         *  Suitable = true;
                         *  Num = 1;
                         *  return Dummy;
                         * }
                         */
                    }
                    else
                    if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, ToSimplified.RightSideAccess))
                    {
                        if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))
                        {
                            Num = (float)System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess);
                            try
                            {
                                if ((ToSimplified.ThreadAccess.ThreadAccess.SampleAccess == "/") && (Dummy.ThreadAccess.SampleAccess == "*"))
                                {
                                    RETURNED = true;
                                    SimplifiedTrueOtherWiseFalse = true;
                                    MulTrueDivFalse = true;
                                    Dummy.SetLefTandRightCommonlySide(null, null);
                                    Dummy.SampleAccess = "1";
                                    Suitable           = true;
                                    return(Dummy);
                                }
                            }
                            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
                        }

                        /*else
                         * {//ERRORCORECTION13175402 :Considerable.
                         *  SimplifiedTrueOtherWiseFalse = true;
                         *  MulTrueDivFalse = true;
                         *  Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                         *  Dummy.LeftSideAccess.SampleAccess = "1";
                         *  Suitable = true;
                         *  Num = 1;
                         *  return Dummy;
                         * }*/
                    }
                }
                else
                {
                    RETURNED = true;
                    return(Dummy);
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.LeftSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
            LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.RightSideAccess, ToSimplified, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
            return(Dummy);
        }
コード例 #27
0
        static AddToTree.Tree MulDivisionSorterFxAction(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS, ref bool CONTINUE)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            AddToTree.Tree Holder = Dummy;
            Dummy.LeftSideAccess = MulDivisionSorter.MulDivisionSorterFxAction(Dummy.LeftSideAccess, ref UIS, ref CONTINUE);
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            Dummy.RightSideAccess = MulDivisionSorter.MulDivisionSorterFxAction(Dummy.RightSideAccess, ref UIS, ref CONTINUE);
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            int INCREASE = 2147483647 / 12;

            UIS.SetProgressValue(UIS.progressBar13, 0);

            AddToTree.Tree Current = new AddToTree.Tree(null, false);

            bool BREAK = false;

            UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);
            while ((Dummy != null) && (Dummy.RightSideAccess != null))
            {
                AddToTree.Tree HolderCurrent = Dummy;
                if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                {
                    break;
                }
                if (IS.IsFunction(Dummy.SampleAccess))
                {
                    break;
                }
                Current = Dummy.RightSideAccess;
                if (!IS.IsDiv(Current.SampleAccess))
                {
                    break;
                }
                if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                {
                    BREAK = true;
                }

                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                if (!BREAK)
                {
                    while ((Current != null) && (Current.RightSideAccess != null))
                    {
                        if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current))
                        {
                            break;
                        }
                        if (IS.IsFunction(Current.SampleAccess))
                        {
                            break;
                        }
                        //ERRORCORECTION1982748234 :Refer to page 249.
                        if (!((Dummy.SampleAccess == "*") && (Current.SampleAccess == "/")))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Current))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                        {
                            break;
                        }
                        if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                        {
                            BREAK = true;//LOCATION98174723742 :Rfer to page 249.
                        }
                        //ERROR1892386124 :The Same node of Current and Dummy node.refer to page 238.
                        if (!BREAK)//ERRORCORECTION897123 :The ERROR31704152 corrected.
                        {
                            if ((Current.SampleAccess == "/") && (Dummy.SampleAccess == "*"))
                            {
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                if (Dummy.FINDTreeWithThreadConsideration(Current, Dummy) != null)
                                {
                                    break;
                                }
                                CONTINUE = true;
                                AddToTree.Tree LOCAL = Dummy;
                                //ERROR1928749712 :The *** Mraked edited.refer to page 256.
                                AddToTree.Tree MUL = new AddToTree.Tree("*", false);
                                MUL.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.LeftSideAccess), Current.CopyNewTree(Current.LeftSideAccess));

                                MUL.ThreadAccess = null;

                                MUL.LeftSideAccess.ThreadAccess  = MUL;
                                MUL.RightSideAccess.ThreadAccess = MUL;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                AddToTree.Tree Contained = Dummy;

                                while (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Current, Dummy)))
                                {
                                    Dummy = Dummy.RightSideAccess;
                                }
                                //====

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                Dummy = Dummy.ThreadAccess;
                                //ERROR92834876 :The Division node is located at left side of Mul and in othere is located at right side.refer to page 336.

                                /*Dummy.RightSideAccess.LeftSideAccess = MUL;
                                 * Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 */
                                //ERRORCORECTION19208734 :The Above Error.(ERROR92834876)refer to page 336.
                                Dummy.RightSideAccess.LeftSideAccess = MUL;
                                Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.RightSideAccess.LeftSideAccess;
                                Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);



                                //while ((Dummy.ThreadAccess != null) && (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL))))
                                //  Dummy = Dummy.ThreadAccess;

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                if (Dummy.ThreadAccess != null)
                                {
                                    //Dummy = Dummy.ThreadAccess;
                                    //Dummy.RightSideAccess = Dummy.LeftSideAccess.LeftSideAccess;
                                    //ERRORCUASED817263 :Refer to page 244.
                                    //Dummy.ThreadAccess = A;
                                    //Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                    Dummy.RightSideAccess.ThreadAccess = Dummy.ThreadAccess;
                                    Dummy = Dummy.RightSideAccess;
                                }
                                else
                                {
                                    Dummy = Dummy.RightSideAccess;
                                    Dummy.ThreadAccess = null;
                                }
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MULATED.ADDToTree(Dummy);
                                MULATED.ADDToTree(Current);
                                //Holder = Dummy;
                                //        while ((Dummy != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL)))
                                //          Dummy = Dummy.RightSideAccess;
                                break;
                            }
                        }
                        Current = Current.RightSideAccess;
                    }
                }
                if (BREAK)
                {
                    break;
                }
                if (!CONTINUE)
                {
                    if (Dummy.RightSideAccess != null)
                    {
                        Dummy = Dummy.RightSideAccess;
                    }
                }
                else
                {
                    break;
                }
                //               if (Dummy.RightSideAccess != null)
                //             Current = Dummy.RightSideAccess;
            }

            UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

            //while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Holder)))
            //       Dummy = Dummy.ThreadAccess;


            Current = Dummy.LeftSideAccess;

            while ((Dummy != null) && (Dummy.LeftSideAccess != null))
            {
                if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                {
                    break;
                }
                if (IS.IsFunction(Dummy.SampleAccess))
                {
                    break;
                }
                Current = Dummy.LeftSideAccess;
                if (!IS.IsDiv(Current.SampleAccess))
                {
                    break;
                }
                AddToTree.Tree HolderCurrent = Dummy;
                if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                {
                    BREAK = true;
                }
                if (!BREAK)
                {
                    while ((Current != null) && (Current.LeftSideAccess != null))
                    {
                        if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Current))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Current))
                        {
                            break;
                        }
                        //ERRORCORECTINO1782647 :On four Section of while added thwe non function condition.refre to page 226.
                        if (IS.IsFunction(Current.SampleAccess))
                        {
                            break;
                        }
                        if (MULATED.FINDTreeWithThreadConsideration(Dummy))
                        {
                            break;
                        }
                        if (IS.IsOperator(Dummy.SampleAccess) && (!((Dummy.SampleAccess == "*") || (Dummy.SampleAccess == "/"))))
                        {
                            BREAK = true;
                        }
                        //ERRORCORECTION1982748234 :Refer to page 249.
                        if (!((Dummy.SampleAccess == "*") && (Current.SampleAccess == "/")))
                        {
                            break;  //LOCATION98174723741 :Refer to page 249
                        }
                        if (!BREAK) //ERRORCORECTION897123 :The ERROR31704152 corrected.
                        {
                            if ((Current.SampleAccess == "/") && (Dummy.SampleAccess == "*"))
                            {
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                if (Dummy.FINDTreeWithThreadConsideration(Current, Dummy) != null)
                                {
                                    break;
                                }
                                CONTINUE = true;
                                AddToTree.Tree LOCAL = Dummy;
                                AddToTree.Tree MUL   = new AddToTree.Tree("*", false);
                                MUL.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), Current.CopyNewTree(Current.LeftSideAccess));

                                MUL.ThreadAccess = null;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MUL.LeftSideAccess.ThreadAccess  = MUL;
                                MUL.RightSideAccess.ThreadAccess = MUL;

                                AddToTree.Tree Contained = Dummy;

                                while (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Current, Dummy)))
                                {
                                    Dummy = Dummy.LeftSideAccess;
                                }
                                //ERRRORCORECTION1297192 :Replacement mul on non-proper location.reer to page 218.

                                //Dummy = Dummy.LeftSideAccess;

                                //                        Dummy.LeftSideAccess = MUL;
                                //                      Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                //                    Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.LeftSideAccess;
                                //                  Dummy.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess;
                                Dummy = Dummy.ThreadAccess;
                                //ERROR92834876 :The Division node is located at left side of Mul and in othere is located at right side.refer to page 336.

                                /*Dummy.RightSideAccess.LeftSideAccess = MUL;
                                 * Dummy.RightSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 * Dummy.RightSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.RightSideAccess.LeftSideAccess;
                                 */
                                //ERRORCORECTION19208734 :The Above Error.(ERROR92834876)refer to page 336.
                                Dummy.LeftSideAccess.LeftSideAccess = MUL;
                                Dummy.LeftSideAccess.LeftSideAccess.ThreadAccess = Dummy.RightSideAccess;
                                Dummy.LeftSideAccess.LeftSideAccess.LeftSideAccess.ThreadAccess  = Dummy.LeftSideAccess.LeftSideAccess;
                                Dummy.LeftSideAccess.LeftSideAccess.RightSideAccess.ThreadAccess = Dummy.LeftSideAccess.LeftSideAccess;

                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);



                                //while ((Dummy.ThreadAccess != null) && (!(EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,LOCAL))))
                                //  Dummy = Dummy.ThreadAccess;

                                //LOCATION30415071.refer to page 256.
                                //ERRORCORECTION9318279 :The invalid leftside assignment.refer to page 218.
                                if (Dummy.ThreadAccess != null)
                                {
                                    //Dummy = Dummy.ThreadAccess;
                                    //Dummy.RightSideAccess = Dummy.LeftSideAccess.LeftSideAccess;
                                    //ERRORCUASED817263 :Refer to page 244.
                                    //Dummy.ThreadAccess = A;
                                    //Dummy.LeftSideAccess.ThreadAccess = Dummy;
                                    Dummy.LeftSideAccess.ThreadAccess = Dummy.ThreadAccess;
                                    Dummy = Dummy.LeftSideAccess;
                                }
                                else
                                {
                                    Dummy = Dummy.LeftSideAccess;
                                    Dummy.ThreadAccess = null;
                                }
                                UIS.SetProgressValue(UIS.progressBar13, INCREASE + UIS.progressBar13.Value);

                                MULATED.ADDToTree(Dummy);
                                MULATED.ADDToTree(Current);
                                //Holder = Dummy;
                                //while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy,Contained))
                                //  Dummy = Dummy.ThreadAccess;
                                break;
                            }
                        }
                        Current = Current.LeftSideAccess;
                    }
                }
                if (BREAK)
                {
                    break;
                }
                if (!CONTINUE)
                {
                    if (Dummy.LeftSideAccess != null)
                    {
                        Dummy = Dummy.LeftSideAccess;
                    }
                }
                else
                {
                    break;
                }
                //
                //if (Dummy.LeftSideAccess != null)
                //  Current = Dummy.LeftSideAccess;
            }
            //while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, Holder)))
            //  Dummy = Dummy.ThreadAccess;
            //ERROCORECTION198274896 :The Thread become null and the extra mulated nodes dose not removed.refer to page 336.
            try
            {
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.LeftSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.LeftSideAccess;
                }
                else
                if (EqualToObject.IsEqualWithOutThreadConsiderationCommonly(Dummy.RightSideAccess.ThreadAccess, Dummy.ThreadAccess))
                {
                    Dummy = Dummy.RightSideAccess;
                }
            }
            catch (NullReferenceException t)
            { ExceptionClass.ExceptionClassMethod(t); }
            UIS.SetProgressValue(UIS.progressBar13, 2147483647);
            return(Dummy);
        }
        static AddToTree.Tree LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(AddToTree.Tree Dummy, ref bool MULDIVISIONWITHNUMBERMULATED, ref UknownIntegralSolver UIS)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            bool SimplifiedTrueOtherWiseFalse = false;
            bool Suitable        = false;
            bool MulTrueDivFalse = false;
            bool RETURNED        = false;

            float Num = 0;

            try
            {
                if (Dummy.RightSideAccess.SampleAccess == "/")
                {//ERRORCORECTION19862348761 :Refer to page 288.
                    LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtUp(Dummy.LeftSideAccess, Dummy.RightSideAccess, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
                    if (SimplifiedTrueOtherWiseFalse)
                    {
                        Dummy = Dummy.RightSideAccess;
                        if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                        {
                            Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null);
                            Dummy.RightSideAccess.SampleAccess = "1";
                            Num = Num * (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess));
                            if (Num == 0)
                            {
                                Dummy.LeftSideAccess.SampleAccess = null;
                            }
                            else
                            {
                                Dummy.LeftSideAccess.SampleAccess = Num.ToString();
                            }
                            MULDIVISIONWITHNUMBERMULATED = true;
                        }

                        /*else
                         *  if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))
                         *  {
                         *      Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                         *      Dummy.LeftSideAccess.SampleAccess = "1";
                         *      Num = Num / (float)(System.Convert.ToDouble(Dummy.RightSideAccess.SampleAccess));
                         *      if (Num == 0)
                         *          Dummy.RightSideAccess.SampleAccess = null;
                         *      else
                         *          Dummy.RightSideAccess.SampleAccess = Num.ToString();
                         *  }
                         *  else
                         *  {
                         *      Dummy.SetLefTandRightCommonlySide(null, null);
                         *      if (Num == 0)
                         *          Dummy.SampleAccess = null;
                         *      else
                         *          Dummy.SampleAccess = Num.ToString();
                         *  }
                         */
                    }
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }

            if (SimplifiedTrueOtherWiseFalse)
            {
                Dummy = Dummy.ThreadAccess;
                AddToTree.Tree HOLDERTHRED = Dummy.ThreadAccess;
                Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS);
                Dummy.ThreadAccess = HOLDERTHRED;
            }
            SimplifiedTrueOtherWiseFalse = false;
            Suitable        = false;
            MulTrueDivFalse = false;
            Num             = 0;
            RETURNED        = false;
            try
            {
                if (Dummy.LeftSideAccess.SampleAccess == "*")
                {
                    LocalSearchMulDivionWithNumberMulatedEqualSimplifier.SuitableToSimplifierLocalThatDivIsLocatedAtDown(Dummy.RightSideAccess, Dummy.LeftSideAccess, ref Suitable, ref MulTrueDivFalse, ref SimplifiedTrueOtherWiseFalse, ref Num, ref RETURNED);
                    if (SimplifiedTrueOtherWiseFalse)
                    {//ERRORCORECTION1274 :Refer to page 292.
                        Dummy = Dummy.LeftSideAccess;
                        if (IS.IsNumber(Dummy.RightSideAccess.SampleAccess))
                        {
                            Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null);
                            Dummy.LeftSideAccess.SampleAccess = "1";
                            Num = (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess)) / Num;
                            if (Num == 0)
                            {
                                Dummy.RightSideAccess.SampleAccess = null;
                            }
                            else
                            {
                                Dummy.RightSideAccess.SampleAccess = Num.ToString();
                            }
                            MULDIVISIONWITHNUMBERMULATED = true;
                        }
                        else
                        if (IS.IsNumber(Dummy.LeftSideAccess.SampleAccess))
                        {
                            Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null);
                            Dummy.RightSideAccess.SampleAccess = "1";
                            Num = Num * (float)(System.Convert.ToDouble(Dummy.LeftSideAccess.SampleAccess));
                            if (Num == 0)
                            {
                                Dummy.LeftSideAccess.SampleAccess = null;
                            }
                            else
                            {
                                Dummy.LeftSideAccess.SampleAccess = Num.ToString();
                            }
                            MULDIVISIONWITHNUMBERMULATED = true;
                        }
                        else
                        {
                            Dummy.SetLefTandRightCommonlySide(null, null);
                            if (Num == 0)
                            {
                                Dummy.SampleAccess = null;
                            }
                            else
                            {
                                Dummy.SampleAccess = Num.ToString();
                            }
                            MULDIVISIONWITHNUMBERMULATED = true;
                        }
                    }
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }

            if (SimplifiedTrueOtherWiseFalse)
            {
                Dummy = Dummy.ThreadAccess;
                AddToTree.Tree HOLDERTHRED = Dummy.ThreadAccess;
                Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS);
                Dummy.ThreadAccess = HOLDERTHRED;
            }

            LocalSearchMulDivionWithNumberMulatedEqualSimplifier.LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(Dummy.LeftSideAccess, ref MULDIVISIONWITHNUMBERMULATED, ref UIS);
            LocalSearchMulDivionWithNumberMulatedEqualSimplifier.LocalSearchMulDivionWithNumberMulatedEqualSimplifierActionFx(Dummy.RightSideAccess, ref MULDIVISIONWITHNUMBERMULATED, ref UIS);
            return(Dummy);
        }
コード例 #29
0
        static private AddToTree.Tree TrasmisionActionHole(AddToTree.Tree Dummy)
        {
            //ERROR13107142 :This code cuased to an infinite loop.refer to page 182.
            if (Dummy == null)
            {
                return(Dummy);
            }
            TransmisionToDeleteingMinusPluse.TrasmisionActionHole(Dummy.LeftSideAccess);
            TransmisionToDeleteingMinusPluse.TrasmisionActionHole(Dummy.RightSideAccess);
            try
            {
                bool           ABLE          = false;
                AddToTree.Tree CurrentObject = Dummy;
                AddToTree.Tree NODE          = Dummy;
                AddToTree.Tree FIRST         = Dummy;
                while ((IS.IsOperator(FIRST.SampleAccess)) && (FIRST.SampleAccess != "/") && (FIRST.SampleAccess != "^") && (FIRST.ThreadAccess != null))
                {
                    FIRST = FIRST.ThreadAccess;
                }

                int DeepLeft = 0;
                while ((NODE.LeftSideAccess != null) && (IS.IsOperator(NODE.SampleAccess)) && (NODE.SampleAccess != "/") && (NODE.SampleAccess != "^"))
                {
                    NODE = NODE.LeftSideAccess;
                    DeepLeft++;
                }
                //ERRORCORECTION9872423784 :The ERRORCUASE713040 Correction.refer to page 182.
                if (NODE.LeftSideAccess != null)
                {
                    if (NODE.LeftSideAccess.LeftSideAccess != null)
                    {
                        ABLE = true;
                    }
                }

                if (ABLE)
                {
                    if (DeepLeft > 1)
                    {
                        AddToTree.Tree Last = NODE.CopyNewTree(NODE.ThreadAccess);

                        Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, FIRST);
                        AddToTree.Tree Holder = Dummy.RightSideAccess;
                        Dummy.SetLefTandRightCommonlySide(Dummy.LeftSideAccess, Last.LeftSideAccess);
                        Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                        Dummy.RightSideAccess.ThreadAccess = Dummy;

                        while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, Last))
                        {
                            Dummy = Dummy.LeftSideAccess;
                        }
                        Dummy.LeftSideAccess = Holder;

                        Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                        Dummy.RightSideAccess.ThreadAccess = Dummy;
                        while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, CurrentObject)))
                        {
                            Dummy = Dummy.ThreadAccess;
                        }
                    }
                }

                ABLE  = false;
                NODE  = Dummy;
                FIRST = Dummy;

                while ((IS.IsOperator(FIRST.SampleAccess)) && (FIRST.SampleAccess != "^") && (FIRST.SampleAccess != "/") && (FIRST.ThreadAccess != null))
                {
                    FIRST = FIRST.ThreadAccess;
                }

                int DeepRight = 0;
                while ((NODE.RightSideAccess != null) && (IS.IsOperator(NODE.SampleAccess)) && (NODE.SampleAccess != "/") && (NODE.SampleAccess != "^"))
                {
                    NODE = NODE.RightSideAccess;
                    DeepRight++;
                }
                //ERRORCORECTION9872423784 :The ERRORCUASE713040 Correction.refer to page 182.
                if (NODE.RightSideAccess != null)
                {
                    if (NODE.RightSideAccess.RightSideAccess != null)
                    {
                        ABLE = false;
                    }
                }

                if (ABLE)
                {
                    if (DeepRight > 1)
                    {
                        AddToTree.Tree Last = NODE.CopyNewTree(NODE.ThreadAccess);
                        Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, FIRST);
                        AddToTree.Tree Holder = Dummy.LeftSideAccess;
                        Dummy.SetLefTandRightCommonlySide(Last.RightSideAccess, Dummy.RightSideAccess);
                        Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                        Dummy.RightSideAccess.ThreadAccess = Dummy;

                        while (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.RightSideAccess, Last))
                        {
                            Dummy = Dummy.RightSideAccess;
                        }
                        Dummy.RightSideAccess              = Holder;
                        Dummy.LeftSideAccess.ThreadAccess  = Dummy;
                        Dummy.RightSideAccess.ThreadAccess = Dummy;
                        while ((Dummy.ThreadAccess != null) && (!EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy, CurrentObject)))
                        {
                            Dummy = Dummy.ThreadAccess;
                        }
                    }
                }
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            return(Dummy);
        }
コード例 #30
0
        static public AddToTree.Tree SuitableStructureForLocalSimplifierConverstionOfDivToMul(AddToTree.Tree Dummy, ref bool CONVERSION, ref UknownIntegralSolver UIS)
        {
            if (Dummy == null)
            {
                return(Dummy);
            }
            if (CONVERSION)
            {
                return(Dummy);
            }
            bool CUREENTCONVERSION = false;

            AddToTree.Tree HOLDER      = Dummy;
            AddToTree.Tree HOLDERTOMUL = new AddToTree.Tree(null, false);
            bool           FIND        = false;

            try
            {
                if (Dummy.SampleAccess == "/")
                {
                    while (IS.IsMulOrDiv(Dummy.SampleAccess))
                    {//ERRORCORECTION31704050 :Refer to page 290.
                        if (Dummy.ThreadAccess != null)
                        {
                            Dummy = Dummy.ThreadAccess;
                            FIND  = true;

                            /*bool LEFTTRUERIGHTFALSE = false;
                             * if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.LeftSideAccess, Dummy))
                             *  LEFTTRUERIGHTFALSE = true;
                             * else
                             *  LEFTTRUERIGHTFALSE = false;
                             */
                            bool BREAK = false;
                            if (Dummy.SampleAccess == "/")
                            {
                                HOLDERTOMUL = Dummy.CopyNewTree(Dummy.RightSideAccess);
                                Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null);
                                Dummy.RightSideAccess.SampleAccess = "1";
                                Dummy.SampleAccess = "*";
                                do
                                {
                                    Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER);
                                    AddToTree.Tree NEW = new AddToTree.Tree("*", false);
                                    NEW.SetLefTandRightCommonlySide(Dummy.CopyNewTree(Dummy.RightSideAccess), HOLDERTOMUL);
                                    NEW.LeftSideAccess.ThreadAccess    = NEW;
                                    NEW.RightSideAccess.ThreadAccess   = NEW;
                                    Dummy.RightSideAccess              = NEW;
                                    Dummy.RightSideAccess.ThreadAccess = Dummy;
                                    System.Media.SystemSounds.Beep.Play();
                                    BREAK             = true;
                                    CUREENTCONVERSION = true;
                                    //break;
                                } while (!BREAK);
                            }

                            /*else
                             * {
                             * if (LEFTTRUERIGHTFALSE)
                             *      Dummy = Dummy.LeftSideAccess;
                             *  else
                             *      Dummy = Dummy.RightSideAccess;
                             *
                             * }
                             */
                            if (BREAK)
                            {
                                break;
                            }
                        }
                        else
                        {
                            Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER);
                            FIND  = false;
                            break;
                        }
                    }
                }
                //ADD7317 :refer to page 291.
                if (CUREENTCONVERSION)
                {
                    AddToTree.Tree THREAD = Dummy.ThreadAccess;
                    Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS);
                    Dummy.ThreadAccess = THREAD;
                }
                else
                if (FIND)
                {
                    Dummy = Dummy.FINDTreeWithThreadConsideration(Dummy, HOLDER);
                    FIND  = false;
                }


                SuitableStructureForLocalSimplifier.SuitableStructureForLocalSimplifierConverstionOfDivToMul(Dummy.LeftSideAccess, ref CONVERSION, ref UIS);
                SuitableStructureForLocalSimplifier.SuitableStructureForLocalSimplifierConverstionOfDivToMul(Dummy.RightSideAccess, ref CONVERSION, ref UIS);
            }
            catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); }
            catch (StackOverflowException t) { ExceptionClass.ExceptionClassMethod(t); }
            return(Dummy);
        }