当前位置: 首页>>代码示例>>Java>>正文


Java Quotient类代码示例

本文整理汇总了Java中edu.jas.ufd.Quotient的典型用法代码示例。如果您正苦于以下问题:Java Quotient类的具体用法?Java Quotient怎么用?Java Quotient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Quotient类属于edu.jas.ufd包,在下文中一共展示了Quotient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPureLogarithm1

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
     * Test 1/p pure logarithm integral.
     */
    public void testPureLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll+i, el+i, q );
            //System.out.println("a = " + a);
//             if ( a.isZERO() || a.isONE() ) {
//                 continue;
//             }
            b = new Quotient<BigRational>(qfac,qfac.getONE().num,a.den);
            //System.out.println("b =  " + b);
            rint = integrator.integrate(b);
            //System.out.println("QuotIntegral: " + rint);

            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:19,代码来源:ElementaryIntegrationTest.java

示例2: testPureLogarithmD

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
     * Test p'/p pure logarithm integral.
     * 
     */
    public void testPureLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll+i, el+i, q );
            //System.out.println("a = " + a);
//             if ( a.isZERO() || a.isONE() ) {
//                 continue;
//             }
            GenPolynomial<BigRational> pp = PolyUtil.<BigRational> baseDeriviative(a.den);
            b = new Quotient<BigRational>(qfac, pp ,a.den);
            //System.out.println("b =  " + b);
            rint = integrator.integrate(b);
            //System.out.println("QuotIntegral: " + rint);

            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:21,代码来源:ElementaryIntegrationTest.java

示例3: testRationalWithLogarithmD

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
     * Test mixed rational with p'/p logarithm integral.
     */
    public void testRationalWithLogarithmD() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll+i, el+i, q );
            //System.out.println("a = " + a);
//             if ( a.isZERO() || a.isONE() ) {
//                 continue;
//             }

            b = integrator.deriviative(a);
            //System.out.println("b =  " + b);

            GenPolynomial<BigRational> pp = PolyUtil.<BigRational> baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp ,a.den);
            //System.out.println("c =  " + c);

            e = b.sum(c); 
            //System.out.println("e =  " + e);

            rint = integrator.integrate(e);
            //System.out.println("QuotIntegral: " + rint);

            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:28,代码来源:ElementaryIntegrationTest.java

示例4: xtestRationalWithLogarithm1

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
     * Test mixed rational with 1/p logarithm integral.
     */
    public void xtestRationalWithLogarithm1() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll+i, el+i, q );
            //System.out.println("a = " + a);
//             if ( a.isZERO() || a.isONE() ) {
//                 continue;
//             }

            b = integrator.deriviative(a);
            //System.out.println("b =  " + b);

            d = new Quotient<BigRational>(qfac,qfac.getONE().num,a.den);
            //System.out.println("d =  " + d);

            e = b.sum(d);
            //System.out.println("e =  " + e);

            rint = integrator.integrate(e);
            //System.out.println("QuotIntegral: " + rint);

            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:27,代码来源:ElementaryIntegrationTest.java

示例5: getImplementation

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Determine suitable implementation of GB algorithms, case Quotient
 * coefficients.
 * @param fac QuotientRing.
 * @param a algorithm, a = qgb, ffgb.
 * @param pl pair selection strategy
 * @return GB algorithm implementation.
 */
