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
35 lines (29 loc) · 906 Bytes

File metadata and controls

35 lines (29 loc) · 906 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
package symjava.examples;
import static symjava.symbolic.Symbol.x;
import static symjava.symbolic.Symbol.y;
import symjava.bytecode.BytecodeFunc;
import symjava.symbolic.Expr;
import symjava.symbolic.utils.JIT;
/**
* test class loader for multi thread case
* @author yueming.liu
*
*/
public class ExampleMultiThread {
public static void main(String[] args) throws InterruptedException {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
Expr R = 0.127-(x*0.194/(y+0.194));
Expr Rdy = R.diff(y);
System.out.println(Rdy);
//Just-In-Time compile the symbolic expression to native code
BytecodeFunc func = JIT.compile(new Expr[]{x,y}, Rdy);
System.out.println(func.apply(0.362, 0.556)); //Scala function call operator
System.out.println(func.call(0.362, 0.556)); //Groovy function call operator
}
});
t.start();
t.join();
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.