예제 #1
0
        public int TermGCD()
        {
            int res = 0;

            foreach (var term in Terms)
            {
                res = CasSystem.GCD(res, term.Coefficient);
            }
            return(res);
        }
예제 #2
0
        public CasExpr Simplify()
        {
            int gcd = CasSystem.GCD(Poly1.TermGCD(), Poly2.TermGCD());

            if (gcd == 0 || gcd == 1)
            {
                return(this);
            }
            else
            {
                return(new CasExpr(Poly1.DivideTerms(gcd), Poly2.DivideTerms(gcd)));
            }
        }
예제 #3
0
 public SnapDetector()
 {
     CAS = CasSystem.Instance;
 }