@@ -54,7 +54,7 @@ def decompose(self, alpha):
54
54
)
55
55
56
56
def __bit_pack (self , algorithm , * args ):
57
- return b"" .join (algorithm (poly , * args ) for row in self ._data for poly in row )
57
+ return b"" .join (algorithm (poly , * args ) for row in self .rows () for poly in row )
58
58
59
59
def bit_pack_t1 (self ):
60
60
algorithm = self .parent .ring .element .bit_pack_t1
@@ -81,24 +81,24 @@ def to_ntt(self):
81
81
Convert every element of the matrix into NTT form
82
82
"""
83
83
data = [[x .to_ntt () for x in row ] for row in self ._data ]
84
- return self .parent (data , transpose = self ._transpose )
84
+ return self .parent (data , self ._transpose )
85
85
86
86
def from_ntt (self ):
87
87
"""
88
88
Convert every element of the matrix from NTT form
89
89
"""
90
90
data = [[x .from_ntt () for x in row ] for row in self ._data ]
91
- return self .parent (data , transpose = self ._transpose )
91
+ return self .parent (data , self ._transpose )
92
92
93
93
def high_bits (self , alpha , is_ntt = False ):
94
94
matrix = [
95
- [ele .high_bits (alpha , is_ntt = is_ntt ) for ele in row ] for row in self ._data
95
+ [ele .high_bits (alpha , is_ntt = is_ntt ) for ele in row ] for row in self .rows ()
96
96
]
97
97
return self .parent (matrix )
98
98
99
99
def low_bits (self , alpha , is_ntt = False ):
100
100
matrix = [
101
- [ele .low_bits (alpha , is_ntt = is_ntt ) for ele in row ] for row in self ._data
101
+ [ele .low_bits (alpha , is_ntt = is_ntt ) for ele in row ] for row in self .rows ()
102
102
]
103
103
return self .parent (matrix )
104
104
@@ -109,7 +109,7 @@ def make_hint(self, other, alpha):
109
109
"""
110
110
matrix = [
111
111
[p .make_hint (q , alpha ) for p , q in zip (r1 , r2 )]
112
- for r1 , r2 in zip (self ._data , other ._data )
112
+ for r1 , r2 in zip (self .rows () , other .rows () )
113
113
]
114
114
return self .parent (matrix )
115
115
@@ -120,7 +120,7 @@ def make_hint_optimised(self, other, alpha):
120
120
"""
121
121
matrix = [
122
122
[p .make_hint_optimised (q , alpha ) for p , q in zip (r1 , r2 )]
123
- for r1 , r2 in zip (self ._data , other ._data )
123
+ for r1 , r2 in zip (self .rows () , other .rows () )
124
124
]
125
125
return self .parent (matrix )
126
126
@@ -140,7 +140,7 @@ def sum_hint(self):
140
140
Helper function to count the number of coeffs == 1
141
141
in all the polynomials of a matrix
142
142
"""
143
- return sum (c for row in self ._data for p in row for c in p )
143
+ return sum (c for row in self .rows () for p in row for c in p )
144
144
145
145
146
146
class Vector (Matrix ):
0 commit comments