(&self)
| 1278 | } |
| 1279 | |
| 1280 | fn precision(&self) -> f32 { |
| 1281 | let mut sp = 0.0; |
| 1282 | let mut np = 0.0; |
| 1283 | for i in 0..Self::PAY_CAR_CNT { |
| 1284 | let mut tmp = [0i8; Self::MOD_BITS]; |
| 1285 | Self::mod_hard(&mut tmp, self.cons[i]); |
| 1286 | let hard = Self::mod_map(&tmp); |
| 1287 | let error = self.cons[i] - hard; |
| 1288 | sp += hard.norm_sqr(); |
| 1289 | np += error.norm_sqr(); |
| 1290 | } |
| 1291 | sp / np |
| 1292 | } |
| 1293 | |
| 1294 | fn demap(&mut self) { |
| 1295 | let pre = self.precision(); |