Function Utils::containsConstraint(const arma::sp_mat&, const arma::vec&, const arma::vec&, const double&, const double)

Function Documentation

bool Utils::containsConstraint(const arma::sp_mat &A, const arma::vec &b, const arma::vec &lhs, const double &rhs, const double tol = 1e-6)

Given a matrix A and a vector of LHSs b, checks if both lhs is in A, and rhs is in b up to a tolerance of tol.

Parameters
  • A – The matrix containing the constraints

  • b – The vector containing the RHSs

  • lhs – The input cut RHS

  • rhs – The input cut LHS

  • tol – A numerical tolerance

Returns

True if the constraint was found