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 8fe9f7e

Browse filesBrowse files
committed
Rename CSD to CloudSD
1 parent d73ff2a commit 8fe9f7e
Copy full SHA for 8fe9f7e

File tree

Expand file treeCollapse file tree

16 files changed

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

16 files changed

+61
-61
lines changed
Open diff view settings
Collapse file

‎src/lambdacloud/core/CloudFunc.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/core/CloudFunc.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public CloudFunc compile(String name, Expr[] args, Expr[] exprs) {
7979
return this;
8080
}
8181

82-
public void apply(CSD output, CSD ...inputs) {
82+
public void apply(CloudSD output, CloudSD ...inputs) {
8383
if(CloudConfig.isLocal()) {
8484
if(inputs.length == 0) {
8585
switch(funcType) {
@@ -132,7 +132,7 @@ public void apply(CSD output, CSD ...inputs) {
132132
} catch (InterruptedException e) {
133133
e.printStackTrace();
134134
}
135-
CSD rlt = handler.getCloudVar();
135+
CloudSD rlt = handler.getCloudVar();
136136
output.setLabel(rlt.getLabel());
137137
output.data = rlt.data;
138138
output.isOnCloud = rlt.isOnCloud;
Collapse file
+12-12Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@
3232
* </pre></blockquote>
3333
*
3434
*/
35-
public class CSD extends Symbol {
35+
public class CloudSD extends Symbol {
3636
double[] data = new double[0];
3737
boolean isOnCloud = false;
3838

39-
public CSD() {
39+
public CloudSD() {
4040
super("CloudVar"+java.util.UUID.randomUUID().toString().replaceAll("-", ""));
4141
}
4242

43-
public CSD(String name) {
43+
public CloudSD(String name) {
4444
super(name);
4545
}
4646

47-
public CSD(Expr expr) {
47+
public CloudSD(Expr expr) {
4848
super("CloudVar"+java.util.UUID.randomUUID().toString().replaceAll("-", ""));
4949
this.compile(this.label, expr);
5050
}
5151

52-
public CSD(String name, Expr expr) {
52+
public CloudSD(String name, Expr expr) {
5353
super(name);
5454
this.compile(name, expr);
5555
}
5656

57-
public CSD compile(String name, Expr expr) {
57+
public CloudSD compile(String name, Expr expr) {
5858
if(CloudConfig.isLocal()) {
59-
CSD[] args = Utils.extractCloudVars(expr).toArray(new CSD[0]);
59+
CloudSD[] args = Utils.extractCloudVars(expr).toArray(new CloudSD[0]);
6060
BytecodeBatchFunc fexpr = JIT.compileBatchFunc(args, expr);
6161
data = new double[args[0].size()];
6262
fexpr.apply(data, 0, Utils.getDataFromCloudVars(args));
@@ -74,7 +74,7 @@ public CSD compile(String name, Expr expr) {
7474
* @param array
7575
* @return
7676
*/
77-
public CSD init(double ...array) {
77+
public CloudSD init(double ...array) {
7878
this.data = array;
7979
return this;
8080
}
@@ -104,7 +104,7 @@ public double get(int index) {
104104
* @param size
105105
* @return
106106
*/
107-
public CSD resize(int size) {
107+
public CloudSD resize(int size) {
108108
if(this.data == null)
109109
this.data = new double[size];
110110
else {
@@ -194,7 +194,7 @@ public boolean fetchToLocal() {
194194
e.printStackTrace();
195195
}
196196
CloudVarHandler h = client.getCloudVarHandler();
197-
CSD var = h.getCloudVar();
197+
CloudSD var = h.getCloudVar();
198198
this.data = var.data;
199199
this.isOnCloud = var.isOnCloud();
200200
return this.isOnCloud;
@@ -227,8 +227,8 @@ public Expr diff(Expr expr) {
227227
return null;
228228
}
229229

230-
public static CSD valueOf(Expr expr) {
231-
return new CSD(expr);
230+
public static CloudSD valueOf(Expr expr) {
231+
return new CloudSD(expr);
232232
}
233233

234234
public Expr assign(Expr expr) {
Collapse file

‎src/lambdacloud/core/lang/LCBuilder.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/core/lang/LCBuilder.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import java.util.HashMap;
88
import java.util.List;
99

10-
import lambdacloud.core.CSD;
10+
import lambdacloud.core.CloudSD;
1111
import lambdacloud.core.CloudConfig;
1212

1313
import com.sun.org.apache.bcel.internal.generic.ArrayType;
@@ -72,8 +72,8 @@ public LCBuilder append(Expr expr) {
7272
return this;
7373
}
7474

75-
public CSD declareCSD(String name) {
76-
return new CSD(name);
75+
public CloudSD declareCSD(String name) {
76+
return new CloudSD(name);
7777
}
7878

7979
public LCVar declareInt(String name) {
@@ -104,7 +104,7 @@ public LCVar declareByte(String name) {
104104
return new LCByte(name);
105105
}
106106

107-
public void apply(CSD ...args) {
107+
public void apply(CloudSD ...args) {
108108
//fun.apply(args);
109109
}
110110

Collapse file

‎src/lambdacloud/core/lang/LCIf.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/core/lang/LCIf.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.List;
55
import java.util.Map;
66

7-
import lambdacloud.core.CSD;
7+
import lambdacloud.core.CloudSD;
88
import symjava.relational.Gt;
99
import symjava.relational.Relation;
1010
import symjava.symbolic.Expr;
@@ -23,7 +23,7 @@ public class LCIf extends LCBase {
2323
Expr condition;
2424
List<Expr> trueStmts = new ArrayList<Expr>();
2525
List<Expr> falseStmts = new ArrayList<Expr>();
26-
public LCIf(Expr condition, CSD ...args) {
26+
public LCIf(Expr condition, CloudSD ...args) {
2727
this.condition = condition;
2828
initLabel();
2929
}
Collapse file

‎src/lambdacloud/net/CloudVarEncoder.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/net/CloudVarEncoder.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import java.io.UnsupportedEncodingException;
88
import java.nio.ByteBuffer;
99

10-
import lambdacloud.core.CSD;
10+
import lambdacloud.core.CloudSD;
1111

12-
public class CloudVarEncoder extends MessageToByteEncoder<CSD> {
12+
public class CloudVarEncoder extends MessageToByteEncoder<CloudSD> {
1313
@Override
14-
protected void encode(ChannelHandlerContext ctx, CSD var, ByteBuf out) {
14+
protected void encode(ChannelHandlerContext ctx, CloudSD var, ByteBuf out) {
1515
// Convert to a BigInteger first for easier implementation.
1616
int nameLen = 0;
1717
int dataLen = var.getData().length * 8;
Collapse file

‎src/lambdacloud/net/CloudVarHandler.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/net/CloudVarHandler.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import java.util.concurrent.BlockingQueue;
77
import java.util.concurrent.LinkedBlockingQueue;
88

9-
import lambdacloud.core.CSD;
9+
import lambdacloud.core.CloudSD;
1010

11-
public class CloudVarHandler extends SimpleChannelInboundHandler<CSD> {
11+
public class CloudVarHandler extends SimpleChannelInboundHandler<CloudSD> {
1212

13-
final BlockingQueue<CSD> queue = new LinkedBlockingQueue<CSD>();
13+
final BlockingQueue<CloudSD> queue = new LinkedBlockingQueue<CloudSD>();
1414

15-
public CSD getCloudVar() {
15+
public CloudSD getCloudVar() {
1616
boolean interrupted = false;
1717
try {
1818
for (;;) {
@@ -30,7 +30,7 @@ public CSD getCloudVar() {
3030
}
3131

3232
@Override
33-
public void messageReceived(ChannelHandlerContext ctx, final CSD msg) {
33+
public void messageReceived(ChannelHandlerContext ctx, final CloudSD msg) {
3434
System.err.println("messageReceived: CloudVar");
3535
queue.offer(msg);
3636
}
Collapse file

‎src/lambdacloud/net/MessageDecoder.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/net/MessageDecoder.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import java.util.List;
99

10-
import lambdacloud.core.CSD;
10+
import lambdacloud.core.CloudSD;
1111

1212
public class MessageDecoder extends ByteToMessageDecoder {
1313

@@ -38,7 +38,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in,
3838
}
3939
byte[] decoded = new byte[nameLen + dataLen];
4040
in.readBytes(decoded);
41-
CSD var = NetIOUtils.createCloudVar(decoded, nameLen, dataLen);
41+
CloudSD var = NetIOUtils.createCloudVar(decoded, nameLen, dataLen);
4242
var.setOnCloudFlag(onCloudFlag == 1 ? true : false);
4343
out.add(var);
4444
// System.out.println("decoded:"+var.getLabel());
Collapse file

‎src/lambdacloud/net/NetIOUtils.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/net/NetIOUtils.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
import java.io.UnsupportedEncodingException;
44
import java.nio.ByteBuffer;
55

6-
import lambdacloud.core.CSD;
6+
import lambdacloud.core.CloudSD;
77

88
public class NetIOUtils {
9-
public static CSD createCloudVar(byte[] data, int nameLen, int dataLen) {
9+
public static CloudSD createCloudVar(byte[] data, int nameLen, int dataLen) {
1010
String name = null;
1111
try {
1212
name = new String(data, 0, nameLen, "UTF-8");
1313
} catch (UnsupportedEncodingException e) {
1414
e.printStackTrace();
1515
}
1616
double[] ddata = toDoubleArray(data, nameLen, dataLen);
17-
return new CSD(name).init(ddata);
17+
return new CloudSD(name).init(ddata);
1818
}
1919

2020
public static CloudVarResp createCloudVarResp(byte[] data, int status, int nameLen, int messageLen) {
Collapse file

‎src/lambdacloud/test/Test.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/test/Test.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import lambdacloud.core.CloudConfig;
66
import lambdacloud.core.CloudFunc;
7-
import lambdacloud.core.CSD;
7+
import lambdacloud.core.CloudSD;
88
import symjava.symbolic.Expr;
99

1010
public class Test {
@@ -18,8 +18,8 @@ public static void test() {
1818
Expr expr = x + y;
1919
CloudFunc f = new CloudFunc(new Expr[]{x, y}, expr);
2020

21-
CSD input = new CSD("input").init(new double[]{1, 2});
22-
CSD output = new CSD("output").resize(1);
21+
CloudSD input = new CloudSD("input").init(new double[]{1, 2});
22+
CloudSD output = new CloudSD("output").resize(1);
2323

2424
long begin = System.currentTimeMillis();
2525
f.apply(output, input);
Collapse file

‎src/lambdacloud/test/Test2.java‎

Copy file name to clipboardExpand all lines: src/lambdacloud/test/Test2.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import static symjava.symbolic.Symbol.y;
55
import lambdacloud.core.CloudConfig;
66
import lambdacloud.core.CloudFunc;
7-
import lambdacloud.core.CSD;
7+
import lambdacloud.core.CloudSD;
88
import symjava.symbolic.Expr;
99

1010
public class Test2 {
@@ -22,8 +22,8 @@ public static void test() {
2222
};
2323
CloudFunc f = new CloudFunc("a_vector_function", new Expr[]{x, y}, exprs);
2424

25-
CSD input = new CSD("input").init(new double[]{2, 1});
26-
CSD output = new CSD("output").resize(2);
25+
CloudSD input = new CloudSD("input").init(new double[]{2, 1});
26+
CloudSD output = new CloudSD("output").resize(2);
2727

2828
long begin = System.currentTimeMillis();
2929
//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.