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

Latest commit

 

History

History
History
46 lines (36 loc) · 1.21 KB

File metadata and controls

46 lines (36 loc) · 1.21 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package lambdacloud.test;
import lambdacloud.core.lang.LCArray;
import lambdacloud.core.lang.LCAssign;
import lambdacloud.core.lang.LCStatements;
import symjava.bytecode.BytecodeVecFunc;
import symjava.symbolic.Expr;
public class TestLCIndex {
public static void test1() {
LCStatements lcs = new LCStatements();
LCArray x = LCArray.getDoubleArray("x");
LCArray output = LCArray.getDoubleArray("output");
lcs.append(new LCAssign(output[0], x[2]));
BytecodeVecFunc f = CompileUtils.compileVecFunc(lcs, output, x);
double[] out = new double[10];
double[] xx = new double[] {1,2,3};
f.apply(out, 0, xx);
System.out.println(out[0]);
}
public static void test2() {
LCStatements lcs = new LCStatements();
LCArray x = LCArray.getDoubleArray("x");
LCArray y = LCArray.getDoubleArray("y");
LCArray output = LCArray.getDoubleArray("output");
lcs.append(new LCAssign(output[0], x[2]*y[2]));
BytecodeVecFunc f = CompileUtils.compileVecFunc(lcs, output, x, y);
double[] out = new double[10];
double[] xx = new double[] {1,2,3};
double[] yy = new double[] {2,1,2};
f.apply(out, 0, xx, yy);
System.out.println(out[0]);
}
public static void main(String[] args) {
test1();
test2();
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.