mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
we have the - operator now
This commit is contained in:
parent
fe25fb2a69
commit
60b9dbf2c0
1 changed files with 4 additions and 4 deletions
|
|
@ -44,9 +44,9 @@ struct CauchyReedSolomonErasureCoding
|
||||||
ValueType col_k(ValueType::N - k);
|
ValueType col_k(ValueType::N - k);
|
||||||
prod_xy *= index(rows[j] + col_k) * index(rows[k] + col_i);
|
prod_xy *= index(rows[j] + col_k) * index(rows[k] + col_i);
|
||||||
if (k != j)
|
if (k != j)
|
||||||
prod_x *= index(rows[j] + rows[k]);
|
prod_x *= index(rows[j] - rows[k]);
|
||||||
if (k != i)
|
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);
|
return prod_xy / (index(rows[j] + col_i) * prod_x * prod_y);
|
||||||
#else
|
#else
|
||||||
|
|
@ -57,7 +57,7 @@ struct CauchyReedSolomonErasureCoding
|
||||||
ValueType col_k(ValueType::N - k);
|
ValueType col_k(ValueType::N - k);
|
||||||
num *= index(rows[k] + col_i);
|
num *= index(rows[k] + col_i);
|
||||||
if (k != i)
|
if (k != i)
|
||||||
den *= index(col_i + col_k);
|
den *= index(col_i - col_k);
|
||||||
}
|
}
|
||||||
row_num = num;
|
row_num = num;
|
||||||
row_den = den;
|
row_den = den;
|
||||||
|
|
@ -67,7 +67,7 @@ struct CauchyReedSolomonErasureCoding
|
||||||
ValueType col_k(ValueType::N - k);
|
ValueType col_k(ValueType::N - k);
|
||||||
num *= index(rows[j] + col_k);
|
num *= index(rows[j] + col_k);
|
||||||
if (k != j)
|
if (k != j)
|
||||||
den *= index(rows[j] + rows[k]);
|
den *= index(rows[j] - rows[k]);
|
||||||
}
|
}
|
||||||
return num / (index(rows[j] + col_i) * den);
|
return num / (index(rows[j] + col_i) * den);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue