From de2f86f58dabdfb06c15584f0552657980db2ffc Mon Sep 17 00:00:00 2001 From: bhargav Date: Wed, 1 Nov 2023 01:44:28 -0700 Subject: [PATCH] README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..44b958c --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# fast-ntt + +fast-ntt is a Rust package to compute polynomial multiplication in O(nlog(n)) time. + +## Usage + +```rust +// Polynomial Addition + let a = Polynomial::new(vec![1, 2, 3, 4].iter().map(|&x| BigInt::from(x)).collect()); + let b = Polynomial::new(vec![1, 2].iter().map(|&x| BigInt::from(x)).collect()); + println!("{}", a + b); + +// Polynomial Multiplication + let a = Polynomial::new(vec![1, 2, 3].iter().map(|&x| BigInt::from(x)).collect()); + let b = Polynomial::new( + vec![1, 2, 3, 4] + .iter() + .map(|&x| BigInt::from(x)) + .collect(), + ); + println!("{}", a * b); + +// Polynomial Differentiation + let a = Polynomial::new(vec![3, 2, 1].iter().map(|&x| BigInt::from(x)).collect()); + let da = a.diff(); +```