Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6af8a1c

Browse filesBrowse files
Ji ChuJi Chu
authored andcommitted
Refactor test for LCVar and BatchUpdate
1 parent e17c763 commit 6af8a1c
Copy full SHA for 6af8a1c

File tree

Expand file treeCollapse file tree

2 files changed

+9
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-8
lines changed
Open diff view settings
Collapse file
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
1616
*
1717
*/
18-
public class Test2 {
18+
public class TestBatchUpdate {
1919

2020
public static void main(String[] args) {
21-
test();
21+
test(null);
22+
test(new CloudConfig("job_local.conf"));
2223
}
2324

24-
public static void test() {
25-
CloudConfig.setGlobalConfig("job_local.conf");
25+
public static void test(CloudConfig config) {
2626

2727
LCVar x = LCVar.getDouble("x");
2828
LCVar y = LCVar.getDouble("y");
@@ -31,7 +31,7 @@ public static void test() {
3131
x + y,
3232
x - y
3333
};
34-
CloudFunc f = new CloudFunc("a_vector_function", exprs, new LCVar[]{x, y});
34+
CloudFunc f = new CloudFunc(config, "a_vector_function", exprs, new LCVar[]{x, y});
3535

3636
CloudSD input = new CloudSD("input").init(new double[]{2, 1});
3737
CloudSD output = new CloudSD("output");
Collapse file
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import lambdacloud.core.lang.LCVar;
77
import symjava.symbolic.Expr;
88

9-
public class Test {
9+
public class TestLCVar {
1010
public static void main(String[] args) {
1111
test();
1212
}
@@ -22,9 +22,10 @@ public static void test() {
2222
Expr expr = x + y + z;
2323
//x,y are not local now since they are passed as arguments
2424
CloudFunc f = new CloudFunc(expr, new LCVar[]{x, y});
25+
//CloudFunc f = new CloudFunc(expr, new LCVar[]{x, y, z});
2526

26-
CloudSD input = new CloudSD("input").init(new double[]{1, 2});
27-
CloudSD output = new CloudSD("output").resize(1);
27+
CloudSD input = new CloudSD("input").init(new double[]{1, 2, 3});
28+
CloudSD output = new CloudSD();
2829

2930
long begin = System.currentTimeMillis();
3031
f.apply(output, input);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.