Advertisement
fivemack

Untitled

Oct 20th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. fn roots<T:std::ops::Add<Output = T> +
  2. std::ops::Sub<Output = T> +
  3. std::ops::Div<Output = T> +
  4. std::ops::Mul<Output = T> +
  5. std::ops::Neg<Output = T> +
  6. num_traits::FromPrimitive +
  7. PartialOrd +
  8. std::fmt::Debug +
  9. Copy + Clone +
  10. num_traits::Zero>(f:Polynomial<T>, left:T, right:T) -> Vec<T>
  11. {
  12. let rr = base_roots(f.clone(),left,right);
  13. rr.into_iter().map(|x| { root_by_newton_raphson_near(x, f.clone())}).collect()
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement