feat: ready test runner for monic and sqrt tasks

This commit is contained in:
Alivecow 2024-11-22 21:16:53 +01:00
parent f75e7de733
commit 5bb9bcebff
4 changed files with 53 additions and 30 deletions

View file

@ -81,6 +81,22 @@ pub fn gfpoly_sort(args: &Value) -> Result<Vec<Polynomial>> {
Ok(polys)
}
pub fn gfpoly_make_monic(args: &Value) -> Result<Polynomial> {
let mut poly_a = Polynomial::from_c_array(&args["A"].clone());
poly_a.monic();
Ok(poly_a)
}
pub fn gfpoly_sqrt(args: &Value) -> Result<Polynomial> {
let poly_a = Polynomial::from_c_array(&args["Q"].clone());
let result = poly_a.sqrt();
Ok(result)
}
#[cfg(test)]
mod tests {
use super::*;