Search in sources :

Example 6 with IPattern

use of org.matheclipse.core.interfaces.IPattern in project symja_android_library by axkr.

the class F method initPredefinedPattern.

public static IPattern initPredefinedPattern(@Nonnull final ISymbol symbol) {
    IPattern temp = new Pattern(symbol);
    PREDEFINED_PATTERN_MAP.put(symbol.toString(), temp);
    return temp;
}
Also used : IPattern(org.matheclipse.core.interfaces.IPattern) IPattern(org.matheclipse.core.interfaces.IPattern)

Example 7 with IPattern

use of org.matheclipse.core.interfaces.IPattern in project symja_android_library by axkr.

the class CompareToTestCase method testIssue122b.

public void testIssue122b() {
    // x5_c <||> x3*x4_c => -1
    ISymbol b = F.$s("b");
    ISymbol c = F.$s("c");
    ISymbol x1 = F.$s("x1");
    ISymbol x3 = F.$s("x3");
    ISymbol x4 = F.$s("x4");
    ISymbol x5 = F.$s("x5");
    IPattern x1_c = F.$p(x1, c);
    IPattern x3_b = F.$p(x3, b);
    IPattern x3_c = F.$p(x3, c);
    IPattern x4_c = F.$p(x4, c);
    IPattern x5_c = F.$p(x5, c);
    IAST ast2 = F.Times(x3, x4_c);
    int res = x5_c.compareTo(ast2);
    assertEquals(1, res);
    res = ast2.compareTo(x5_c);
    assertEquals(-1, res);
    check("-Infinity+b+a", "-Infinity+a+b");
}
Also used : IPattern(org.matheclipse.core.interfaces.IPattern) ISymbol(org.matheclipse.core.interfaces.ISymbol) IAST(org.matheclipse.core.interfaces.IAST)

Aggregations

IPattern (org.matheclipse.core.interfaces.IPattern)7 IAST (org.matheclipse.core.interfaces.IAST)5 IExpr (org.matheclipse.core.interfaces.IExpr)3 ISymbol (org.matheclipse.core.interfaces.ISymbol)3