Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOLAND committed Nov 1, 2023
1 parent fd52a83 commit de2f86f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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();
```

0 comments on commit de2f86f

Please sign in to comment.