-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlaintext.java
More file actions
67 lines (48 loc) · 1.16 KB
/
Plaintext.java
File metadata and controls
67 lines (48 loc) · 1.16 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package ckks;
public class Plaintext {
private Context context;
private Polynomial m;
private double scale;
private int level;
public Plaintext(Context context) {
this.context = context;
}
public Plaintext(Plaintext src) {
this.context = src.context;
if (src.isEmpty())
return;
this.m = new Polynomial(src.m);
this.scale = src.scale;
this.level = src.level;
}
public void init(Polynomial m, int level) {
init(m, context.defaultScale, level);
}
public void init(Polynomial m, double scale, int level) {
this.m = m;
this.level = level;
this.scale = scale;
}
public Polynomial getM() {
return m;
}
public boolean isEmpty() {
return m == null;
}
public double getScale() {
return scale;
}
public void setScale(double scale) {
this.scale = scale;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public void debugPrint() {
System.out.println("m:");
m.debugPrint();
}
}