-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
R1CS: Add
constraints_len
, deferred_constraints_len
and `total_co…
…nstraints_len` (#322) * Add Metrics struct Add Metrics struct to count the different kinds of constraints, which comes in handy when developing and benchmarking larger circuits. This deprecates and removes the `multipliers_len()` method. * Add documentation for the new Metrics struct Co-authored-by: Oleg Andreev <oleganza@gmail.com> Co-authored-by: Oleg Andreev <oleganza@gmail.com>
- Loading branch information
Showing
5 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// A struct that contains metrics about a constraint system. | ||
/// | ||
/// See [`ConstraintSystem::metrics`](::r1cs::ConstraintSystem::metrics). | ||
#[derive(Debug, Clone)] | ||
pub struct Metrics { | ||
/// Number of multiplicative constraints in the constraint system. | ||
pub multipliers: usize, | ||
/// Total number of linear constraints in the constraint system. | ||
pub constraints: usize, | ||
/// Number of linear constraints added in pre-randomization phase. | ||
pub phase_one_constraints: usize, | ||
/// Number of linear constraints added in the randomization phase. | ||
pub phase_two_constraints: usize, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters