Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ext/crates/fp/src/matrix/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ impl AffineSubspace {
Self::new(offset, linear_part)
}

/// Whether the origin lies in this coset, equivalently whether it is a linear subspace.
///
/// The offset is kept reduced modulo the linear part (see [`AffineSubspace::new`]), so this
/// holds exactly when the stored offset is zero.
Comment on lines +37 to +40

@hoodmane hoodmane Jun 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Whether the origin lies in this coset, equivalently whether it is a linear subspace.
///
/// The offset is kept reduced modulo the linear part (see [`AffineSubspace::new`]), so this
/// holds exactly when the stored offset is zero.
/// Returns whether the coset contains zero

pub fn contains_zero(&self) -> bool {
self.offset.is_zero()
}

pub fn contains(&self, vector: FpSlice) -> bool {
let mut vector = vector.to_owned();
vector.add(&self.offset, vector.prime() - 1);
Expand Down
72 changes: 30 additions & 42 deletions ext/examples/benchmarks/massey-C2-P
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
massey -- C2 "" 26 12 "" 7 1 [1] 0 4 [1]
<a, b, x_(0, 0, 0)> = [1]
<a, b, x_(1, 1, 0)> = [1]
<a, b, x_(2, 1, 0)> = [1]
<a, b, x_(2, 2, 0)> = [1]
<a, b, x_(3, 1, 0)> = [1]
<a, b, x_(3, 2, 0)> = [1]
<a, b, x_(4, 3, 0)> = [1]
<a, b, x_(7, 1, 0)> = [1]
<a, b, x_(7, 2, 0)> = [1]
<a, b, x_(8, 2, 0)> = [1]
<a, b, x_(8, 3, 0)> = [1]
<a, b, x_(8, 4, 0)> = [1]
<a, b, x_(9, 2, 0)> = [1]
<a, b, x_(9, 3, 0)> = [0]
<a, b, x_(9, 3, 1)> = [1]
<a, b, x_(9, 4, 0)> = [1]
<a, b, x_(9, 5, 0)> = [1]
<a, b, x_(10, 3, 0)> = [1]
<a, b, x_(10, 4, 0)> = [1]
<a, b, x_(10, 5, 0)> = [1]
<a, b, x_(10, 6, 0)> = [1]
<a, b, x_(11, 5, 0)> = [1]
<a, b, x_(11, 6, 0)> = [1]
<a, b, x_(12, 7, 0)> = [1]
<a, b, x_(14, 4, 0)> = [1]
<a, b, x_(15, 1, 0)> = [1]
<a, b, x_(15, 3, 0)> = [1]
<a, b, x_(15, 5, 0)> = [1]
<a, b, x_(15, 6, 0)> = [1]
<a, b, x_(16, 2, 0)> = [0]
<a, b, x_(16, 5, 0)> = [1]
<a, b, x_(16, 6, 0)> = [1]
<a, b, x_(16, 7, 0)> = [1]
<a, b, x_(16, 8, 0)> = [1]
<a, b, x_(17, 4, 0)> = [1]
<a, b, x_(17, 6, 0)> = [1]
<a, b, x_(17, 7, 0)> = [1]
<a, b, x_(17, 8, 0)> = [1]
<a, b, x_(18, 2, 0)> = [1]
<a, b, x_(18, 3, 0)> = [0]
<a, b, x_(18, 7, 0)> = [1]
<a, b, x_(18, 8, 0)> = [1]
<a, b, x_(0, 0, [1])> = [1] + {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did the name of x change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used to only compute on basis elements, now we compute on a basis of the kernel of multiplication by b. Those don't have to be basis elements of the ambient space, so we display BidegreeElement instead of BidegreeGenerator.

We also now display the indeterminacy and remove those that contain 0, so there are some lines "missing"

<a, b, x_(1, 1, [1])> = [1] + {}
<a, b, x_(2, 1, [1])> = [1] + {}
<a, b, x_(2, 2, [1])> = [1] + {}
<a, b, x_(3, 1, [1])> = [1] + {}
<a, b, x_(3, 2, [1])> = [1] + {}
<a, b, x_(4, 3, [1])> = [1] + {}
<a, b, x_(7, 2, [1])> = [1] + {}
<a, b, x_(8, 3, [1])> = [1] + {}
<a, b, x_(8, 4, [1])> = [1] + {}
<a, b, x_(9, 3, [0, 1])> = [1] + {}
<a, b, x_(9, 4, [1])> = [1] + {}
<a, b, x_(9, 5, [1])> = [1] + {}
<a, b, x_(10, 4, [1])> = [1] + {}
<a, b, x_(10, 5, [1])> = [1] + {}
<a, b, x_(10, 6, [1])> = [1] + {}
<a, b, x_(11, 5, [1])> = [1] + {}
<a, b, x_(11, 6, [1])> = [1] + {}
<a, b, x_(12, 7, [1])> = [1] + {}
<a, b, x_(14, 4, [1])> = [1] + {}
<a, b, x_(15, 1, [1])> = [1] + {}
<a, b, x_(15, 3, [1])> = [1] + {}
<a, b, x_(15, 6, [1])> = [1] + {}
<a, b, x_(16, 5, [1])> = [1] + {}
<a, b, x_(16, 7, [1])> = [1] + {}
<a, b, x_(16, 8, [1])> = [1] + {}
<a, b, x_(17, 4, [1])> = [1] + {}
<a, b, x_(17, 7, [1])> = [1] + {}
<a, b, x_(17, 8, [1])> = [1] + {}
<a, b, x_(18, 8, [1])> = [1] + {}
84 changes: 41 additions & 43 deletions ext/examples/benchmarks/massey-Ceta-P
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
massey -- Ceta "" 26 12 "" 7 1 [1] 0 4 [1]
<a, b, x_(3, 1, 0)> = [1]
<a, b, x_(3, 2, 0)> = [1]
<a, b, x_(5, 1, 0)> = [1]
<a, b, x_(5, 2, 0)> = [1]
<a, b, x_(5, 3, 0)> = [1]
<a, b, x_(6, 2, 0)> = [1]
<a, b, x_(7, 1, 0)> = [1]
<a, b, x_(7, 2, 0)> = [1]
<a, b, x_(7, 3, 0)> = [1]
<a, b, x_(7, 4, 0)> = [1]
<a, b, x_(8, 2, 0)> = [1]
<a, b, x_(8, 3, 0)> = [1]
<a, b, x_(9, 2, 0)> = [0, 1]
<a, b, x_(9, 3, 0)> = [1]
<a, b, x_(9, 4, 0)> = [1]
<a, b, x_(9, 5, 0)> = [1]
<a, b, x_(11, 3, 0)> = [1]
<a, b, x_(11, 4, 0)> = [1]
<a, b, x_(11, 5, 0)> = [1]
<a, b, x_(11, 6, 0)> = [1]
<a, b, x_(13, 5, 0)> = [1]
<a, b, x_(13, 6, 0)> = [1]
<a, b, x_(13, 7, 0)> = [1]
<a, b, x_(14, 2, 0)> = [0]
<a, b, x_(14, 4, 0)> = [1]
<a, b, x_(14, 5, 0)> = [1]
<a, b, x_(14, 6, 0)> = [1]
<a, b, x_(15, 5, 0)> = [1]
<a, b, x_(15, 6, 0)> = [1]
<a, b, x_(15, 7, 0)> = [1]
<a, b, x_(15, 8, 0)> = [1]
<a, b, x_(16, 5, 0)> = [1]
<a, b, x_(16, 6, 0)> = [1]
<a, b, x_(16, 7, 0)> = [1]
<a, b, x_(17, 4, 0)> = [1, 0]
<a, b, x_(17, 5, 0)> = [1, 0]
<a, b, x_(17, 6, 0)> = [1, 0]
<a, b, x_(17, 6, 1)> = [0, 1]
<a, b, x_(17, 7, 0)> = [1]
<a, b, x_(17, 8, 0)> = [1]
<a, b, x_(18, 2, 0)> = [1]
<a, b, x_(18, 3, 0)> = [0]
<a, b, x_(18, 4, 0)> = [1]
<a, b, x_(3, 1, [1])> = [1] + {}
<a, b, x_(3, 2, [1])> = [1] + {}
<a, b, x_(5, 1, [1])> = [1] + {}
<a, b, x_(5, 2, [1])> = [1] + {}
<a, b, x_(5, 3, [1])> = [1] + {}
<a, b, x_(6, 2, [1])> = [1] + {}
<a, b, x_(7, 1, [1])> = [1] + {}
<a, b, x_(7, 2, [1])> = [1] + {}
<a, b, x_(7, 3, [1])> = [1] + {}
<a, b, x_(7, 4, [1])> = [1] + {}
<a, b, x_(8, 2, [1])> = [1] + {}
<a, b, x_(8, 3, [1])> = [1] + {}
<a, b, x_(9, 2, [1])> = [0, 1] + {}
<a, b, x_(9, 3, [1])> = [1] + {}
<a, b, x_(9, 4, [1])> = [1] + {}
<a, b, x_(9, 5, [1])> = [1] + {}
<a, b, x_(11, 3, [1])> = [1] + {}
<a, b, x_(11, 4, [1])> = [1] + {}
<a, b, x_(11, 5, [1])> = [1] + {}
<a, b, x_(11, 6, [1])> = [1] + {}
<a, b, x_(13, 5, [1])> = [1] + {}
<a, b, x_(13, 6, [1])> = [1] + {}
<a, b, x_(13, 7, [1])> = [1] + {}
<a, b, x_(14, 4, [1])> = [1] + {}
<a, b, x_(14, 5, [1])> = [1] + {}
<a, b, x_(14, 6, [1])> = [1] + {}
<a, b, x_(15, 5, [1])> = [1] + {}
<a, b, x_(15, 6, [1])> = [1] + {}
<a, b, x_(15, 7, [1])> = [1] + {}
<a, b, x_(15, 8, [1])> = [1] + {}
<a, b, x_(16, 5, [1])> = [1] + {}
<a, b, x_(16, 6, [1])> = [1] + {}
<a, b, x_(16, 7, [1])> = [1] + {}
<a, b, x_(17, 4, [1, 0])> = [1, 0] + {}
<a, b, x_(17, 5, [1, 0])> = [1, 0] + {}
<a, b, x_(17, 6, [1, 0])> = [1, 0] + {}
<a, b, x_(17, 6, [0, 1])> = [0, 1] + {}
<a, b, x_(17, 7, [1])> = [1] + {}
<a, b, x_(17, 8, [1])> = [1] + {}
<a, b, x_(18, 2, [1])> = [1] + {}
<a, b, x_(18, 4, [1])> = [1] + {}
72 changes: 33 additions & 39 deletions ext/examples/benchmarks/massey-S_2-P
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
massey -- S_2 "" 26 12 7 1 [1] 0 4 [1]
<a, b, x_(1, 1, 0)> = [1]
<a, b, x_(2, 2, 0)> = [1]
<a, b, x_(3, 1, 0)> = [1]
<a, b, x_(3, 2, 0)> = [1]
<a, b, x_(3, 3, 0)> = [1]
<a, b, x_(6, 2, 0)> = [1]
<a, b, x_(7, 1, 0)> = [1, 0]
<a, b, x_(7, 2, 0)> = [1]
<a, b, x_(7, 3, 0)> = [1]
<a, b, x_(7, 4, 0)> = [1]
<a, b, x_(8, 2, 0)> = [1]
<a, b, x_(8, 3, 0)> = [1]
<a, b, x_(9, 3, 0)> = [1]
<a, b, x_(9, 4, 0)> = [1]
<a, b, x_(9, 5, 0)> = [1]
<a, b, x_(10, 6, 0)> = [1]
<a, b, x_(11, 5, 0)> = [1]
<a, b, x_(11, 6, 0)> = [1]
<a, b, x_(11, 7, 0)> = [1]
<a, b, x_(14, 4, 0)> = [1]
<a, b, x_(14, 5, 0)> = [1]
<a, b, x_(14, 6, 0)> = [1]
<a, b, x_(15, 5, 0)> = [1, 0]
<a, b, x_(15, 5, 1)> = [0, 1]
<a, b, x_(15, 6, 0)> = [1]
<a, b, x_(15, 7, 0)> = [1]
<a, b, x_(15, 8, 0)> = [1]
<a, b, x_(16, 6, 0)> = [1]
<a, b, x_(16, 7, 0)> = [1]
<a, b, x_(17, 4, 0)> = [1]
<a, b, x_(17, 5, 0)> = [1]
<a, b, x_(17, 6, 0)> = [1]
<a, b, x_(17, 7, 0)> = [1]
<a, b, x_(17, 8, 0)> = [1]
<a, b, x_(18, 2, 0)> = [1]
<a, b, x_(18, 3, 0)> = [0]
<a, b, x_(18, 4, 0)> = [0]
<a, b, x_(18, 4, 1)> = [1]
<a, b, x_(18, 5, 0)> = [1]
<a, b, x_(1, 1, [1])> = [1] + {}
<a, b, x_(2, 2, [1])> = [1] + {}
<a, b, x_(3, 1, [1])> = [1] + {}
<a, b, x_(3, 2, [1])> = [1] + {}
<a, b, x_(3, 3, [1])> = [1] + {}
<a, b, x_(6, 2, [1])> = [1] + {}
<a, b, x_(7, 1, [1])> = [1, 0] + {}
<a, b, x_(7, 2, [1])> = [1] + {}
<a, b, x_(7, 3, [1])> = [1] + {}
<a, b, x_(7, 4, [1])> = [1] + {}
<a, b, x_(8, 3, [1])> = [1] + {}
<a, b, x_(9, 4, [1])> = [1] + {}
<a, b, x_(9, 5, [1])> = [1] + {}
<a, b, x_(10, 6, [1])> = [1] + {}
<a, b, x_(11, 5, [1])> = [1] + {}
<a, b, x_(11, 6, [1])> = [1] + {}
<a, b, x_(11, 7, [1])> = [1] + {}
<a, b, x_(14, 4, [1])> = [1] + {}
<a, b, x_(14, 5, [1])> = [1] + {}
<a, b, x_(14, 6, [1])> = [1] + {}
<a, b, x_(15, 5, [1, 0])> = [1, 0] + {}
<a, b, x_(15, 5, [0, 1])> = [0, 1] + {}
<a, b, x_(15, 6, [1])> = [1] + {}
<a, b, x_(15, 7, [1])> = [1] + {}
<a, b, x_(15, 8, [1])> = [1] + {}
<a, b, x_(16, 7, [1])> = [1] + {}
<a, b, x_(17, 4, [1])> = [1] + {}
<a, b, x_(17, 5, [1])> = [1] + {}
<a, b, x_(17, 6, [1])> = [1] + {}
<a, b, x_(17, 8, [1])> = [1] + {}
<a, b, x_(18, 2, [1])> = [1] + {}
<a, b, x_(18, 4, [0, 1])> = [1] + {}
<a, b, x_(18, 5, [1])> = [1] + {}
Loading
Loading