Пример #1
0
        private RealPolynomial MultPower(int power, double m)
        {
            RealPolynomial newpoly = FromDegree(power + Degree + 1);

            for (int idx = 0; idx < cof.Length; idx++)
            {
                newpoly[idx + power] = cof[idx] * m;
            }

            newpoly.Clean();

            return(newpoly);
        }
Пример #2
0
        public static RealPolynomial operator *(RealPolynomial a, RealPolynomial b)
        {
            int alen = a.cof.Length;
            int blen = b.cof.Length;


            RealPolynomial res = FromDegree(alen + blen - 1);

            for (int bi = 0; bi < blen; bi++)
            {
                for (int ai = 0; ai < alen; ai++)
                {
                    res[ai + bi] += a.cof[ai] * b.cof[bi];
                }
            }

            res.Clean();
            return(res);
        }