 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
53 #pragma GCC visibility push(default)
97 void addMultiple(
int Amount, ...);
101 for (
int i = 0; i < m_ps.
size(); i++) {
112 for (
int i = 0; i < m_ps.
size(); i++) {
117 std::cout <<
"Variable not in Clause" << std::endl;
126 for (
int i = 0; i < m_ps.
size(); i++) {
135 if (
sign(lit) == 0) {
143 for (
int i = 0; i < m_ps.
size() - 1; i++) {
144 std::cout << convertLitSign(m_ps[i]) <<
Internal::var(m_ps[i]) + 1 <<
" || ";
146 std::cout << convertLitSign(m_ps[m_ps.
size() - 1])
175 return m_vModel[
var - 1] != 0;
182 m_vModel.reserve(S.
model.size());
183 for (
int i = 0; i < S.
model.size(); i++) {
189 for (
int i = 0; i < (int)m_vModel.size(); i++) {
190 std::cout <<
"Var " << i <<
" = " << m_vModel[i] <<
" ";
192 std::cout << std::endl;
238 for (
unsigned int i = 0; i < Count; i++) {
253 void finalizeClause(
const clause cl);
256 template<
class Iteratable>
258 auto cl = newClause();
259 for (
auto literal : literals) {
270 bool finalizeNotExtensibleClause(
const clause cl);
273 Clause* getClause(
const int pos);
276 void removeClause(
int i);
292 bool solve(
Model& ReturnModel);
300 bool solve(
Model& ReturnModel,
double& timeLimit);
307 removeClause(clausePos);
308 m_Clauses[clausePos]->add(signedVar);
309 Solver::addClause(m_Clauses[clausePos]->m_ps);
316 bool readDimacs(
const char* filename);
319 bool readDimacs(
const string& filename);
322 bool readDimacs(std::istream& in);
325 bool writeDimacs(
const char* filename);
328 bool writeDimacs(
const string& filename);
331 bool writeDimacs(std::ostream& f);
336 #pragma GCC visibility pop
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 dynamic library (shared object / DLL),...
std::string intToString(const int i)
void removeLit(Internal::Var x)