Skip to main content

method_vector_algebra

Function method_vector_algebra 

Source
pub fn method_vector_algebra(
    left: &MethodProfile,
    right: &MethodProfile,
) -> MethodVectorAlgebraReport
Expand description

Computes the shipped vector-algebra helper values for two methods.

This helper exists for behaviour tests that need to observe the runtime dot_product and norm_squared results without widening the production decomposition API.

§Examples

use whitaker_common::test_support::decomposition::{MethodInput, method_vector_algebra, profile};

let left = profile(MethodInput {
    name: "parse_tokens",
    fields: &["grammar"],
    signature_types: &[],
    local_types: &[],
    domains: &[],
});
let right = profile(MethodInput {
    name: "save_to_disk",
    fields: &[],
    signature_types: &[],
    local_types: &["PathBuf"],
    domains: &["std::fs"],
});

let report = method_vector_algebra(&left, &right);
assert_eq!(report.left_dot_right(), 0);