From 0c11a35899fbef392a429458bd3655ded6fe10d1 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 26 Sep 2020 03:44:26 +0900 Subject: [PATCH 1/6] Get rid of absolute paths --- src/convolution.rs | 11 ++++------- src/internal_math.rs | 2 +- src/internal_queue.rs | 2 +- src/lazysegtree.rs | 7 ++++--- src/math.rs | 2 +- src/maxflow.rs | 6 +++--- src/mincostflow.rs | 2 +- src/modint.rs | 4 ++-- src/scc.rs | 2 +- src/segtree.rs | 8 ++++---- src/twosat.rs | 2 +- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/convolution.rs b/src/convolution.rs index 9576e3e..91b7b33 100644 --- a/src/convolution.rs +++ b/src/convolution.rs @@ -8,9 +8,9 @@ macro_rules! modulus { const VALUE: u32 = $name as _; const HINT_VALUE_IS_PRIME: bool = true; - fn butterfly_cache() -> &'static ::std::thread::LocalKey<::std::cell::RefCell<::std::option::Option>>> { + fn butterfly_cache() -> &'static ::std::thread::LocalKey<::std::cell::RefCell<::std::option::Option<$crate::modint::ButterflyCache>>> { thread_local! { - static BUTTERFLY_CACHE: ::std::cell::RefCell<::std::option::Option>> = ::std::default::Default::default(); + static BUTTERFLY_CACHE: ::std::cell::RefCell<::std::option::Option<$crate::modint::ButterflyCache<$name>>> = ::std::default::Default::default(); } &BUTTERFLY_CACHE } @@ -19,7 +19,7 @@ macro_rules! modulus { }; } -use crate::{ +use super::{ internal_bit, internal_math, modint::{ButterflyCache, Modulus, RemEuclidU32, StaticModInt}, }; @@ -232,10 +232,7 @@ fn prepare() -> ButterflyCache { #[cfg(test)] mod tests { - use crate::{ - modint::{Mod998244353, Modulus, StaticModInt}, - RemEuclidU32, - }; + use super::super::modint::{Mod998244353, Modulus, RemEuclidU32, StaticModInt}; use rand::{rngs::ThreadRng, Rng as _}; use std::{ convert::{TryFrom, TryInto as _}, diff --git a/src/internal_math.rs b/src/internal_math.rs index 515191c..ce1aaa8 100644 --- a/src/internal_math.rs +++ b/src/internal_math.rs @@ -239,7 +239,7 @@ pub(crate) fn primitive_root(m: i32) -> i32 { mod tests { #![allow(clippy::unreadable_literal)] #![allow(clippy::cognitive_complexity)] - use crate::internal_math::{inv_gcd, is_prime, pow_mod, primitive_root, safe_mod, Barrett}; + use super::{inv_gcd, is_prime, pow_mod, primitive_root, safe_mod, Barrett}; use std::collections::HashSet; #[test] diff --git a/src/internal_queue.rs b/src/internal_queue.rs index 5e51e9a..5266591 100644 --- a/src/internal_queue.rs +++ b/src/internal_queue.rs @@ -51,7 +51,7 @@ impl SimpleQueue { #[cfg(test)] mod test { - use crate::internal_queue::SimpleQueue; + use super::SimpleQueue; #[allow(clippy::cognitive_complexity)] #[test] diff --git a/src/lazysegtree.rs b/src/lazysegtree.rs index 47020a8..540fbab 100644 --- a/src/lazysegtree.rs +++ b/src/lazysegtree.rs @@ -1,5 +1,5 @@ -use crate::internal_bit::ceil_pow2; -use crate::Monoid; +use super::internal_bit::ceil_pow2; +use super::Monoid; pub trait MapMonoid { type M: Monoid; @@ -314,7 +314,8 @@ where #[cfg(test)] mod tests { - use crate::{LazySegtree, MapMonoid, Max}; + use super::super::segtree::Max; + use super::{LazySegtree, MapMonoid}; struct MaxAdd; impl MapMonoid for MaxAdd { diff --git a/src/math.rs b/src/math.rs index 61f15d5..f29a819 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,6 +1,6 @@ //! Number-theoretic algorithms. -use crate::internal_math; +use super::internal_math; use std::mem::swap; diff --git a/src/maxflow.rs b/src/maxflow.rs index 93b337c..6f884c4 100644 --- a/src/maxflow.rs +++ b/src/maxflow.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -use crate::internal_queue::SimpleQueue; -use crate::internal_type_traits::Integral; +use super::internal_queue::SimpleQueue; +use super::internal_type_traits::Integral; use std::cmp::min; use std::iter; @@ -224,7 +224,7 @@ struct _Edge { #[cfg(test)] mod test { - use crate::{Edge, MfGraph}; + use super::{Edge, MfGraph}; #[test] fn test_max_flow_wikipedia() { diff --git a/src/mincostflow.rs b/src/mincostflow.rs index 158a9e8..aafc45e 100644 --- a/src/mincostflow.rs +++ b/src/mincostflow.rs @@ -1,4 +1,4 @@ -use crate::internal_type_traits::Integral; +use super::internal_type_traits::Integral; pub struct MinCostFlowEdge { pub from: usize, diff --git a/src/modint.rs b/src/modint.rs index 8aa5220..1347c21 100644 --- a/src/modint.rs +++ b/src/modint.rs @@ -48,7 +48,7 @@ //! [`ModInt998244353`]: ./type.ModInt998244353.html //! [`ModInt`]: ./type.ModInt.html -use crate::internal_math; +use super::internal_math; use std::{ cell::RefCell, convert::{Infallible, TryInto as _}, @@ -1050,7 +1050,7 @@ impl_folding! { #[cfg(test)] mod tests { - use crate::modint::ModInt1000000007; + use super::ModInt1000000007; #[test] fn static_modint_new() { diff --git a/src/scc.rs b/src/scc.rs index 2eff835..d33c15b 100644 --- a/src/scc.rs +++ b/src/scc.rs @@ -1,4 +1,4 @@ -use crate::internal_scc; +use super::internal_scc; pub struct SccGraph { internal: internal_scc::SccGraph, diff --git a/src/segtree.rs b/src/segtree.rs index b543aa3..9d6b820 100644 --- a/src/segtree.rs +++ b/src/segtree.rs @@ -1,5 +1,5 @@ -use crate::internal_bit::ceil_pow2; -use crate::internal_type_traits::{BoundedAbove, BoundedBelow, One, Zero}; +use super::internal_bit::ceil_pow2; +use super::internal_type_traits::{BoundedAbove, BoundedBelow, One, Zero}; use std::cmp::{max, min}; use std::convert::Infallible; use std::marker::PhantomData; @@ -238,8 +238,8 @@ where #[cfg(test)] mod tests { - use crate::segtree::Max; - use crate::Segtree; + use super::super::Segtree; + use super::Max; #[test] fn test_max_segtree() { diff --git a/src/twosat.rs b/src/twosat.rs index ac5f8b6..213d486 100644 --- a/src/twosat.rs +++ b/src/twosat.rs @@ -1,4 +1,4 @@ -use crate::internal_scc; +use super::internal_scc; pub struct TwoSat { n: usize, From 8e5e8e98bd0bb52870d22217709a4301a4dc4642 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 27 Sep 2020 01:22:19 +0900 Subject: [PATCH 2/6] Get rid of `crate` and `$crate` --- src/convolution.rs | 8 ++++---- src/lazysegtree.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/convolution.rs b/src/convolution.rs index 91b7b33..d084e3a 100644 --- a/src/convolution.rs +++ b/src/convolution.rs @@ -8,9 +8,9 @@ macro_rules! modulus { const VALUE: u32 = $name as _; const HINT_VALUE_IS_PRIME: bool = true; - fn butterfly_cache() -> &'static ::std::thread::LocalKey<::std::cell::RefCell<::std::option::Option<$crate::modint::ButterflyCache>>> { + fn butterfly_cache() -> &'static ::std::thread::LocalKey<::std::cell::RefCell<::std::option::Option>>> { thread_local! { - static BUTTERFLY_CACHE: ::std::cell::RefCell<::std::option::Option<$crate::modint::ButterflyCache<$name>>> = ::std::default::Default::default(); + static BUTTERFLY_CACHE: ::std::cell::RefCell<::std::option::Option>> = ::std::default::Default::default(); } &BUTTERFLY_CACHE } @@ -21,7 +21,7 @@ macro_rules! modulus { use super::{ internal_bit, internal_math, - modint::{ButterflyCache, Modulus, RemEuclidU32, StaticModInt}, + modint::{self, ButterflyCache, Modulus, RemEuclidU32, StaticModInt}, }; use std::{ cmp, @@ -232,7 +232,7 @@ fn prepare() -> ButterflyCache { #[cfg(test)] mod tests { - use super::super::modint::{Mod998244353, Modulus, RemEuclidU32, StaticModInt}; + use super::super::modint::{self, Mod998244353, Modulus, RemEuclidU32, StaticModInt}; use rand::{rngs::ThreadRng, Rng as _}; use std::{ convert::{TryFrom, TryInto as _}, diff --git a/src/lazysegtree.rs b/src/lazysegtree.rs index 540fbab..959fabf 100644 --- a/src/lazysegtree.rs +++ b/src/lazysegtree.rs @@ -1,5 +1,5 @@ use super::internal_bit::ceil_pow2; -use super::Monoid; +use super::segtree::Monoid; pub trait MapMonoid { type M: Monoid; From e2450d1b116080a29d6e482581c6fd4ec6b9aebd Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 30 Oct 2020 15:38:03 +0900 Subject: [PATCH 3/6] Split into separate crates --- .cargo/config.toml | 4 +- .gitignore | 2 +- Cargo.toml | 18 +++++-- acl_convolution/Cargo.toml | 19 ++++++++ {doc => acl_convolution}/katex-header.html | 0 .../src/lib.rs | 14 ++++-- acl_dsu/Cargo.toml | 13 +++++ acl_dsu/katex-header.html | 15 ++++++ src/dsu.rs => acl_dsu/src/lib.rs | 0 acl_fenwicktree/Cargo.toml | 13 +++++ acl_fenwicktree/katex-header.html | 15 ++++++ .../src/lib.rs | 0 acl_internal_bit/Cargo.toml | 13 +++++ acl_internal_bit/katex-header.html | 15 ++++++ .../src/lib.rs | 2 +- acl_internal_math/Cargo.toml | 13 +++++ acl_internal_math/katex-header.html | 15 ++++++ .../src/lib.rs | 24 +++++----- acl_internal_queue/Cargo.toml | 13 +++++ acl_internal_queue/katex-header.html | 15 ++++++ .../src/lib.rs | 16 +++---- acl_internal_scc/Cargo.toml | 13 +++++ acl_internal_scc/katex-header.html | 15 ++++++ .../src/lib.rs | 0 acl_internal_type_traits/Cargo.toml | 13 +++++ acl_internal_type_traits/katex-header.html | 15 ++++++ .../src/lib.rs | 0 acl_lazysegtree/Cargo.toml | 15 ++++++ acl_lazysegtree/katex-header.html | 15 ++++++ .../src/lib.rs | 11 +++-- acl_math/Cargo.toml | 17 +++++++ acl_math/katex-header.html | 15 ++++++ src/math.rs => acl_math/src/lib.rs | 3 +- acl_maxflow/Cargo.toml | 15 ++++++ acl_maxflow/katex-header.html | 15 ++++++ src/maxflow.rs => acl_maxflow/src/lib.rs | 9 +++- acl_mincostflow/Cargo.toml | 14 ++++++ acl_mincostflow/katex-header.html | 15 ++++++ .../src/lib.rs | 5 +- acl_modint/Cargo.toml | 18 +++++++ acl_modint/katex-header.html | 15 ++++++ src/modint.rs => acl_modint/src/lib.rs | 8 ++-- acl_scc/Cargo.toml | 14 ++++++ acl_scc/katex-header.html | 15 ++++++ src/scc.rs => acl_scc/src/lib.rs | 3 +- acl_segtree/Cargo.toml | 15 ++++++ acl_segtree/katex-header.html | 15 ++++++ src/segtree.rs => acl_segtree/src/lib.rs | 12 +++-- acl_string/Cargo.toml | 13 +++++ acl_string/katex-header.html | 15 ++++++ src/string.rs => acl_string/src/lib.rs | 0 acl_twosat/Cargo.toml | 14 ++++++ acl_twosat/katex-header.html | 15 ++++++ src/twosat.rs => acl_twosat/src/lib.rs | 3 +- expand.py | 27 +++++++---- katex-header.html | 15 ++++++ src/lib.rs | 47 ++++++++++++------- 57 files changed, 633 insertions(+), 75 deletions(-) create mode 100644 acl_convolution/Cargo.toml rename {doc => acl_convolution}/katex-header.html (100%) rename src/convolution.rs => acl_convolution/src/lib.rs (97%) create mode 100644 acl_dsu/Cargo.toml create mode 100644 acl_dsu/katex-header.html rename src/dsu.rs => acl_dsu/src/lib.rs (100%) create mode 100644 acl_fenwicktree/Cargo.toml create mode 100644 acl_fenwicktree/katex-header.html rename src/fenwicktree.rs => acl_fenwicktree/src/lib.rs (100%) create mode 100644 acl_internal_bit/Cargo.toml create mode 100644 acl_internal_bit/katex-header.html rename src/internal_bit.rs => acl_internal_bit/src/lib.rs (95%) create mode 100644 acl_internal_math/Cargo.toml create mode 100644 acl_internal_math/katex-header.html rename src/internal_math.rs => acl_internal_math/src/lib.rs (95%) create mode 100644 acl_internal_queue/Cargo.toml create mode 100644 acl_internal_queue/katex-header.html rename src/internal_queue.rs => acl_internal_queue/src/lib.rs (86%) create mode 100644 acl_internal_scc/Cargo.toml create mode 100644 acl_internal_scc/katex-header.html rename src/internal_scc.rs => acl_internal_scc/src/lib.rs (100%) create mode 100644 acl_internal_type_traits/Cargo.toml create mode 100644 acl_internal_type_traits/katex-header.html rename src/internal_type_traits.rs => acl_internal_type_traits/src/lib.rs (100%) create mode 100644 acl_lazysegtree/Cargo.toml create mode 100644 acl_lazysegtree/katex-header.html rename src/lazysegtree.rs => acl_lazysegtree/src/lib.rs (97%) create mode 100644 acl_math/Cargo.toml create mode 100644 acl_math/katex-header.html rename src/math.rs => acl_math/src/lib.rs (98%) create mode 100644 acl_maxflow/Cargo.toml create mode 100644 acl_maxflow/katex-header.html rename src/maxflow.rs => acl_maxflow/src/lib.rs (96%) create mode 100644 acl_mincostflow/Cargo.toml create mode 100644 acl_mincostflow/katex-header.html rename src/mincostflow.rs => acl_mincostflow/src/lib.rs (97%) create mode 100644 acl_modint/Cargo.toml create mode 100644 acl_modint/katex-header.html rename src/modint.rs => acl_modint/src/lib.rs (99%) create mode 100644 acl_scc/Cargo.toml create mode 100644 acl_scc/katex-header.html rename src/scc.rs => acl_scc/src/lib.rs (93%) create mode 100644 acl_segtree/Cargo.toml create mode 100644 acl_segtree/katex-header.html rename src/segtree.rs => acl_segtree/src/lib.rs (95%) create mode 100644 acl_string/Cargo.toml create mode 100644 acl_string/katex-header.html rename src/string.rs => acl_string/src/lib.rs (100%) create mode 100644 acl_twosat/Cargo.toml create mode 100644 acl_twosat/katex-header.html rename src/twosat.rs => acl_twosat/src/lib.rs (96%) create mode 100644 katex-header.html diff --git a/.cargo/config.toml b/.cargo/config.toml index 3d99f63..7dbe5da 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,8 +1,8 @@ [build] -# This works both on local `cargo doc` and on docs.rs because we don't have any `normal` dependency. +# This works both on local `cargo doc` and on docs.rs because we don't have any **external** `normal` dependency. # In most cases, `package.metadata.docs.rs` is recommended. # # See also: # - https://docs.rs/rustdoc-katex-demo # - https://docs.rs/rust-latex-doc-minimal-example -rustdocflags = ["--html-in-header", "./doc/katex-header.html"] +rustdocflags = ["--html-in-header", "./katex-header.html"] diff --git a/.gitignore b/.gitignore index 96ef6c0..4531c3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/target +**/target/ Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 5348943..7b51894 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "ac-library-rs" version = "0.1.0" @@ -13,7 +15,15 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] - -[dev-dependencies] -proconio = "=0.3.6" -rand = "0.7.3" +__acl_convolution = { package = "acl_convolution", version = "0.1.0", path = "./acl_convolution" } +__acl_dsu = { package = "acl_dsu" , version = "0.1.0", path = "./acl_dsu" } +__acl_fenwicktree = { package = "acl_fenwicktree", version = "0.1.0", path = "./acl_fenwicktree" } +__acl_lazysegtree = { package = "acl_lazysegtree", version = "0.1.0", path = "./acl_lazysegtree" } +__acl_math = { package = "acl_math" , version = "0.1.0", path = "./acl_math" } +__acl_maxflow = { package = "acl_maxflow" , version = "0.1.0", path = "./acl_maxflow" } +__acl_mincostflow = { package = "acl_mincostflow", version = "0.1.0", path = "./acl_mincostflow" } +__acl_modint = { package = "acl_modint" , version = "0.1.0", path = "./acl_modint" } +__acl_scc = { package = "acl_scc" , version = "0.1.0", path = "./acl_scc" } +__acl_segtree = { package = "acl_segtree" , version = "0.1.0", path = "./acl_segtree" } +__acl_string = { package = "acl_string" , version = "0.1.0", path = "./acl_string" } +__acl_twosat = { package = "acl_twosat" , version = "0.1.0", path = "./acl_twosat" } diff --git a/acl_convolution/Cargo.toml b/acl_convolution/Cargo.toml new file mode 100644 index 0000000..f693763 --- /dev/null +++ b/acl_convolution/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "acl_convolution" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } +__acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } +__acl_modint = { package = "acl_modint", version = "0.1.0", path = "../acl_modint" } + +[dev-dependencies] +rand = "0.7.3" diff --git a/doc/katex-header.html b/acl_convolution/katex-header.html similarity index 100% rename from doc/katex-header.html rename to acl_convolution/katex-header.html diff --git a/src/convolution.rs b/acl_convolution/src/lib.rs similarity index 97% rename from src/convolution.rs rename to acl_convolution/src/lib.rs index d084e3a..106c864 100644 --- a/src/convolution.rs +++ b/acl_convolution/src/lib.rs @@ -19,10 +19,14 @@ macro_rules! modulus { }; } -use super::{ - internal_bit, internal_math, - modint::{self, ButterflyCache, Modulus, RemEuclidU32, StaticModInt}, -}; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_bit as internal_bit; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_math as internal_math; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_modint as modint; + +use self::modint::{ButterflyCache, Modulus, RemEuclidU32, StaticModInt}; use std::{ cmp, convert::{TryFrom, TryInto as _}, @@ -232,7 +236,7 @@ fn prepare() -> ButterflyCache { #[cfg(test)] mod tests { - use super::super::modint::{self, Mod998244353, Modulus, RemEuclidU32, StaticModInt}; + use super::modint::{self, Mod998244353, Modulus, RemEuclidU32, StaticModInt}; use rand::{rngs::ThreadRng, Rng as _}; use std::{ convert::{TryFrom, TryInto as _}, diff --git a/acl_dsu/Cargo.toml b/acl_dsu/Cargo.toml new file mode 100644 index 0000000..65d3952 --- /dev/null +++ b/acl_dsu/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_dsu" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_dsu/katex-header.html b/acl_dsu/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_dsu/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/dsu.rs b/acl_dsu/src/lib.rs similarity index 100% rename from src/dsu.rs rename to acl_dsu/src/lib.rs diff --git a/acl_fenwicktree/Cargo.toml b/acl_fenwicktree/Cargo.toml new file mode 100644 index 0000000..856b36f --- /dev/null +++ b/acl_fenwicktree/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_fenwicktree" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_fenwicktree/katex-header.html b/acl_fenwicktree/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_fenwicktree/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/fenwicktree.rs b/acl_fenwicktree/src/lib.rs similarity index 100% rename from src/fenwicktree.rs rename to acl_fenwicktree/src/lib.rs diff --git a/acl_internal_bit/Cargo.toml b/acl_internal_bit/Cargo.toml new file mode 100644 index 0000000..abf42da --- /dev/null +++ b/acl_internal_bit/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_internal_bit" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_internal_bit/katex-header.html b/acl_internal_bit/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_internal_bit/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/internal_bit.rs b/acl_internal_bit/src/lib.rs similarity index 95% rename from src/internal_bit.rs rename to acl_internal_bit/src/lib.rs index 5ab7583..1ba7a83 100644 --- a/src/internal_bit.rs +++ b/acl_internal_bit/src/lib.rs @@ -3,7 +3,7 @@ // - `bsf` = `__builtin_ctz`: is equivalent to `{integer}::trailing_zeros` #[allow(dead_code)] -pub(crate) fn ceil_pow2(n: u32) -> u32 { +pub fn ceil_pow2(n: u32) -> u32 { 32 - n.saturating_sub(1).leading_zeros() } diff --git a/acl_internal_math/Cargo.toml b/acl_internal_math/Cargo.toml new file mode 100644 index 0000000..b24e166 --- /dev/null +++ b/acl_internal_math/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_internal_math" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_internal_math/katex-header.html b/acl_internal_math/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_internal_math/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/internal_math.rs b/acl_internal_math/src/lib.rs similarity index 95% rename from src/internal_math.rs rename to acl_internal_math/src/lib.rs index ce1aaa8..9b900d8 100644 --- a/src/internal_math.rs +++ b/acl_internal_math/src/lib.rs @@ -8,7 +8,7 @@ use std::mem::swap; /// # Returns /// x mod m /* const */ -pub(crate) fn safe_mod(mut x: i64, m: i64) -> i64 { +pub fn safe_mod(mut x: i64, m: i64) -> i64 { x %= m; if x < 0 { x += m; @@ -19,9 +19,9 @@ pub(crate) fn safe_mod(mut x: i64, m: i64) -> i64 { /// Fast modular by barrett reduction /// Reference: https://en.wikipedia.org/wiki/Barrett_reduction /// NOTE: reconsider after Ice Lake -pub(crate) struct Barrett { - pub(crate) _m: u32, - pub(crate) im: u64, +pub struct Barrett { + pub _m: u32, + pub im: u64, } impl Barrett { @@ -30,7 +30,7 @@ impl Barrett { /// (Note: `m <= 2^31` should also hold, which is undocumented in the original library. /// See the [pull reqeust commment](https://github.com/rust-lang-ja/ac-library-rs/pull/3#discussion_r484661007) /// for more details.) - pub(crate) fn new(m: u32) -> Barrett { + pub fn new(m: u32) -> Barrett { Barrett { _m: m, im: (-1i64 as u64 / m as u64).wrapping_add(1), @@ -39,7 +39,7 @@ impl Barrett { /// # Returns /// `m` - pub(crate) fn umod(&self) -> u32 { + pub fn umod(&self) -> u32 { self._m } @@ -50,7 +50,7 @@ impl Barrett { /// # Returns /// a * b % m #[allow(clippy::many_single_char_names)] - pub(crate) fn mul(&self, a: u32, b: u32) -> u32 { + pub fn mul(&self, a: u32, b: u32) -> u32 { mul_mod(a, b, self._m, self.im) } } @@ -62,7 +62,7 @@ impl Barrett { /// * `m` `1 <= m <= 2^31` /// * `im` = ceil(2^64 / `m`) #[allow(clippy::many_single_char_names)] -pub(crate) fn mul_mod(a: u32, b: u32, m: u32, im: u64) -> u32 { +pub fn mul_mod(a: u32, b: u32, m: u32, im: u64) -> u32 { // [1] m = 1 // a = b = im = 0, so okay @@ -91,7 +91,7 @@ pub(crate) fn mul_mod(a: u32, b: u32, m: u32, im: u64) -> u32 { /// `(x ** n) % m` /* const */ #[allow(clippy::many_single_char_names)] -pub(crate) fn pow_mod(x: i64, mut n: i64, m: i32) -> i64 { +pub fn pow_mod(x: i64, mut n: i64, m: i32) -> i64 { if m == 1 { return 0; } @@ -115,7 +115,7 @@ pub(crate) fn pow_mod(x: i64, mut n: i64, m: i32) -> i64 { /// # Parameters /// * `n` `0 <= n` /* const */ -pub(crate) fn is_prime(n: i32) -> bool { +pub fn is_prime(n: i32) -> bool { let n = n as i64; match n { _ if n <= 1 => return false, @@ -151,7 +151,7 @@ pub(crate) fn is_prime(n: i32) -> bool { /// (g, x) s.t. g = gcd(a, b), xa = g (mod b), 0 <= x < b/g /* const */ #[allow(clippy::many_single_char_names)] -pub(crate) fn inv_gcd(a: i64, b: i64) -> (i64, i64) { +pub fn inv_gcd(a: i64, b: i64) -> (i64, i64) { let a = safe_mod(a, b); if a == 0 { return (b, 0); @@ -191,7 +191,7 @@ pub(crate) fn inv_gcd(a: i64, b: i64) -> (i64, i64) { /// @param m must be prime /// @return primitive root (and minimum in now) /* const */ -pub(crate) fn primitive_root(m: i32) -> i32 { +pub fn primitive_root(m: i32) -> i32 { match m { 2 => return 1, 167_772_161 => return 3, diff --git a/acl_internal_queue/Cargo.toml b/acl_internal_queue/Cargo.toml new file mode 100644 index 0000000..4480157 --- /dev/null +++ b/acl_internal_queue/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_internal_queue" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_internal_queue/katex-header.html b/acl_internal_queue/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_internal_queue/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/internal_queue.rs b/acl_internal_queue/src/lib.rs similarity index 86% rename from src/internal_queue.rs rename to acl_internal_queue/src/lib.rs index 5266591..ca4b782 100644 --- a/src/internal_queue.rs +++ b/acl_internal_queue/src/lib.rs @@ -1,32 +1,32 @@ #![allow(dead_code)] #[derive(Default)] -pub(crate) struct SimpleQueue { +pub struct SimpleQueue { payload: Vec, pos: usize, } impl SimpleQueue { - pub(crate) fn reserve(&mut self, n: usize) { + pub fn reserve(&mut self, n: usize) { if n > self.payload.len() { self.payload.reserve(n - self.payload.len()); } } - pub(crate) fn size(&self) -> usize { + pub fn size(&self) -> usize { self.payload.len() - self.pos } - pub(crate) fn empty(&self) -> bool { + pub fn empty(&self) -> bool { self.pos == self.payload.len() } - pub(crate) fn push(&mut self, t: T) { + pub fn push(&mut self, t: T) { self.payload.push(t); } // Do we need mutable version? - pub(crate) fn front(&self) -> Option<&T> { + pub fn front(&self) -> Option<&T> { if self.pos < self.payload.len() { Some(&self.payload[self.pos]) } else { @@ -34,12 +34,12 @@ impl SimpleQueue { } } - pub(crate) fn clear(&mut self) { + pub fn clear(&mut self) { self.payload.clear(); self.pos = 0; } - pub(crate) fn pop(&mut self) -> Option<&T> { + pub fn pop(&mut self) -> Option<&T> { if self.pos < self.payload.len() { self.pos += 1; Some(&self.payload[self.pos - 1]) diff --git a/acl_internal_scc/Cargo.toml b/acl_internal_scc/Cargo.toml new file mode 100644 index 0000000..fb61b0a --- /dev/null +++ b/acl_internal_scc/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_internal_scc" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_internal_scc/katex-header.html b/acl_internal_scc/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_internal_scc/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/internal_scc.rs b/acl_internal_scc/src/lib.rs similarity index 100% rename from src/internal_scc.rs rename to acl_internal_scc/src/lib.rs diff --git a/acl_internal_type_traits/Cargo.toml b/acl_internal_type_traits/Cargo.toml new file mode 100644 index 0000000..0ff1414 --- /dev/null +++ b/acl_internal_type_traits/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_internal_type_traits" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_internal_type_traits/katex-header.html b/acl_internal_type_traits/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_internal_type_traits/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/internal_type_traits.rs b/acl_internal_type_traits/src/lib.rs similarity index 100% rename from src/internal_type_traits.rs rename to acl_internal_type_traits/src/lib.rs diff --git a/acl_lazysegtree/Cargo.toml b/acl_lazysegtree/Cargo.toml new file mode 100644 index 0000000..73c31a3 --- /dev/null +++ b/acl_lazysegtree/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "acl_lazysegtree" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } +__acl_segtree = { package = "acl_segtree", version = "0.1.0", path = "../acl_segtree" } diff --git a/acl_lazysegtree/katex-header.html b/acl_lazysegtree/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_lazysegtree/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/lazysegtree.rs b/acl_lazysegtree/src/lib.rs similarity index 97% rename from src/lazysegtree.rs rename to acl_lazysegtree/src/lib.rs index 959fabf..db3d1e0 100644 --- a/src/lazysegtree.rs +++ b/acl_lazysegtree/src/lib.rs @@ -1,5 +1,9 @@ -use super::internal_bit::ceil_pow2; -use super::segtree::Monoid; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_bit as internal_bit; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_segtree as segtree; + +use self::{internal_bit::ceil_pow2, segtree::Monoid}; pub trait MapMonoid { type M: Monoid; @@ -314,8 +318,7 @@ where #[cfg(test)] mod tests { - use super::super::segtree::Max; - use super::{LazySegtree, MapMonoid}; + use super::{segtree::Max, LazySegtree, MapMonoid}; struct MaxAdd; impl MapMonoid for MaxAdd { diff --git a/acl_math/Cargo.toml b/acl_math/Cargo.toml new file mode 100644 index 0000000..f622901 --- /dev/null +++ b/acl_math/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "acl_math" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } + +[dev-dependencies] +ac-library-rs = { version = "*", path = ".." } diff --git a/acl_math/katex-header.html b/acl_math/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_math/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/math.rs b/acl_math/src/lib.rs similarity index 98% rename from src/math.rs rename to acl_math/src/lib.rs index f29a819..312b47d 100644 --- a/src/math.rs +++ b/acl_math/src/lib.rs @@ -1,6 +1,7 @@ //! Number-theoretic algorithms. -use super::internal_math; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_math as internal_math; use std::mem::swap; diff --git a/acl_maxflow/Cargo.toml b/acl_maxflow/Cargo.toml new file mode 100644 index 0000000..b53c84c --- /dev/null +++ b/acl_maxflow/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "acl_maxflow" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_queue = { package = "acl_internal_queue", version = "0.1.0", path = "../acl_internal_queue" } +__acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } diff --git a/acl_maxflow/katex-header.html b/acl_maxflow/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_maxflow/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/maxflow.rs b/acl_maxflow/src/lib.rs similarity index 96% rename from src/maxflow.rs rename to acl_maxflow/src/lib.rs index 6f884c4..942413f 100644 --- a/src/maxflow.rs +++ b/acl_maxflow/src/lib.rs @@ -1,6 +1,11 @@ #![allow(dead_code)] -use super::internal_queue::SimpleQueue; -use super::internal_type_traits::Integral; + +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_queue as internal_queue; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_type_traits as internal_type_traits; + +use self::{internal_queue::SimpleQueue, internal_type_traits::Integral}; use std::cmp::min; use std::iter; diff --git a/acl_mincostflow/Cargo.toml b/acl_mincostflow/Cargo.toml new file mode 100644 index 0000000..bee93cd --- /dev/null +++ b/acl_mincostflow/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "acl_mincostflow" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } diff --git a/acl_mincostflow/katex-header.html b/acl_mincostflow/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_mincostflow/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/mincostflow.rs b/acl_mincostflow/src/lib.rs similarity index 97% rename from src/mincostflow.rs rename to acl_mincostflow/src/lib.rs index aafc45e..29f12fc 100644 --- a/src/mincostflow.rs +++ b/acl_mincostflow/src/lib.rs @@ -1,4 +1,7 @@ -use super::internal_type_traits::Integral; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_type_traits as internal_type_traits; + +use self::internal_type_traits::Integral; pub struct MinCostFlowEdge { pub from: usize, diff --git a/acl_modint/Cargo.toml b/acl_modint/Cargo.toml new file mode 100644 index 0000000..62a66a7 --- /dev/null +++ b/acl_modint/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "acl_modint" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } + +[dev-dependencies] +ac-library-rs = { version = "*", path = ".." } +proconio = "=0.3.6" diff --git a/acl_modint/katex-header.html b/acl_modint/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_modint/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/modint.rs b/acl_modint/src/lib.rs similarity index 99% rename from src/modint.rs rename to acl_modint/src/lib.rs index 1347c21..7c90b8a 100644 --- a/src/modint.rs +++ b/acl_modint/src/lib.rs @@ -48,7 +48,9 @@ //! [`ModInt998244353`]: ./type.ModInt998244353.html //! [`ModInt`]: ./type.ModInt.html -use super::internal_math; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_math as internal_math; + use std::{ cell::RefCell, convert::{Infallible, TryInto as _}, @@ -283,8 +285,8 @@ impl Modulus for Mod998244353 { /// Cache for butterfly operations. pub struct ButterflyCache { - pub(crate) sum_e: Vec>, - pub(crate) sum_ie: Vec>, + pub sum_e: Vec>, + pub sum_ie: Vec>, } /// Represents _ℤ/mℤ_ where _m_ is a dynamic value. diff --git a/acl_scc/Cargo.toml b/acl_scc/Cargo.toml new file mode 100644 index 0000000..bd38a9d --- /dev/null +++ b/acl_scc/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "acl_scc" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } \ No newline at end of file diff --git a/acl_scc/katex-header.html b/acl_scc/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_scc/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/scc.rs b/acl_scc/src/lib.rs similarity index 93% rename from src/scc.rs rename to acl_scc/src/lib.rs index d33c15b..f3d9d92 100644 --- a/src/scc.rs +++ b/acl_scc/src/lib.rs @@ -1,4 +1,5 @@ -use super::internal_scc; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_scc as internal_scc; pub struct SccGraph { internal: internal_scc::SccGraph, diff --git a/acl_segtree/Cargo.toml b/acl_segtree/Cargo.toml new file mode 100644 index 0000000..f599d84 --- /dev/null +++ b/acl_segtree/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "acl_segtree" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } +__acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } \ No newline at end of file diff --git a/acl_segtree/katex-header.html b/acl_segtree/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_segtree/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/segtree.rs b/acl_segtree/src/lib.rs similarity index 95% rename from src/segtree.rs rename to acl_segtree/src/lib.rs index 9d6b820..930f354 100644 --- a/src/segtree.rs +++ b/acl_segtree/src/lib.rs @@ -1,5 +1,10 @@ -use super::internal_bit::ceil_pow2; -use super::internal_type_traits::{BoundedAbove, BoundedBelow, One, Zero}; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_bit as internal_bit; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_type_traits as internal_type_traits; + +use self::internal_bit::ceil_pow2; +use self::internal_type_traits::{BoundedAbove, BoundedBelow, One, Zero}; use std::cmp::{max, min}; use std::convert::Infallible; use std::marker::PhantomData; @@ -238,8 +243,7 @@ where #[cfg(test)] mod tests { - use super::super::Segtree; - use super::Max; + use super::{Max, Segtree}; #[test] fn test_max_segtree() { diff --git a/acl_string/Cargo.toml b/acl_string/Cargo.toml new file mode 100644 index 0000000..763d611 --- /dev/null +++ b/acl_string/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "acl_string" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] diff --git a/acl_string/katex-header.html b/acl_string/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_string/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/string.rs b/acl_string/src/lib.rs similarity index 100% rename from src/string.rs rename to acl_string/src/lib.rs diff --git a/acl_twosat/Cargo.toml b/acl_twosat/Cargo.toml new file mode 100644 index 0000000..8dd7511 --- /dev/null +++ b/acl_twosat/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "acl_twosat" +version = "0.1.0" +authors = ["rust-lang-ja Developers"] +edition = "2018" +description = "A Rust port of AtCoder Library (ACL)." +license = "CC0-1.0" +repository = "https://github.com/rust-lang-ja/ac-library-rs" +keywords = ["competitive"] +categories = ["algorithms", "data-structures"] +publish = false + +[dependencies] +__acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } diff --git a/acl_twosat/katex-header.html b/acl_twosat/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/acl_twosat/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/twosat.rs b/acl_twosat/src/lib.rs similarity index 96% rename from src/twosat.rs rename to acl_twosat/src/lib.rs index 213d486..82907da 100644 --- a/src/twosat.rs +++ b/acl_twosat/src/lib.rs @@ -1,4 +1,5 @@ -use super::internal_scc; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +extern crate __acl_internal_scc as internal_scc; pub struct TwoSat { n: usize, diff --git a/expand.py b/expand.py index 4072ced..ea5d20e 100755 --- a/expand.py +++ b/expand.py @@ -4,6 +4,7 @@ import getopt import tempfile import subprocess +import re usage = '''Usage:expand.py [options] Output Modules: @@ -43,18 +44,28 @@ 'scc': ('internal_scc',), 'segtree': ('internal_bit', 'internal_type_traits',), 'twosat': ('internal_scc',), } -src_path = 'src/' +CARGO_EQUIP_ATTR = '#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)]' +EXTERN_CRATE_PATTERN = re.compile( + 'extern crate [a-z0-9_].* as (?P[a-z0-9_]+);' +) -def output_file(filename): - global src_path - +def output_file(name): res = [] - with open(src_path+filename+'.rs', 'r') as f: - res.append('pub mod {} {{'.format(filename)) + with open('./acl_{}/src/lib.rs'.format(name), 'r') as f: + res.append('pub mod acl_{} {{'.format(name)) for line in f: - res.append(line.rstrip()) + line = line.rstrip() + match = EXTERN_CRATE_PATTERN.match(line) + if line == CARGO_EQUIP_ATTR: + res.append('/*' + CARGO_EQUIP_ATTR + '*/') + elif match: + res.append('/*{line}*/use crate::acl_{name} as {name};'.format( + line=line, name=match['name'], + )) + else: + res.append(line) res.append('}') return res @@ -103,7 +114,7 @@ def output_file(filename): # Modules that begin with 'internal' are for internal use, so they are not # declared. if not i.startswith('internal'): - output_data.append('use {}::*;'.format(i)) + output_data.append('use acl_{}::*;'.format(i)) # rustfmt with tempfile.TemporaryDirectory() as temp_dir: diff --git a/katex-header.html b/katex-header.html new file mode 100644 index 0000000..0837616 --- /dev/null +++ b/katex-header.html @@ -0,0 +1,15 @@ + + + + diff --git a/src/lib.rs b/src/lib.rs index 5452b25..e2b34e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,21 +1,34 @@ -pub mod convolution; -pub mod dsu; -pub mod fenwicktree; -pub mod lazysegtree; -pub mod math; -pub mod maxflow; -pub mod mincostflow; -pub mod modint; -pub mod scc; -pub mod segtree; -pub mod string; -pub mod twosat; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_convolution as convolution; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_dsu as dsu; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_fenwicktree as fenwicktree; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_lazysegtree as lazysegtree; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_math as math; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_maxflow as maxflow; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_mincostflow as mincostflow; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_modint as modint; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_scc as scc; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_segtree as segtree; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_string as string; +#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +pub extern crate __acl_twosat as twosat; -pub(crate) mod internal_bit; -pub(crate) mod internal_math; -pub(crate) mod internal_queue; -pub(crate) mod internal_scc; -pub(crate) mod internal_type_traits; +// Crates like `num` re-export sub crates like this, but currently `cargo-simple-bundler` does not support inline modules. +//pub mod twosat { +// #[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] +// extern crate __acl_twosat as twosat; +// pub use self::twosat::*; +//} pub use convolution::{convolution, convolution_i64}; pub use dsu::Dsu; From 5c85d58671919be46a48bbb451747de81917b8aa Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 31 Oct 2020 15:40:31 +0900 Subject: [PATCH 4/6] Use `package.metadata` instead of Cargo configuration --- .cargo/config.toml | 8 -------- Cargo.toml | 3 +++ acl_convolution/Cargo.toml | 3 +++ acl_dsu/Cargo.toml | 3 +++ acl_fenwicktree/Cargo.toml | 3 +++ acl_internal_bit/Cargo.toml | 3 +++ acl_internal_math/Cargo.toml | 3 +++ acl_internal_queue/Cargo.toml | 3 +++ acl_internal_scc/Cargo.toml | 3 +++ acl_internal_type_traits/Cargo.toml | 3 +++ acl_lazysegtree/Cargo.toml | 3 +++ acl_math/Cargo.toml | 3 +++ acl_maxflow/Cargo.toml | 3 +++ acl_mincostflow/Cargo.toml | 3 +++ acl_modint/Cargo.toml | 3 +++ acl_scc/Cargo.toml | 3 +++ acl_segtree/Cargo.toml | 3 +++ acl_string/Cargo.toml | 3 +++ acl_twosat/Cargo.toml | 3 +++ 19 files changed, 54 insertions(+), 8 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 7dbe5da..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,8 +0,0 @@ -[build] -# This works both on local `cargo doc` and on docs.rs because we don't have any **external** `normal` dependency. -# In most cases, `package.metadata.docs.rs` is recommended. -# -# See also: -# - https://docs.rs/rustdoc-katex-demo -# - https://docs.rs/rust-latex-doc-minimal-example -rustdocflags = ["--html-in-header", "./katex-header.html"] diff --git a/Cargo.toml b/Cargo.toml index 7b51894..cea2975 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/acl_convolution/Cargo.toml b/acl_convolution/Cargo.toml index f693763..a9110a4 100644 --- a/acl_convolution/Cargo.toml +++ b/acl_convolution/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } __acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } diff --git a/acl_dsu/Cargo.toml b/acl_dsu/Cargo.toml index 65d3952..ebe4546 100644 --- a/acl_dsu/Cargo.toml +++ b/acl_dsu/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_fenwicktree/Cargo.toml b/acl_fenwicktree/Cargo.toml index 856b36f..e569950 100644 --- a/acl_fenwicktree/Cargo.toml +++ b/acl_fenwicktree/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_internal_bit/Cargo.toml b/acl_internal_bit/Cargo.toml index abf42da..a76f31b 100644 --- a/acl_internal_bit/Cargo.toml +++ b/acl_internal_bit/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_internal_math/Cargo.toml b/acl_internal_math/Cargo.toml index b24e166..8cb72ab 100644 --- a/acl_internal_math/Cargo.toml +++ b/acl_internal_math/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_internal_queue/Cargo.toml b/acl_internal_queue/Cargo.toml index 4480157..fb61964 100644 --- a/acl_internal_queue/Cargo.toml +++ b/acl_internal_queue/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_internal_scc/Cargo.toml b/acl_internal_scc/Cargo.toml index fb61b0a..2205eb5 100644 --- a/acl_internal_scc/Cargo.toml +++ b/acl_internal_scc/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_internal_type_traits/Cargo.toml b/acl_internal_type_traits/Cargo.toml index 0ff1414..d0a0240 100644 --- a/acl_internal_type_traits/Cargo.toml +++ b/acl_internal_type_traits/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_lazysegtree/Cargo.toml b/acl_lazysegtree/Cargo.toml index 73c31a3..95d7536 100644 --- a/acl_lazysegtree/Cargo.toml +++ b/acl_lazysegtree/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } __acl_segtree = { package = "acl_segtree", version = "0.1.0", path = "../acl_segtree" } diff --git a/acl_math/Cargo.toml b/acl_math/Cargo.toml index f622901..ccf83db 100644 --- a/acl_math/Cargo.toml +++ b/acl_math/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } diff --git a/acl_maxflow/Cargo.toml b/acl_maxflow/Cargo.toml index b53c84c..30e8b5d 100644 --- a/acl_maxflow/Cargo.toml +++ b/acl_maxflow/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_queue = { package = "acl_internal_queue", version = "0.1.0", path = "../acl_internal_queue" } __acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } diff --git a/acl_mincostflow/Cargo.toml b/acl_mincostflow/Cargo.toml index bee93cd..674eeb4 100644 --- a/acl_mincostflow/Cargo.toml +++ b/acl_mincostflow/Cargo.toml @@ -10,5 +10,8 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } diff --git a/acl_modint/Cargo.toml b/acl_modint/Cargo.toml index 62a66a7..ae159c0 100644 --- a/acl_modint/Cargo.toml +++ b/acl_modint/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_math = { package = "acl_internal_math", version = "0.1.0", path = "../acl_internal_math" } diff --git a/acl_scc/Cargo.toml b/acl_scc/Cargo.toml index bd38a9d..014d316 100644 --- a/acl_scc/Cargo.toml +++ b/acl_scc/Cargo.toml @@ -10,5 +10,8 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } \ No newline at end of file diff --git a/acl_segtree/Cargo.toml b/acl_segtree/Cargo.toml index f599d84..925bb6f 100644 --- a/acl_segtree/Cargo.toml +++ b/acl_segtree/Cargo.toml @@ -10,6 +10,9 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } __acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } \ No newline at end of file diff --git a/acl_string/Cargo.toml b/acl_string/Cargo.toml index 763d611..0ff1fd5 100644 --- a/acl_string/Cargo.toml +++ b/acl_string/Cargo.toml @@ -10,4 +10,7 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] diff --git a/acl_twosat/Cargo.toml b/acl_twosat/Cargo.toml index 8dd7511..90c0a36 100644 --- a/acl_twosat/Cargo.toml +++ b/acl_twosat/Cargo.toml @@ -10,5 +10,8 @@ keywords = ["competitive"] categories = ["algorithms", "data-structures"] publish = false +[package.metadata.docs.rs] +rustdoc-args = ["--html-in-header", "./katex-header.html"] + [dependencies] __acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } From ca55b80ad2bebf0cc99e7efb77b08822c678f38d Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 31 Oct 2020 16:01:51 +0900 Subject: [PATCH 5/6] Append missing EOLs --- acl_scc/Cargo.toml | 2 +- acl_segtree/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acl_scc/Cargo.toml b/acl_scc/Cargo.toml index 014d316..bac6351 100644 --- a/acl_scc/Cargo.toml +++ b/acl_scc/Cargo.toml @@ -14,4 +14,4 @@ publish = false rustdoc-args = ["--html-in-header", "./katex-header.html"] [dependencies] -__acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } \ No newline at end of file +__acl_internal_scc = { package = "acl_internal_scc", version = "0.1.0", path = "../acl_internal_scc" } diff --git a/acl_segtree/Cargo.toml b/acl_segtree/Cargo.toml index 925bb6f..717bbbc 100644 --- a/acl_segtree/Cargo.toml +++ b/acl_segtree/Cargo.toml @@ -15,4 +15,4 @@ rustdoc-args = ["--html-in-header", "./katex-header.html"] [dependencies] __acl_internal_bit = { package = "acl_internal_bit", version = "0.1.0", path = "../acl_internal_bit" } -__acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } \ No newline at end of file +__acl_internal_type_traits = { package = "acl_internal_type_traits", version = "0.1.0", path = "../acl_internal_type_traits" } From e8695b121c46acb83fa706449d9d628d9866625b Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 1 Nov 2020 21:47:48 +0900 Subject: [PATCH 6/6] Remove `#[cfg_attr]`s from `extern crate`s --- acl_convolution/src/lib.rs | 3 --- acl_lazysegtree/src/lib.rs | 2 -- acl_math/src/lib.rs | 1 - acl_maxflow/src/lib.rs | 2 -- acl_mincostflow/src/lib.rs | 1 - acl_modint/src/lib.rs | 1 - acl_scc/src/lib.rs | 1 - acl_segtree/src/lib.rs | 2 -- acl_twosat/src/lib.rs | 1 - expand.py | 5 +---- src/lib.rs | 13 ------------- 11 files changed, 1 insertion(+), 31 deletions(-) diff --git a/acl_convolution/src/lib.rs b/acl_convolution/src/lib.rs index 106c864..a76af21 100644 --- a/acl_convolution/src/lib.rs +++ b/acl_convolution/src/lib.rs @@ -19,11 +19,8 @@ macro_rules! modulus { }; } -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_bit as internal_bit; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_math as internal_math; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_modint as modint; use self::modint::{ButterflyCache, Modulus, RemEuclidU32, StaticModInt}; diff --git a/acl_lazysegtree/src/lib.rs b/acl_lazysegtree/src/lib.rs index db3d1e0..6a1e90f 100644 --- a/acl_lazysegtree/src/lib.rs +++ b/acl_lazysegtree/src/lib.rs @@ -1,6 +1,4 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_bit as internal_bit; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_segtree as segtree; use self::{internal_bit::ceil_pow2, segtree::Monoid}; diff --git a/acl_math/src/lib.rs b/acl_math/src/lib.rs index 312b47d..d6a6aba 100644 --- a/acl_math/src/lib.rs +++ b/acl_math/src/lib.rs @@ -1,6 +1,5 @@ //! Number-theoretic algorithms. -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_math as internal_math; use std::mem::swap; diff --git a/acl_maxflow/src/lib.rs b/acl_maxflow/src/lib.rs index 942413f..4302a24 100644 --- a/acl_maxflow/src/lib.rs +++ b/acl_maxflow/src/lib.rs @@ -1,8 +1,6 @@ #![allow(dead_code)] -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_queue as internal_queue; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_type_traits as internal_type_traits; use self::{internal_queue::SimpleQueue, internal_type_traits::Integral}; diff --git a/acl_mincostflow/src/lib.rs b/acl_mincostflow/src/lib.rs index 29f12fc..ba7de6a 100644 --- a/acl_mincostflow/src/lib.rs +++ b/acl_mincostflow/src/lib.rs @@ -1,4 +1,3 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_type_traits as internal_type_traits; use self::internal_type_traits::Integral; diff --git a/acl_modint/src/lib.rs b/acl_modint/src/lib.rs index 7c90b8a..cb09c51 100644 --- a/acl_modint/src/lib.rs +++ b/acl_modint/src/lib.rs @@ -48,7 +48,6 @@ //! [`ModInt998244353`]: ./type.ModInt998244353.html //! [`ModInt`]: ./type.ModInt.html -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_math as internal_math; use std::{ diff --git a/acl_scc/src/lib.rs b/acl_scc/src/lib.rs index f3d9d92..645cf5b 100644 --- a/acl_scc/src/lib.rs +++ b/acl_scc/src/lib.rs @@ -1,4 +1,3 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_scc as internal_scc; pub struct SccGraph { diff --git a/acl_segtree/src/lib.rs b/acl_segtree/src/lib.rs index 930f354..a103707 100644 --- a/acl_segtree/src/lib.rs +++ b/acl_segtree/src/lib.rs @@ -1,6 +1,4 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_bit as internal_bit; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_type_traits as internal_type_traits; use self::internal_bit::ceil_pow2; diff --git a/acl_twosat/src/lib.rs b/acl_twosat/src/lib.rs index 82907da..3f5e1e1 100644 --- a/acl_twosat/src/lib.rs +++ b/acl_twosat/src/lib.rs @@ -1,4 +1,3 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] extern crate __acl_internal_scc as internal_scc; pub struct TwoSat { diff --git a/expand.py b/expand.py index ea5d20e..b1bf08d 100755 --- a/expand.py +++ b/expand.py @@ -44,7 +44,6 @@ 'scc': ('internal_scc',), 'segtree': ('internal_bit', 'internal_type_traits',), 'twosat': ('internal_scc',), } -CARGO_EQUIP_ATTR = '#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)]' EXTERN_CRATE_PATTERN = re.compile( 'extern crate [a-z0-9_].* as (?P[a-z0-9_]+);' ) @@ -58,9 +57,7 @@ def output_file(name): for line in f: line = line.rstrip() match = EXTERN_CRATE_PATTERN.match(line) - if line == CARGO_EQUIP_ATTR: - res.append('/*' + CARGO_EQUIP_ATTR + '*/') - elif match: + if match: res.append('/*{line}*/use crate::acl_{name} as {name};'.format( line=line, name=match['name'], )) diff --git a/src/lib.rs b/src/lib.rs index e2b34e6..1b53fb0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,31 +1,18 @@ -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_convolution as convolution; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_dsu as dsu; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_fenwicktree as fenwicktree; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_lazysegtree as lazysegtree; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_math as math; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_maxflow as maxflow; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_mincostflow as mincostflow; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_modint as modint; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_scc as scc; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_segtree as segtree; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_string as string; -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] pub extern crate __acl_twosat as twosat; // Crates like `num` re-export sub crates like this, but currently `cargo-simple-bundler` does not support inline modules. //pub mod twosat { -// #[cfg_attr(cargo_equip, cargo_equip::use_another_lib)] // extern crate __acl_twosat as twosat; // pub use self::twosat::*; //}