public static <C extends GcdRingElem<C>> GroebnerBaseAbstract<Quotient<C>> getImplementation(
                QuotientRing<C> fac, Algo a, PairList<Quotient<C>> pl) {
    GroebnerBaseAbstract<Quotient<C>> bba;
    switch (a) {
    case qgb:
        bba = new GroebnerBaseSeq<Quotient<C>>(new ReductionSeq<Quotient<C>>(), pl);
        break;
    case ffgb:
        PairList<GenPolynomial<C>> pli;
        if (pl instanceof OrderedMinPairlist) {
            pli = new OrderedMinPairlist<GenPolynomial<C>>();
        } else if (pl instanceof OrderedSyzPairlist) {
            pli = new OrderedSyzPairlist<GenPolynomial<C>>();
        } else {
            pli = new OrderedPairlist<GenPolynomial<C>>();
        }
        bba = new GroebnerBaseQuotient<C>(fac, pli); // pl not possible
        break;
    default:
        throw new IllegalArgumentException("algorithm not available for Quotient " + a);
    }
    return bba;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:32,代码来源:GBFactory.java

示例6: GB

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Groebner base using fraction free computation.
 * @param modv module variable number.
 * @param F polynomial list.
 * @return GB(F) a Groebner base of F.
 */
@Override
public List<GenPolynomial<Quotient<C>>> GB(int modv, List<GenPolynomial<Quotient<C>>> F) {
    List<GenPolynomial<Quotient<C>>> G = F;
    if (F == null || F.isEmpty()) {
        return G;
    }
    GenPolynomialRing<Quotient<C>> rring = F.get(0).ring;
    QuotientRing<C> cf = (QuotientRing<C>) rring.coFac;
    GenPolynomialRing<GenPolynomial<C>> iring = new GenPolynomialRing<GenPolynomial<C>>(cf.ring, rring);
    List<GenPolynomial<GenPolynomial<C>>> Fi = PolyUfdUtil.<C> integralFromQuotientCoefficients(iring, F);
    //System.out.println("Fi = " + Fi);
    logger.info("#Fi = " + Fi.size());

    List<GenPolynomial<GenPolynomial<C>>> Gi = bba.GB(modv, Fi);
    //System.out.println("Gi = " + Gi);
    logger.info("#Gi = " + Gi.size());

    G = PolyUfdUtil.<C> quotientFromIntegralCoefficients(rring, Gi);
    G = PolyUtil.<Quotient<C>> monic(G);
    return G;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:28,代码来源:GroebnerBaseQuotient.java

示例7: deriviative

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Derivation of a univariate rational function.
 * 
 * @param r rational function
 * @return dr/dx
 */
public Quotient<C> deriviative(Quotient<C> r) {
    GenPolynomial<C> num = r.num;
    GenPolynomial<C> den = r.den;
    GenPolynomial<C> nump = PolyUtil.<C> baseDeriviative(num);
    if (den.isONE()) {
        return new Quotient<C>(r.ring, nump, den);
    }
    GenPolynomial<C> denp = PolyUtil.<C> baseDeriviative(den);

    GenPolynomial<C> n = den.multiply(nump).subtract(num.multiply(denp));
    GenPolynomial<C> d = den.multiply(den);

    Quotient<C> der = new Quotient<C>(r.ring, n, d);
    return der;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:22,代码来源:ElementaryIntegration.java

示例8: QuotIntegral

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Constructor.
 * @param r rational function Quotient over C.
 * @param p integral of polynomial part.
 * @param rat list of rational integrals.
 * @param log list of logarithmic part.
 */
public QuotIntegral(Quotient<C> r, GenPolynomial<C> p, List<GenPolynomial<C>> rat,
        List<LogIntegral<C>> log) {
    quot = r;
    QuotientRing<C> qr = r.ring;
    rational = new ArrayList<Quotient<C>>();
    if (!p.isZERO()) {
        rational.add(new Quotient<C>(qr, p));
    }
    for (int i = 0; i < rat.size(); i++) {
        GenPolynomial<C> rn = rat.get(i++);
        GenPolynomial<C> rd = rat.get(i);
        rational.add(new Quotient<C>(qr, rn, rd));
    }
    logarithm = log;
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:23,代码来源:QuotIntegral.java

示例9: JasFunction

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Creates a new JAS function.
 * 
 * @param functionContext function context of this function
 * @param jas JAS object this function object is wrapping
 * @param type type of function represented
 */
JasFunction(JasFunctionFactory functionContext, Quotient<BigInteger> jas, int type) {
	super(functionContext);
	this.jas = jas;
	this.num = null;
	this.den = null;
	this.type = type;
}
 
开发者ID:musaeed,项目名称:Prism-gsoc16,代码行数:15,代码来源:JasFunction.java

示例10: star

import edu.jas.ufd.Quotient; //导入依赖的package包/类
@Override
public Function star()
{
	if (this.isNaN()) {
		return factory.getNaN();
	}
	Quotient<BigInteger> one =  ((JasFunctionFactory) factory).getJasQuotRing().getONE();
	Quotient<BigInteger> result = one.subtract(jas);
	result = one.divide(result);
	return new JasFunction((JasFunctionFactory) factory, result, NORMAL);
}
 
开发者ID:musaeed,项目名称:Prism-gsoc16,代码行数:12,代码来源:JasFunction.java

示例11: fromBigRational

import edu.jas.ufd.Quotient; //导入依赖的package包/类
@Override
public Function fromBigRational(BigRational from) {
	Quotient<BigInteger> result = jasQuotRing.fromInteger(from.getNum());
	Quotient<BigInteger> den = jasQuotRing.fromInteger(from.getDen());
	result = result.divide(den);
	
	return new JasFunction(this, result, JasFunction.NORMAL);
}
 
开发者ID:musaeed,项目名称:Prism-gsoc16,代码行数:9,代码来源:JasFunctionFactory.java

示例12: testConstructionF0

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Test construction Q(sqrt(2))(x)(sqrt(x)) by hand.
 */
public void testConstructionF0() {
    BigRational bf = new BigRational(1);
    GenPolynomialRing<BigRational> pf = new GenPolynomialRing<BigRational>(bf, new String[] { "w2" });
    GenPolynomial<BigRational> a = pf.parse("w2^2 - 2");
    AlgebraicNumberRing<BigRational> af = new AlgebraicNumberRing<BigRational>(a);
    GenPolynomialRing<AlgebraicNumber<BigRational>> tf = new GenPolynomialRing<AlgebraicNumber<BigRational>>(
                    af, new String[] { "x" });
    QuotientRing<AlgebraicNumber<BigRational>> qf = new QuotientRing<AlgebraicNumber<BigRational>>(tf);
    GenPolynomialRing<Quotient<AlgebraicNumber<BigRational>>> qaf = new GenPolynomialRing<Quotient<AlgebraicNumber<BigRational>>>(
                    qf, new String[] { "wx" });
    GenPolynomial<Quotient<AlgebraicNumber<BigRational>>> b = qaf.parse("wx^2 - x");
    AlgebraicNumberRing<Quotient<AlgebraicNumber<BigRational>>> fac = new AlgebraicNumberRing<Quotient<AlgebraicNumber<BigRational>>>(
                    b);
    //System.out.println("fac = " + fac.toScript());

    List<AlgebraicNumber<Quotient<AlgebraicNumber<BigRational>>>> gens = fac.generators();
    int s = gens.size();
    //System.out.println("gens    = " + gens);
    assertTrue("#gens == 4 " + s, s == 4);

    AlgebraicNumber<Quotient<AlgebraicNumber<BigRational>>> elem = fac.random(2);
    if (elem.isZERO() || elem.isONE()) {
        elem = gens.get(s - 1).sum(gens.get(s - 2));
        //elem = (RingElem)gens.get(s-1).multiply(gens.get(s-2));
        elem = elem.multiply(elem);
    }
    //System.out.println("elem     = " + elem.toScript());
    //System.out.println("elem    = " + elem);

    AlgebraicNumber<Quotient<AlgebraicNumber<BigRational>>> inv = elem.inverse();
    //System.out.println("inv      = " + inv.toScript());
    //System.out.println("inv     = " + inv);

    AlgebraicNumber<Quotient<AlgebraicNumber<BigRational>>> e = elem.multiply(inv);
    assertTrue("e / e == 1 " + e, e.isONE());
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:40,代码来源:ExtensionFieldBuilderTest.java

示例13: setUp

import edu.jas.ufd.Quotient; //导入依赖的package包/类
@Override
protected void setUp() {
    BigRational coeff = new BigRational(9);
    GenPolynomialRing<BigRational> cf = new GenPolynomialRing<BigRational>(coeff, rl / 2, new String[] {
            "a", "b" });
    QuotientRing<BigRational> qf = new QuotientRing<BigRational>(cf);
    fac = new GenPolynomialRing<Quotient<BigRational>>(qf, rl / 2, new String[] { "x", "y" });
    a = b = c = d = e = null;
    bb = new GroebnerBaseQuotient<BigRational>(qf);
    bbp = new GroebnerBaseQuotient<BigRational>(threads, qf);
    //bbq = new GroebnerBaseSeq<Quotient<BigRational>>();
    bbq = GBFactory.<Quotient<BigRational>> getImplementation(qf);
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:14,代码来源:GroebnerBaseQuotientTest.java

示例14: testRationalWithLogarithm

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
     * Test mixed rational with p'/p + 1/p logarithm integral.
     * 
     */
    public void testRationalWithLogarithm() {
        for (int i = 0; i < 3; i++) {
            a = qfac.random(kl, ll+i, el+i, q );
            //System.out.println("a = " + a);
//             if ( a.isZERO() || a.isONE() ) {
//                 continue;
//             }

            b = integrator.deriviative(a);
            //System.out.println("b =  " + b);

            GenPolynomial<BigRational> pp = PolyUtil.<BigRational> baseDeriviative(a.den);
            c = new Quotient<BigRational>(qfac, pp ,a.den);
            //System.out.println("c =  " + c);

            d = new Quotient<BigRational>(qfac,qfac.getONE().num,a.den);
            //System.out.println("d =  " + d);

            e = b.sum(c).sum(d);
            //System.out.println("e =  " + e);

            rint = integrator.integrate(e);
            //System.out.println("QuotIntegral: " + rint);

            assertTrue("isIntegral ", integrator.isIntegral(rint));
        }
    }
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:32,代码来源:ElementaryIntegrationTest.java

示例15: testRationalRecursive

import edu.jas.ufd.Quotient; //导入依赖的package包/类
/**
 * Test rational integral with quotient coefficients.
 */
public void testRationalRecursive() {
    QuotientRing<Quotient<BigRational>> qqfac;
    GenPolynomialRing<Quotient<BigRational>> qmfac;
    ElementaryIntegration<Quotient<BigRational>> qintegrator;
    QuotIntegral<Quotient<BigRational>> qrint;
    String[] vars = new String[]{ "y" };

    qmfac = new GenPolynomialRing<Quotient<BigRational>>(qfac,1,tord,vars);
    qqfac = new QuotientRing<Quotient<BigRational>>(qmfac);

    qintegrator = new ElementaryIntegration<Quotient<BigRational>>(qfac);

    Quotient< Quotient< BigRational > > qa, qb;

    for (int i = 0; i < 2; i++) {
        qa = qqfac.random(2, ll, el, q );
        //System.out.println("qa = " + qa);
        //             if ( a.isZERO() || a.isONE() ) {
        //                 continue;
        //             }
        qb = qintegrator.deriviative(qa);
        //System.out.println("qb =  " + qb);
        qrint = qintegrator.integrate(qb);
        //System.out.println("QuotIntegral: " + qrint);

        assertTrue("isIntegral ", qintegrator.isIntegral(qrint));
    }
}
 
开发者ID:kredel,项目名称:java-algebra-system,代码行数:32,代码来源:ElementaryIntegrationTest.java


注:本文中的edu.jas.ufd.Quotient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。