Search in sources :

Example 1 with Quotient

use of edu.jas.ufd.Quotient in project symja_android_library by axkr.

the class JASConvert method quotIntegral2Expr.

/**
	 * Convert a jas <code>Integral</code> into a matheclipse expression
	 * 
	 * @param integral
	 *            the JAS Integral
	 * @return
	 */
public IAST quotIntegral2Expr(QuotIntegral<BigRational> integral) {
    IAST sum = F.Plus();
    List<Quotient<BigRational>> rational = integral.rational;
    List<LogIntegral<BigRational>> logarithm = integral.logarithm;
    if (rational.size() != 0) {
        Quotient<BigRational> qTemp;
        GenPolynomial<BigRational> qNum;
        GenPolynomial<BigRational> qDen;
        for (int i = 0; i < rational.size(); i++) {
            qTemp = rational.get(i);
            qNum = qTemp.num;
            qDen = qTemp.den;
            sum.append(F.Times(rationalPoly2Expr(qNum), F.Power(rationalPoly2Expr(qDen), F.CN1)));
        }
    }
    if (logarithm.size() != 0) {
        for (LogIntegral<BigRational> pf : logarithm) {
            sum.append(logIntegral2Expr(pf));
        }
    }
    return sum;
}
Also used : BigRational(edu.jas.arith.BigRational) IAST(org.matheclipse.core.interfaces.IAST) LogIntegral(edu.jas.integrate.LogIntegral) Quotient(edu.jas.ufd.Quotient)

Aggregations

BigRational (edu.jas.arith.BigRational)1 LogIntegral (edu.jas.integrate.LogIntegral)1 Quotient (edu.jas.ufd.Quotient)1 IAST (org.matheclipse.core.interfaces.IAST)1