79 lit = Internal::mkLit(
signedVar - 1,
true);
81 lit = Internal::mkLit(-(
signedVar + 1),
false);
94 for (
int i = 0; i < m_ps.
size(); i++) {
95 if (Internal::var(m_ps[i]) == x) {
96 m_ps[i] = Internal::mkLit(x, sign);
105 for (
int i = 0; i < m_ps.
size(); i++) {
106 if (Internal::var(m_ps[i]) == x) {
107 return Internal::sign(m_ps[i]);
110 std::cout <<
"Variable not in Clause" << std::endl;
119 for (
int i = 0; i < m_ps.
size(); i++) {
120 if (Internal::var(m_ps[i]) != x) {
128 if (sign(lit) == 0) {
136 for (
int i = 0; i < m_ps.
size() - 1; i++) {
137 std::cout << convertLitSign(m_ps[i]) << Internal::var(m_ps[i]) + 1 <<
" || ";
139 std::cout << convertLitSign(m_ps[m_ps.
size() - 1])
140 << Internal::var(m_ps[m_ps.
size() - 1]) + 1 << std::endl;
168 return m_vModel[var - 1] != 0;
175 m_vModel.reserve(
S.model.size());
176 for (
int i = 0; i <
S.model.size(); i++) {
177 m_vModel.push_back(Internal::toInt(
S.model[i]));
182 for (
int i = 0; i < (
int)m_vModel.size(); i++) {
183 std::cout <<
"Var " << i <<
" = " << m_vModel[i] <<
" ";
185 std::cout << std::endl;
231 for (
unsigned int i = 0; i <
Count; i++) {
249 template<
class Iteratable>
251 auto cl = newClause();
302 Solver::addClause(m_Clauses[
clausePos]->m_ps);
Basic declarations, included by all source files.
Represents a simple class for clause storage.
static char convertLitSign(Internal::Lit lit)
converts the sign of a lit into char
Internal::vec< Internal::Lit > m_ps
void addMultiple(int Amount,...)
add multiple literals to the clause
void setSign(Internal::Var x, bool sign)
sets the sign of a variable if its present within the clause
void removeLit(Internal::Var x)
bool getSign(Internal::Var x)
returns the sign of a variable if its present within the clause, if the variable is not representet f...
void add(Internal::Var signedVar)
adds a literal to the clause
Clause(const Clause &src)
void clear(bool dealloc=false)
void copyTo(vec< T > ©) const
Represents a simple class for model storage.
bool getValue(int var) const
returns the value of the assignemt of a variable in the model
Internal::Solver::SolverStatus solverStatus
void setModel(Internal::Solver &S)
sets the model to the model of minsat
std::string intToString(const int i)
std::vector< int > m_vModel
internal storage of a model by minisat
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()