From fb5dc6290a118d1231d4e1ed4b8aee84e747c29d Mon Sep 17 00:00:00 2001 From: Byeongkeun Ahn <7p54ks3@naver.com> Date: Wed, 28 Aug 2024 22:06:27 +0900 Subject: [PATCH] Fix clippy::too_long_first_doc_paragraph --- basm-std/src/math/ntt/linear_recurrence.rs | 2 ++ basm-std/src/math/ntt/multiply.rs | 3 ++- basm-std/src/math/ntt/polymul.rs | 1 + basm-std/src/math/sieve.rs | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/basm-std/src/math/ntt/linear_recurrence.rs b/basm-std/src/math/ntt/linear_recurrence.rs index 56650ef4..b0e75396 100644 --- a/basm-std/src/math/ntt/linear_recurrence.rs +++ b/basm-std/src/math/ntt/linear_recurrence.rs @@ -2,6 +2,8 @@ use super::{polymod_u64, polymul_u64}; use crate::math::{modadd, modmul, modsub}; use alloc::vec; +/// Logarithmic time linear recurrence solver. +/// /// Computes the `n`-th term `a[n]` of a linear recurrence specified by `first_terms` and `coeff`. /// The recurrence is `a[k] = coeff[0] * a[k-1] + coeff[1] * a[k-2] + ... + coeff[m-1] * a[k-m-1]` /// where `m` is the length of the `coeff` slice. Also, `a[i] = first_terms[i]` for `0 <= i < m`. diff --git a/basm-std/src/math/ntt/multiply.rs b/basm-std/src/math/ntt/multiply.rs index f974f98f..06ac0485 100644 --- a/basm-std/src/math/ntt/multiply.rs +++ b/basm-std/src/math/ntt/multiply.rs @@ -222,7 +222,8 @@ fn mac3_u64(acc: &mut [u64], b: &[u64], c: &[u64]) { } /// Multiplies two integers `x` and `y`. -/// Least significant digits come first. +/// +/// In the input arrays `x` and `y`, least significant digits should come first. /// If either of the inputs is empty, the result will be an empty Vec. /// Otherwise the output will have length equal to `x.len() + y.len()`. /// diff --git a/basm-std/src/math/ntt/polymul.rs b/basm-std/src/math/ntt/polymul.rs index f45ffb9a..b29088b5 100644 --- a/basm-std/src/math/ntt/polymul.rs +++ b/basm-std/src/math/ntt/polymul.rs @@ -332,6 +332,7 @@ pub fn polymul_ex_u64(out: &mut [u64], x: &[u64], y: &[u64], l: usize, r: usize, } /// Multiplies two polynomials given by coefficients `x` and `y`, modulo `modulo`. +/// /// If `modulo` equals 0, it is treated as `2**64`. /// If either of the inputs is empty, the result will be an empty Vec. /// Otherwise the output will have length equal to `x.len() + y.len() - 1`. diff --git a/basm-std/src/math/sieve.rs b/basm-std/src/math/sieve.rs index 7e2c2f3a..cc3e15f1 100644 --- a/basm-std/src/math/sieve.rs +++ b/basm-std/src/math/sieve.rs @@ -2,6 +2,7 @@ use alloc::vec; use alloc::vec::Vec; /// A dynamically growing linear sieve. +/// /// We ensure amortized O(1) runtime by growing in a similar way as `Vec` /// and by using a linear sieve algorithm. /// The growth strategy is to increase the upper bound by 50% each time.