File tree Expand file tree Collapse file tree
symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/sympy/simplify Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org .matheclipse .core .sympy .simplify ;
2+
3+ import org .matheclipse .core .interfaces .IAST ;
4+ import org .matheclipse .core .interfaces .IASTMutable ;
5+ import org .matheclipse .core .interfaces .IExpr ;
6+
7+ public class Simplify {
8+ public static IExpr logCombine (IExpr expr ) {
9+ return logCombine (expr , false );
10+ }
11+
12+ public static IExpr logCombine (IExpr expr , boolean force ) {
13+ if (expr .isPlus ()) {
14+ return expr ;
15+ }
16+ if (expr .isTimes ()) {
17+ IAST timesAST = (IAST ) expr ;
18+ int indexOf = timesAST .indexOf (IExpr ::isLog );
19+ if (indexOf < 0 ) {
20+ return expr ;
21+ }
22+ if (timesAST .get (indexOf ).first ().isPositiveResult ()) {
23+ IASTMutable timesReduced = timesAST .removeAtCopy (indexOf );
24+ for (int i = 1 ; i < timesReduced .size (); i ++) {
25+ IExpr arg = timesReduced .get (i );
26+ if (arg .isRealResult ()) {
27+
28+ }
29+ }
30+ }
31+ }
32+ return expr ;
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments