 |
Open Graph Drawing Framework |
v. 2022.02 (Dogwood)
|
|
|
Go to the documentation of this file.
95 void addMultiple (
int Amount, ... );
100 for (
int i = 0; i < m_ps.
size(); i++ )
113 for (
int i = 0; i < m_ps.
size(); i++) {
118 std::cout <<
"Variable not in Clause" << std::endl;
128 for (
int i = 0; i < m_ps.
size(); i++ )
131 m_ps.
push( help[i] );
140 if (
sign(lit) == 0 )
148 for (
int i = 0; i < m_ps.
size() - 1; i++ )
149 std::cout << convertLitSign( m_ps[i] ) <<
Internal::var(m_ps[i]) + 1 <<
" || ";
150 std::cout << convertLitSign( m_ps[ m_ps.
size() - 1 ] ) <<
Internal::var(m_ps[m_ps.
size() - 1]) + 1 << std::endl;
182 return m_vModel[
var-1] != 0;
190 m_vModel.reserve( S.
model.size() );
191 for (
int i = 0; i < S.
model.size() ; i++ )
199 for (
int i = 0; i < (int)m_vModel.size(); i++ )
201 std::cout <<
"Var " << i <<
" = " << m_vModel[i] <<
" ";
203 std::cout << std::endl;
255 for (
unsigned int i = 0; i < Count; i++ )
269 void finalizeClause(
const clause cl );
272 template<
class Iteratable>
275 auto cl = newClause();
276 for (
auto literal : literals) {
287 bool finalizeNotExtensibleClause (
const clause cl );
290 Clause *getClause (
const int pos );
293 void removeClause(
int i );
304 return (
int)m_Clauses.size();
318 bool solve(
Model &ReturnModel );
326 bool solve(
Model &ReturnModel,
double& timeLimit );
337 removeClause( clausePos );
338 m_Clauses[clausePos]->add(signedVar);
339 Solver::addClause( m_Clauses[clausePos]->m_ps );
346 bool readDimacs(
const char *filename);
349 bool readDimacs(
const string &filename);
352 bool readDimacs(std::istream &in);
355 bool writeDimacs(
const char *filename);
358 bool writeDimacs(
const string &filename);
361 bool writeDimacs(std::ostream &f);
Internal::vec< Internal::Lit > m_ps
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Internal::Solver::SolverStatus solverStatus
void add(Internal::Var signedVar)
adds a literal to the clause
void setModel(Internal::Solver &S)
sets the model to the model of minsat
void copyTo(vec< T > ©) const
Clause(const Clause &src)
void setSign(Internal::Var x, bool sign)
sets the sign of a variable if its present within the clause
std::vector< int > m_vModel
internal storage of a model by minisat
bool getValue(int var) const
returns the value of the assignemt of a variable in the model
Represents a simple class for model storage.
static char convertLitSign(Internal::Lit lit)
converts the sign of a lit into char
bool getSign(Internal::Var x)
returns the sign of a variable if its present within the clause, if the variable is not representet f...
Represents a simple class for clause storage.
Basic declarations, included by all source files.
void clear(bool dealloc=false)
Lit mkLit(Var var, bool sign=false)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
std::string intToString(const int i)
void removeLit(Internal::Var x)