@@ -25,7 +25,7 @@ int v = (int) Julia.Eval("2 * 2");
25
25
Julia .Exit (0 ); // Even if your program terminates after you should call this. It runs the finalizers and stuff
26
26
```
27
27
28
- Struct Handling :
28
+ Structs :
29
29
``` csharp
30
30
31
31
#You have two choices, allocate a struct or create a struct.
@@ -35,7 +35,7 @@ Struct Handling:
35
35
var myCreatedStuct = JLType .JLRef .Create (3 ); // Will call constructor
36
36
```
37
37
38
- Function Handling :
38
+ Functions :
39
39
``` csharp
40
40
JLFun fun = Julia .Eval (" t(x::Int) = Int32(x * 2)" );
41
41
JLSvec ParameterTypes = fun .ParameterTypes ;
@@ -45,7 +45,7 @@ Function Handling:
45
45
JLVal resultWillBe4 = fun .Invoke (2 );
46
46
```
47
47
48
- Value Handling :
48
+ Values :
49
49
``` csharp
50
50
// Auto alloc to Julia
51
51
var val = new JLVal (3 );
@@ -57,17 +57,23 @@ Value Handling:
57
57
object newVal2 = val .Value ;
58
58
```
59
59
60
- Array Handling :
60
+ Arrays :
61
61
``` csharp
62
62
JLArray arr = Julia .Eval (" [2, 3, 4]" )
63
63
64
64
// Unpack to .net
65
- object [] o = arr .LinearNetUnPack ();
65
+ object [] o = arr .UnboxArray ();
66
66
67
- // Make own array
68
- var newArray = long [arr .Length ];
69
- for (int i = 1 ; i <= arr .Length ; ++ i )
70
- newArray [i - 1 ] = (long ) arr [i ];
67
+ var a = new int []{2 , 3 , 4 };
68
+
69
+ // Copy to a Julia Array. Dont use this method if you know an object is an array though. There are faster methods!
70
+ var v = new JLVal (a );
71
+
72
+ // Fast Array Copy From .NET. This will deal with direct memory transfer rather then boxing/unboxing for unmanaged types
73
+ var v2 = JLArray .CreateArray (a );
74
+
75
+ // Fast Array Copy From Julia. This will deal with direct memory transfer rather then boxing/unboxing for unmanaged types
76
+ int [] v2 = v2 .UnboxArray <int >();
71
77
72
78
JLType elementType = arr .ElType ;
73
79
```
0 commit comments