Skip to content

Commit

Permalink
clean up/Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed Sep 25, 2024
1 parent c039d2c commit ff2a511
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.apfloat.Apfloat;
import org.hipparchus.complex.Complex;
import org.matheclipse.core.basic.Config;
import org.matheclipse.core.basic.OperationSystem;
import org.matheclipse.core.eval.Errors;
import org.matheclipse.core.eval.EvalEngine;
import org.matheclipse.core.eval.exception.ASTElementLimitExceeded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.hipparchus.fraction.BigFraction;
import org.matheclipse.core.basic.AndroidLoggerFix;
import org.matheclipse.core.basic.Config;
import org.matheclipse.core.basic.OperationSystem;
import org.matheclipse.core.builtin.Algebra;
import org.matheclipse.core.builtin.Arithmetic;
import org.matheclipse.core.builtin.AssociationFunctions;
Expand Down Expand Up @@ -2853,7 +2852,7 @@ public static INumber chopNumber(INumber arg, double delta) {
return F.complexNum(Apfloat.ZERO, imag);
}
} else {
Complex c = ((IComplexNum) arg).evalfc();
Complex c = arg.evalfc();
if (isZero(c.getReal(), delta)) {
if (isZero(c.getImaginary(), delta)) {
return C0;
Expand Down Expand Up @@ -4451,8 +4450,9 @@ public static IAST Fibonacci(final IExpr a0, final IExpr a1) {
return new AST2(Fibonacci, a0, a1);
}

public static IAST FindFit(final IExpr a0, final IExpr a1, final IExpr a2, final IExpr a3) {
return quaternary(FindFit, a0, a1, a2, a3);
public static IAST FindFit(final IExpr data, final IExpr expr, final IExpr variablesList,
final IExpr xVariable) {
return quaternary(FindFit, data, expr, variablesList, xVariable);
}

public static IAST FindFormula(final IExpr data, final IExpr x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static void elements(String type, IAST ast, StringBuilder buf, Dimensions2D dim)
buf.append("}], ");
}
}
} else if (arg1.isList() && ((IAST) arg1).isAST3()) {
} else if (arg1.isList() && arg1.isAST3()) {
try {
buf.append("\"elements\": [{\"coords\": [");
addCoordsToElements(buf, ((IAST) arg1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static boolean isComplicatedPatternExpr(IExpr a1) {

private Map<IExpr, PatternMatcherEquals> fEqualDownRules;

private IMatch fMatcher;
private transient IMatch fMatcher;

/**
* List of pattern matchers. The corresponding priority is stored in <code>fPriorityDownRules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@ public void testStringRepeat() {

@Test
public void testStringReplace() {
// TODO use MMA logic for lists of rules
// check("StringReplace(\"ABBA\", {\"A\" -> \"AB\", \"B\" -> \"BA\"})", //
// "ABBABAAB ");
check(
"StringReplace(\"The number 17 is a prime number, 42 is not\", WordBoundary ~~ x:DigitCharacter.. ~~ WordBoundary /; PrimeQ(ToExpression(x)) :> \"*\" <> x <> \"*\")", //
"The number *17* is a prime number, 42 is not");
Expand Down

0 comments on commit ff2a511

Please sign in to comment.