Skip to content

Commit 216909c

Browse files
committed
WIP #850: new FindFormulaTest.java; add necessary option to FindFormula
1 parent 71f935c commit 216909c

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/reflection/system/FindFormula.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public int[] expectedArgSize(IAST ast) {
6363

6464
@Override
6565
public void setUp(final ISymbol newSymbol) {
66-
super.setUp(newSymbol);
67-
// setOptions(newSymbol, S.GenerateConditions, S.False);
66+
setOptions(newSymbol, S.TargetFunctions, S.All);
6867
}
6968
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package org.matheclipse.core.system;
2+
3+
import org.junit.Test;
4+
import org.matheclipse.core.basic.Config;
5+
import org.matheclipse.core.eval.EvalEngine;
6+
7+
/** Tests for FindFormula function */
8+
public class FindFormulaTest extends ExprEvaluatorTestCase {
9+
10+
11+
@Test
12+
public void testFindFormula() {
13+
check("tt=Table({x, N(x * Sin(x))}, {x, 0, 4, .3});", //
14+
"");
15+
check(" FindFormula(tt,x)", //
16+
"FindFormula(\n"
17+
+ "{{0.0,0.0},\n" //
18+
+ " {0.3,0.0886561},\n" //
19+
+ " {0.6,0.338785},\n" //
20+
+ " {0.9,0.704994},\n" //
21+
+ " {1.2,1.11845},\n" //
22+
+ " {1.5,1.49624},\n" //
23+
+ " {1.8,1.75293},\n" //
24+
+ " {2.1,1.81274},\n" //
25+
+ " {2.4,1.62111},\n" //
26+
+ " {2.7,1.15393},\n" //
27+
+ " {3.0,0.42336},\n" //
28+
+ " {3.3,-0.520561},\n" //
29+
+ " {3.6,-1.59307},\n" //
30+
+ " {3.9,-2.68229}},x)");
31+
32+
}
33+
34+
35+
/** The JUnit setup method */
36+
@Override
37+
public void setUp() {
38+
super.setUp();
39+
Config.SHORTEN_STRING_LENGTH = 1024;
40+
Config.MAX_AST_SIZE = 1000000;
41+
EvalEngine.get().setIterationLimit(50000);
42+
}
43+
44+
@Override
45+
public void tearDown() throws Exception {
46+
super.tearDown();
47+
Config.SHORTEN_STRING_LENGTH = 80;
48+
}
49+
}

0 commit comments

Comments
 (0)