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

Function Documentation

bool Utils::containsConstraint(const arma::sp_mat &A, const arma::vec &b, const arma::sp_mat &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 (in a matrix form)

  • rhs – The input cut LHS

  • tol – A numerical tolerance

Returns

True if the constraint was found