Skip to content

Commit e4dc8f8

Browse files
Merge pull request #19 from SoftVarE-Group/dpll-run-return
Export run results from functions
2 parents 71fb943 + 6adfb14 commit e4dc8f8

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/methods/Counter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "DpllStyleMethod.hpp"
2424
#include "nnf/Node.hpp"
2525
#include "src/exceptions/BadBehaviourException.hpp"
26+
#include "src/preprocs/PreprocManager.hpp"
2627
#include "src/problem/ProblemTypes.hpp"
2728

2829
namespace d4 {

src/methods/DpllStyleMethod.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,6 @@ class DpllStyleMethod : public MethodManager, public Counter<T> {
522522

523523
/**
524524
Run the DPLL style algorithm with the operation manager.
525-
526-
@param[in] config, the configuration.
527525
*/
528526
void run(Config &config) {
529527
std::vector<Var> setOfVar;
@@ -533,5 +531,15 @@ class DpllStyleMethod : public MethodManager, public Counter<T> {
533531
printFinalStats(m_out);
534532
m_operation->manageResult(result, config, m_out);
535533
} // run
534+
535+
/**
536+
Run the DPLL style algorithm and return the result.
537+
*/
538+
U run_and_return() {
539+
std::vector<Var> setOfVar;
540+
for (int i = 1; i <= m_specs->getNbVariable(); i++) setOfVar.push_back(i);
541+
542+
return compute(setOfVar, m_out);
543+
} // run
536544
};
537545
} // namespace d4

src/methods/ProjMCMethod.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,5 +672,12 @@ class ProjMCMethod : public MethodManager {
672672
printFinalStats(m_out);
673673
std::cout << "s " << res << "\n";
674674
} // run
675+
676+
/**
677+
Run the DPLL style algorithm and return the result.
678+
*/
679+
T run_and_return() {
680+
return compute(m_out);
681+
} // run
675682
};
676683
} // namespace d4

0 commit comments

Comments
 (0)