From 60b9dbf2c0522d2e33a491b9c74e105eea7976ee Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Tue, 6 Jun 2023 23:06:12 +0200 Subject: [PATCH] we have the - operator now --- cauchy_reed_solomon_erasure_coding.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cauchy_reed_solomon_erasure_coding.hh b/cauchy_reed_solomon_erasure_coding.hh index e598c8f..3bf5d7a 100644 --- a/cauchy_reed_solomon_erasure_coding.hh +++ b/cauchy_reed_solomon_erasure_coding.hh @@ -44,9 +44,9 @@ struct CauchyReedSolomonErasureCoding ValueType col_k(ValueType::N - k); prod_xy *= index(rows[j] + col_k) * index(rows[k] + col_i); if (k != j) - prod_x *= index(rows[j] + rows[k]); + prod_x *= index(rows[j] - rows[k]); if (k != i) - prod_y *= index(col_i + col_k); + prod_y *= index(col_i - col_k); } return prod_xy / (index(rows[j] + col_i) * prod_x * prod_y); #else @@ -57,7 +57,7 @@ struct CauchyReedSolomonErasureCoding ValueType col_k(ValueType::N - k); num *= index(rows[k] + col_i); if (k != i) - den *= index(col_i + col_k); + den *= index(col_i - col_k); } row_num = num; row_den = den; @@ -67,7 +67,7 @@ struct CauchyReedSolomonErasureCoding ValueType col_k(ValueType::N - k); num *= index(rows[j] + col_k); if (k != j) - den *= index(rows[j] + rows[k]); + den *= index(rows[j] - rows[k]); } return num / (index(rows[j] + col_i) * den); #endif