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

Interface LinearForm

compressed_sigma/src/transforms.rs:6–18  ·  view source on GitHub ↗

For a linear form, i.e. for a form `L` and a vector `x` of size `n`, `L(x) = a_0*x_0 + a_1*x_1 + ... + a_n*x_n` for constants `a_0`, `a_1`, etc

Source from the content-addressed store, hash-verified

4/// For a linear form, i.e. for a form `L` and a vector `x` of size `n`, `L(x) = a_0*x_0 + a_1*x_1 + ... + a_n*x_n`
5/// for constants `a_0`, `a_1`, etc
6pub trait LinearForm<F: Field>: Sized {
7 fn eval(&self, x: &[F]) -> F;
8
9 fn scale(&self, scalar: &F) -> Self;
10
11 fn add(&self, other: &Self) -> Self;
12
13 fn split_in_half(&self) -> (Self, Self);
14
15 fn size(&self) -> usize;
16
17 fn pad(&self, new_size: u32) -> Self;
18}
19
20/// For a group homomorphism, i.e. for a function `f` and vectors `x` and `y`, `f(x+y) = f(x)*f(y)`
21pub trait Homomorphism<F: Field>: Sized {

Callers

nothing calls this directly

Implementers 1

amortized_linear_form.rscompressed_sigma/src/amortized_linear_

Calls

no outgoing calls

Tested by

no test coverage detected