#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum PbAlgorithm {
Swc,
BinaryMerge,
AdderNetworks,
Best,
}
#[derive(Clone, Eq, PartialEq, Debug)]
pub struct PbConfig {
pub pb_algorithm: PbAlgorithm,
pub binary_merge_use_gac: bool,
pub binary_merge_no_support_for_single_bit: bool,
pub binary_merge_use_watch_dog: bool,
}
impl Default for PbConfig {
fn default() -> Self {
Self::new()
}
}
impl PbConfig {
pub const fn new() -> Self {
Self {
pb_algorithm: PbAlgorithm::Best,
binary_merge_use_gac: true,
binary_merge_no_support_for_single_bit: false,
binary_merge_use_watch_dog: true,
}
}
#[must_use]
pub const fn pb_encoder(mut self, pb_encoder: PbAlgorithm) -> Self {
self.pb_algorithm = pb_encoder;
self
}
#[must_use]
pub const fn binary_merge_use_gac(mut self, binary_merge_use_gac: bool) -> Self {
self.binary_merge_use_gac = binary_merge_use_gac;
self
}
#[must_use]
pub const fn binary_merge_no_support_for_single_bit(mut self, binary_merge_no_support_for_single_bit: bool) -> Self {
self.binary_merge_no_support_for_single_bit = binary_merge_no_support_for_single_bit;
self
}
#[must_use]
pub const fn binary_merge_use_watch_dog(mut self, binary_merge_use_watch_dog: bool) -> Self {
self.binary_merge_use_watch_dog = binary_merge_use_watch_dog;
self
}
}