static AddToTree.Tree LocalSearchMulDivisionEqualSimplifierActionFx(AddToTree.Tree Dummy, ref bool MULDIVISIONEQUAL, ref UknownIntegralSolver UIS) { if (Dummy == null) { return(Dummy); } bool SimplifiedTrueOtherWiseFalse = false; bool Suitable = false; bool DivTrueMulFalse = false; LocalSearchMulDivisionEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtLeft(Dummy.RightSideAccess, Dummy.LeftSideAccess, ref Suitable, ref DivTrueMulFalse, ref SimplifiedTrueOtherWiseFalse); if (SimplifiedTrueOtherWiseFalse) { Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = "1"; MULDIVISIONEQUAL = true; } SimplifiedTrueOtherWiseFalse = false; Suitable = false; DivTrueMulFalse = false; LocalSearchMulDivisionEqualSimplifier.SuitableToSimplifierLocalThatToSimplifiedLocatedAtRight(Dummy.LeftSideAccess, Dummy.RightSideAccess, ref Suitable, ref DivTrueMulFalse, ref SimplifiedTrueOtherWiseFalse); if (SimplifiedTrueOtherWiseFalse) { Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; MULDIVISIONEQUAL = true; } Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); LocalSearchMulDivisionEqualSimplifier.LocalSearchMulDivisionEqualSimplifierActionFx(Dummy.LeftSideAccess, ref MULDIVISIONEQUAL, ref UIS); LocalSearchMulDivisionEqualSimplifier.LocalSearchMulDivisionEqualSimplifierActionFx(Dummy.RightSideAccess, ref MULDIVISIONEQUAL, ref UIS); return(Dummy); }
static public AddToTree.Tree SpliterFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { try { Dummy.ThreadAccess = null; Dummy = Simplifier.ArrangmentForSpliter(Dummy); Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); //ERRORCORECTION198234871648 :The condition of splitation added.refer to page 339. Dummy = SplitationAllowed.SplitationAllowedFx(Dummy, ref UIS); bool CONTINUSE = false; do { CONTINUSE = false; if (Spliter.ISAtLeastOneDivisionAtNode(Dummy)) { Dummy = Spliter.SpliterCalculator(Dummy, ref CONTINUSE, ref UIS); } }while (CONTINUSE); } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } return(Dummy); }
static AddToTree.Tree FactorActivationActionFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { //ERROR932875987 : Refer to page 301 :If The Non Copy of Dummy Passes to method the result of dummy become invalid. //AddToTree.Tree Factor = FactorActivation.GetBigestCommonFactor(Dummy.CopyNewTree(Dummy)); AddToTreeTreeLinkList FactorLinkList = FactorActivation.GetBigestCommonFactor(Dummy.CopyNewTree(Dummy), ref UIS); bool Action = false; bool Mul = false; if (!(FactorLinkList.ISEmpty())) { AddToTree.Tree Factor = new AddToTree.Tree(null, false); //ERROR293846210394 :The effection of Thread is not act on thread. //AddToTree.Tree Holder = Dummy.CopyNewTree(Dummy.ThreadAccess); //ERROCORECTION91827831294 :The thread validation is corrected.refer to page 335. AddToTree.Tree Holder = Dummy.ThreadAccess; bool LeftTrueRightFalse = false; try { if (EqualToObject.IsEqualWithThreadConsiderationCommonly(Dummy.ThreadAccess.RightSideAccess, Dummy)) { LeftTrueRightFalse = false; } else { LeftTrueRightFalse = true; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } Dummy.ThreadAccess = null; while (!(FactorLinkList.ISEmpty())) { Factor = FactorLinkList.DELETEFromTreeFirstNode(); Dummy = FactorActivation.FactorActivationDivActionFx(Dummy.CopyNewTree(Dummy), Factor, ref Action, ref Mul, FactorLinkList.CopyLinkList()); } while (Dummy.ThreadAccess != null) { Dummy = Dummy.ThreadAccess; } Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); try { if (!LeftTrueRightFalse) { Holder.RightSideAccess = Dummy; } else { Holder.LeftSideAccess = Dummy; } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } Dummy.ThreadAccess = Holder; } return(Dummy); }
static public AddToTreeTreeLinkList GetMultedElements(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { AddToTreeTreeLinkList HOLDER = new AddToTreeTreeLinkList(); try { if (Dummy.SampleAccess != "*") { HOLDER.ADDToTree(Dummy); } else//ERRORCORECTION912847 :refer to page 302. { while (!((Dummy.LeftSideAccess == null) && (Dummy.RightSideAccess == null))) { //ERROCORECTION172487 ;the non copy strategy cused to invalid result(effection of To be "1").refer to page 302. if (Dummy.LeftSideAccess.SampleAccess != "*") // if (!(HOLDER.FINDTreeWithOutThreadConsideration(Dummy.LeftSideAccess))) { HOLDER.ADDToTree(Dummy.CopyNewTree(Dummy.LeftSideAccess)); Dummy.LeftSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.LeftSideAccess.SampleAccess = "1"; } if (Dummy.RightSideAccess.SampleAccess != "*") // if (!(HOLDER.FINDTreeWithOutThreadConsideration(Dummy.RightSideAccess))) { HOLDER.ADDToTree(Dummy.CopyNewTree(Dummy.RightSideAccess)); Dummy.RightSideAccess.SetLefTandRightCommonlySide(null, null); Dummy.RightSideAccess.SampleAccess = "1"; } Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); } } } catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } return(HOLDER); }
static public AddToTree.Tree SimplifierCommonSubFactorCalculatorFx(AddToTree.Tree Dummy, ref bool CONTINUE, ref UknownIntegralSolver UIS) { if ((Dummy == null) || (!(IS.IsDivInNode(Dummy)))) { return(Dummy); } //ERRORCORECTION2189743 :the Second condition of above is added. int INCREASE = 2147483647 / 9; UIS.SetProgressValue(UIS.progressBar9, 0); if (Dummy.SampleAccess == "/") { UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy.LeftSideAccess = FactorActivation.FactorActivationFx(Dummy.LeftSideAccess, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy.RightSideAccess = FactorActivation.FactorActivationFx(Dummy.RightSideAccess, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); /* try * { * Dummy.LeftSideAccess.ThreadAccess = Dummy; * Dummy.RightSideAccess.ThreadAccess = Dummy; * } * catch (NullReferenceException t) { ExceptionClass.ExceptionClassMethod(t); } */ UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); Dummy = NumberDivMul.NumberDivMulFx(Dummy, ref UIS); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); AddToTreeTreeLinkList COMMONFACTOR = FindSubFactor.FindSubFactorFx(Dummy.LeftSideAccess, Dummy.RightSideAccess); bool ENDLEFT = false; bool ENDRIGHT = false; AddToTree.Tree COMMONSUBFACORT = new AddToTree.Tree(null, false); UIS.SetProgressValue(UIS.progressBar9, INCREASE + UIS.progressBar9.Value); while (!((COMMONFACTOR.ISEmpty())) && ((ENDLEFT && ENDRIGHT))) { CONTINUE = true; COMMONSUBFACORT = COMMONFACTOR.DELETEFromTreeFirstNode(); if (!ENDLEFT) { Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionLeftSideFx(Dummy.LeftSideAccess, COMMONSUBFACORT, ref ENDLEFT, FindSubFactor.FACTORLISTEDSAccess()); } if (!ENDRIGHT) { Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorActionRightSideFx(Dummy.RightSideAccess, COMMONSUBFACORT, ref ENDRIGHT, FindSubFactor.NotExpectedAccess()); } Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); } UIS.SetProgressValue(UIS.progressBar9, 2147483647); if (!((IS.IsDivInNode(Dummy.LeftSideAccess)) || (IS.IsDivInNode(Dummy.RightSideAccess)))) { return(Dummy); } } if (Dummy.LeftSideAccess != null) { Dummy.LeftSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorCalculatorFx(Dummy.LeftSideAccess, ref CONTINUE, ref UIS); } if (Dummy.RightSideAccess != null) { Dummy.RightSideAccess = SimplifierCommonSubFactor.SimplifierCommonSubFactorCalculatorFx(Dummy.RightSideAccess, ref CONTINUE, ref UIS); } 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); }
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); }
static public AddToTree.Tree SuitableStructureForLocalSimplifierFx(AddToTree.Tree Dummy, ref UknownIntegralSolver UIS) { Dummy = Simplifier.SimplifierFxSimpler(Dummy, ref UIS); return(SuitableStructureForLocalSimplifier.SuitableStructureForLocalSimplifierFxAction(Dummy, ref UIS)); }