StrassenHint

Trait StrassenHint 

Source
pub trait StrassenHint: RingBase {
    // Required method
    fn strassen_threshold(&self) -> usize;
}
Available on crate feature unstable-enable only.
Expand description

Trait to allow rings to customize the parameters with which StrassenAlgorithm will compute matrix multiplications.

§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§

Source

fn strassen_threshold(&self) -> usize

Define a threshold from which on StrassenAlgorithm will use the Strassen algorithm.

Concretely, when this returns k, StrassenAlgorithm will reduce the matrix multipliction down to 2^k x 2^k matrices using Strassen’s algorithm, and then use naive matmul for the rest.

The value is 0, but if the considered rings have fast multiplication (compared to addition), then setting this 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.

Implementors§