Skip to content

Commit

Permalink
WIP #1009 prepare calling decision tree rules
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed Jul 19, 2024
1 parent 3ea8ecc commit d052423
Show file tree
Hide file tree
Showing 22 changed files with 302 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import org.matheclipse.core.eval.interfaces.AbstractTrigArg1;
import org.matheclipse.core.eval.interfaces.IFunctionEvaluator;
import org.matheclipse.core.eval.interfaces.IFunctionExpand;
import org.matheclipse.core.eval.interfaces.IMatch;
import org.matheclipse.core.eval.interfaces.INumeric;
import org.matheclipse.core.eval.interfaces.IRewrite;
import org.matheclipse.core.eval.interfaces.ISetEvaluator;
Expand Down Expand Up @@ -1555,7 +1556,18 @@ public void setUp(final ISymbol newSymbol) {
* 1.1018024908797128
* </pre>
*/
private static final class Gamma extends AbstractFunctionEvaluator {
private static final class Gamma extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return GammaRules.match3(ast, engine);
}

@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return GammaRules.match4(ast, engine);
}

// @Override
// public IExpr e1ApcomplexArg(Apcomplex arg1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.matheclipse.core.eval.exception.ValidateException;
import org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator;
import org.matheclipse.core.eval.interfaces.IFunctionExpand;
import org.matheclipse.core.eval.interfaces.IMatch;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.expression.ImplementationStatus;
import org.matheclipse.core.expression.S;
Expand Down Expand Up @@ -410,7 +411,12 @@ public void setUp(final ISymbol newSymbol) {
* </code>
* </pre>
*/
private static final class BesselJ extends AbstractFunctionEvaluator {
private static final class BesselJ extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return BesselJRules.match3(ast, engine);
}

/**
* Precondition <code> n - 1/2 </code> is an integer number.
Expand Down Expand Up @@ -650,7 +656,12 @@ public void setUp(final ISymbol newSymbol) {
* </code>
* </pre>
*/
private static final class BesselI extends AbstractFunctionEvaluator {
private static final class BesselI extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return BesselIRules.match3(ast, engine);
}


@Override
Expand Down Expand Up @@ -760,7 +771,12 @@ public void setUp(final ISymbol newSymbol) {
* </code>
* </pre>
*/
private static final class BesselK extends AbstractFunctionEvaluator {
private static final class BesselK extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return BesselKRules.match3(ast, engine);
}


@Override
Expand Down Expand Up @@ -864,7 +880,12 @@ public void setUp(final ISymbol newSymbol) {
* </code>
* </pre>
*/
private static final class BesselY extends AbstractFunctionEvaluator {
private static final class BesselY extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return BesselYRules.match3(ast, engine);
}


@Override
Expand Down Expand Up @@ -1127,7 +1148,12 @@ public void setUp(final ISymbol newSymbol) {
* </pre>
*/
private static final class SphericalBesselJ extends AbstractFunctionEvaluator
implements IFunctionExpand {
implements IFunctionExpand, IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return SphericalBesselJRules.match3(ast, engine);
}

@Override
public IExpr functionExpand(final IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1390,7 +1416,12 @@ public void setUp(final ISymbol newSymbol) {
* <h3>Examples</h3>
*/
private static final class SphericalBesselY extends AbstractFunctionEvaluator
implements IFunctionExpand {
implements IFunctionExpand, IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return SphericalBesselYRules.match3(ast, engine);
}

@Override
public IExpr functionExpand(final IAST ast, EvalEngine engine) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.matheclipse.core.eval.interfaces.AbstractEvaluator;
import org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator;
import org.matheclipse.core.eval.interfaces.AbstractTrigArg1;
import org.matheclipse.core.eval.interfaces.IMatch;
import org.matheclipse.core.eval.interfaces.INumeric;
import org.matheclipse.core.eval.interfaces.IReciprocalTrigonometricFunction;
import org.matheclipse.core.eval.interfaces.IRewrite;
Expand Down Expand Up @@ -903,7 +904,14 @@ public IExpr evalAsLeadingTerm(IAST ast, ISymbol x, IExpr logx, int cdir) {
* See <a href="http://en.wikipedia.org/wiki/Inverse_trigonometric functions" >
* Inverse_trigonometric functions</a>
*/
private static final class ArcTan extends AbstractArg12 implements INumeric, IRewrite {
private static final class ArcTan extends AbstractArg12 implements INumeric, IRewrite, IMatch
{

@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return ArcTanRules.match3(ast, engine);
}

@Override
public IExpr e1ObjArg(final IExpr arg1) {
Expand Down Expand Up @@ -2244,7 +2252,17 @@ public void setUp(ISymbol newSymbol) {
}

/** See <a href="http://en.wikipedia.org/wiki/Logarithm">Wikipedia - Logarithm</a> */
private static final class Log extends AbstractArg12 implements INumeric, IRewrite {
private static final class Log extends AbstractArg12 implements INumeric, IRewrite, IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return LogRules.match3(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
return super.evaluate(ast, engine);
}

@Override
public IExpr e1ApfloatArg(Apfloat arg1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.matheclipse.core.eval.exception.ValidateException;
import org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator;
import org.matheclipse.core.eval.interfaces.IFunctionExpand;
import org.matheclipse.core.eval.interfaces.IMatch;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.expression.ImplementationStatus;
import org.matheclipse.core.expression.S;
Expand Down Expand Up @@ -887,7 +888,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class Hypergeometric1F1 extends AbstractFunctionEvaluator {
private static class Hypergeometric1F1 extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return Hypergeometric1F1Rules.match4(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1077,7 +1083,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class Hypergeometric2F1 extends AbstractFunctionEvaluator {
private static class Hypergeometric2F1 extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match5(IAST ast, EvalEngine engine) {
return F.NIL;
// return Hypergeometric2F1Rules.match5(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1243,7 +1254,13 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class Hypergeometric2F1Regularized extends AbstractFunctionEvaluator {
private static class Hypergeometric2F1Regularized extends AbstractFunctionEvaluator
implements IMatch {
@Override
public IExpr match5(IAST ast, EvalEngine engine) {
return F.NIL;
// return Hypergeometric2F1RegularizedRules.match5(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1319,7 +1336,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class HypergeometricPFQ extends AbstractFunctionEvaluator {
private static class HypergeometricPFQ extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return HypergeometricPFQRules.match4(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1422,7 +1444,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class HypergeometricU extends AbstractFunctionEvaluator {
private static class HypergeometricU extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return HypergeometricURules.match4(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1769,8 +1796,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class WhittakerM extends AbstractFunctionEvaluator {

private static class WhittakerM extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return WhittakerMRules.match4(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -1834,7 +1865,12 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static class WhittakerW extends AbstractFunctionEvaluator {
private static class WhittakerW extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match4(IAST ast, EvalEngine engine) {
return F.NIL;
// return WhittakerWRules.match4(ast, engine);
}

@Override
public IExpr evaluate(IAST ast, EvalEngine engine) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.matheclipse.core.eval.exception.Validate;
import org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator;
import org.matheclipse.core.eval.interfaces.IFunctionExpand;
import org.matheclipse.core.eval.interfaces.IMatch;
import org.matheclipse.core.eval.util.OptionArgs;
import org.matheclipse.core.expression.F;
import org.matheclipse.core.expression.ImplementationStatus;
Expand Down Expand Up @@ -1145,10 +1146,17 @@ public void setUp(final ISymbol newSymbol) {



private static final class SphericalHarmonicY extends AbstractFunctionEvaluator {
private static final class SphericalHarmonicY extends AbstractFunctionEvaluator
implements IMatch {
@Override
public IExpr match5(IAST ast, EvalEngine engine) {
return F.NIL;
// return SphericalHarmonicYRules.match5(ast, engine);
}

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {

IExpr l = ast.arg1();
IExpr m = ast.arg2();
IExpr t = ast.arg3();
Expand Down Expand Up @@ -1798,11 +1806,16 @@ public void setUp(final ISymbol newSymbol) {
}
}

private static final class JacobiP extends AbstractFunctionEvaluator {
private static final class JacobiP extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match5(IAST ast, EvalEngine engine) {
return F.NIL;
// return JacobiPRules.match5(ast, engine);
}

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {

// }
IExpr n = ast.arg1();
IExpr a = ast.arg2();
IExpr b = ast.arg3();
Expand Down Expand Up @@ -2105,7 +2118,12 @@ public void setUp(final ISymbol newSymbol) {
* 3/8-15/4*x^2+35/8*x^4
* </pre>
*/
private static final class LegendreP extends AbstractFunctionEvaluator {
private static final class LegendreP extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return LegendrePRules.match3(ast, engine);
}

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
Expand Down Expand Up @@ -2188,7 +2206,12 @@ public void setUp(final ISymbol newSymbol) {
* 55/24*z-35/8*z^3-3/16*Log(1-z)+15/8*z^2*Log(1-z)-35/16*z^4*Log(1-z)+3/16*Log(1+z)-15/8*z^2*Log(1+z)+35/16*z^4*Log(1+z)
* </pre>
*/
static final class LegendreQ extends AbstractFunctionEvaluator {
static final class LegendreQ extends AbstractFunctionEvaluator implements IMatch {
@Override
public IExpr match3(IAST ast, EvalEngine engine) {
return F.NIL;
// return LegendreQRules.match3(ast, engine);
}

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
Expand Down
Loading

0 comments on commit d052423

Please sign in to comment.