MCPcopy Create free account
hub / github.com/docknetwork/crypto / weighted_norm

Function weighted_norm

utils/src/ff.rs:63–65  ·  view source on GitHub ↗

Weighted inner product of the vector `n` with itself. Calculated as `\sum_{i=0}(n_i * n_i * w^{i+1})`

(n: &[F], w: &F)

Source from the content-addressed store, hash-verified

61
62/// Weighted inner product of the vector `n` with itself. Calculated as `\sum_{i=0}(n_i * n_i * w^{i+1})`
63pub fn weighted_norm<F: Field>(n: &[F], w: &F) -> F {
64 weighted_inner_product(n, n, w)
65}
66
67pub fn non_zero_random<F: Field, R: Rng>(rng: &mut R) -> F {
68 let mut r = F::rand(rng);

Callers 4

newMethod · 0.85
compute_vMethod · 0.85

Calls 1

weighted_inner_productFunction · 0.85

Tested by 1