pub trait KaratsubaHint: RingBase {
// Required method
fn karatsuba_threshold(&self) -> usize;
}
unstable-enable
only.Expand description
Trait to allow rings to customize the parameters with which KaratsubaAlgorithm
will
compute convolutions over the ring.
§Availability
This API is marked as unstable and is only available when the unstable-enable
crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.
Required Methods§
Sourcefn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Define a threshold from which on KaratsubaAlgorithm
will use the Karatsuba algorithm.
Concretely, when this returns k
, KaratsubaAlgorithm
will reduce the
convolution down to ones on slices of size 2^k
, and compute their convolution naively. The default
value is 0
, but if the considered rings have fast multiplication (compared to addition), then setting
it higher may result in a performance gain.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.