Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush committed Apr 23, 2021
1 parent afdb17a commit a222ced
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions relations/src/r1cs/constraint_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,15 @@ impl<F: Field> ConstraintSystem<F> {
/// Optimize the constraint system (either by outlining or inlining,
/// if an optimization goal is set).
pub fn optimize(&mut self) {
match self.optimization_goal {
OptimizationGoal::None => self.inline_all_lcs(),
OptimizationGoal::Constraints => self.inline_all_lcs(),
OptimizationGoal::Weight => self.outline_lcs(),
};
// In verify mode we don't have any linear combinations; all variables
// are instance variables, and there are no generated constraints
if !self.is_in_verify_mode() {
match self.optimization_goal {
OptimizationGoal::None => self.inline_all_lcs(),
OptimizationGoal::Constraints => self.inline_all_lcs(),
OptimizationGoal::Weight => self.outline_lcs(),
};
}
}

/// This step must be called after constraint generation has completed, and
Expand Down

0 comments on commit a222ced

Please sign in to comment.