MT and Fixes #31
2 changed files with 9 additions and 14 deletions
|
|
@ -234,8 +234,7 @@ pub fn task_distribute_st(testcases: &Testcases) -> Result<Responses> {
|
||||||
|
|
||||||
pub fn task_distribute(testcases: &Testcases) -> Result<Responses> {
|
pub fn task_distribute(testcases: &Testcases) -> Result<Responses> {
|
||||||
let cpus = num_cpus::get();
|
let cpus = num_cpus::get();
|
||||||
//TODO: Deactivate MT for now
|
if cpus > 1 {
|
||||||
if cpus > 10000000000 {
|
|
||||||
task_distribute_mt(testcases)
|
task_distribute_mt(testcases)
|
||||||
} else {
|
} else {
|
||||||
task_distribute_st(testcases)
|
task_distribute_st(testcases)
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ impl Polynomial {
|
||||||
//eprintln!("result in powmod after reduction: {:02X?}", result);
|
//eprintln!("result in powmod after reduction: {:02X?}", result);
|
||||||
|
|
||||||
if result.is_empty() {
|
if result.is_empty() {
|
||||||
result = Polynomial::new(vec![FieldElement::new(vec![0; 16])]);
|
result = Polynomial::zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
@ -192,7 +192,7 @@ impl Polynomial {
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.is_empty() {
|
if result.is_empty() {
|
||||||
result = Polynomial::new(vec![FieldElement::new(vec![0; 16])]);
|
result = Polynomial::zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
@ -241,7 +241,7 @@ impl Polynomial {
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.is_empty() {
|
if result.is_empty() {
|
||||||
result = Polynomial::new(vec![FieldElement::new(vec![0; 16])]);
|
result = Polynomial::zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
@ -278,20 +278,16 @@ impl Polynomial {
|
||||||
remainder.polynomial[pos] = a + &(divisor_coeff * c);
|
remainder.polynomial[pos] = a + &(divisor_coeff * c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove trailing zeros
|
while !remainder.polynomial.is_empty() && remainder.polynomial.last().unwrap().is_zero()
|
||||||
while !remainder.polynomial.is_empty()
|
|
||||||
&& remainder
|
|
||||||
.polynomial
|
|
||||||
.last()
|
|
||||||
.unwrap()
|
|
||||||
.as_ref()
|
|
||||||
.iter()
|
|
||||||
.all(|&x| x == 0)
|
|
||||||
{
|
{
|
||||||
remainder.polynomial.pop();
|
remainder.polynomial.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if remainder.is_empty() {
|
||||||
|
remainder = Polynomial::zero();
|
||||||
|
}
|
||||||
|
|
||||||
(Polynomial::new(quotient_coeffs), remainder)
|
(Polynomial::new(quotient_coeffs), remainder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue