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
40 lines (32 loc) · 944 Bytes

File metadata and controls

40 lines (32 loc) · 944 Bytes
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
package lambdacloud.test;
import lambdacloud.core.lang.LCArray;
import lambdacloud.core.lang.LCLength;
import lambdacloud.core.lang.LCStatements;
import symjava.bytecode.BytecodeVecFunc;
import symjava.symbolic.Expr;
/**
*
* void apply(double[] outAry, int outPos, double[] ...args) {
* outAry[0] = args[0].length;
* }
*
*/
public class TestLCLength {
public static void test1() {
LCStatements lcs = new LCStatements();
LCArray x = LCArray.getDoubleArray("x");
LCArray output = LCArray.getDoubleArray("output");
lcs.append(output[0].assign(x.getLength()));
lcs.append(output[1].assign(x.size()));
lcs.append(output[2].assign(new LCLength(x)));
BytecodeVecFunc f = CompileUtils.compileVecFunc(lcs, x);
double[] out = new double[10];
double[] xx = new double[] {1,2,3};
f.apply(out, 0, xx);
for(double d : out)
System.out.println(d);
}
public static void main(String[] args) {
test1();
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.