#include <constraint.hpp>
Definition at line 153 of file constraint.hpp.
◆ ConstraintPtr
◆ PolyPtrSet
◆ ConstraintSystem()
gadgetlib2::ConstraintSystem::ConstraintSystem |
( |
| ) |
|
|
inline |
◆ addConstraint() [1/2]
Definition at line 208 of file constraint.cpp.
211 ::std::shared_ptr<Constraint>(
new PolynomialConstraint(c)));
◆ addConstraint() [2/2]
void gadgetlib2::ConstraintSystem::addConstraint |
( |
const Rank1Constraint & |
c | ) |
|
Definition at line 202 of file constraint.cpp.
205 ::std::shared_ptr<Constraint>(
new Rank1Constraint(c)));
◆ annotation()
string gadgetlib2::ConstraintSystem::annotation |
( |
| ) |
const |
Definition at line 225 of file constraint.cpp.
229 retVal += (*i)->annotation() +
'\n';
◆ getConstraint()
ConstraintPtr gadgetlib2::ConstraintSystem::getConstraint |
( |
size_t |
idx | ) |
|
|
inline |
◆ getConstraintPolynomials()
PolyPtrSet gadgetlib2::ConstraintSystem::getConstraintPolynomials |
( |
| ) |
const |
|
inline |
Required for interfacing with BREX. Should be optimized in the future.
Definition at line 180 of file constraint.hpp.
184 retset.insert(::std::unique_ptr<Polynomial>(
185 new Polynomial(pConstraint->asPolynomial())));
◆ getNumberOfConstraints()
size_t gadgetlib2::ConstraintSystem::getNumberOfConstraints |
( |
| ) |
|
|
inline |
◆ getUsedVariables()
Variable::set gadgetlib2::ConstraintSystem::getUsedVariables |
( |
| ) |
const |
Definition at line 234 of file constraint.cpp.
238 const Variable::set curSet = pConstraint->getUsedVariables();
239 retSet.insert(curSet.begin(), curSet.end());
◆ isSatisfied()
Checks if all constraints are satisfied by an assignment.
@param[in] assignment - An assignment of field elements for each
variable.
- Parameters
-
[in] | printOnFail | - when set to true, an unsatisfied constraint will print to stderr information explaining why it is not satisfied. |
- Returns
- true if constraint is satisfied by the assignment
Definition at line 214 of file constraint.cpp.
◆ GadgetLibAdapter
◆ constraintsPtrs_
::std::vector<ConstraintPtr> gadgetlib2::ConstraintSystem::constraintsPtrs_ |
|
protected |
The documentation for this class was generated from the following files:
- /home/runner/work/libsnark/libsnark/libsnark/gadgetlib2/constraint.hpp
- /home/runner/work/libsnark/libsnark/libsnark/gadgetlib2/constraint.cpp