Skip to content

Commit

Permalink
Follow general output precision in DFT approximation (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
volkm authored Jun 3, 2024
1 parent 4b02abf commit a1a51da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
6 changes: 2 additions & 4 deletions src/storm-dft/modelchecker/DFTModelChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,11 @@ typename DFTModelChecker<ValueType>::dft_results DFTModelChecker<ValueType>::che
"Under-approximation " << approxResult.first << " is greater than over-approximation " << approxResult.second);
totalTimer.stop();
if (printInfo && dftIOSettings.isShowDftStatisticsSet()) {
std::cout << "Result after iteration " << (iteration + 1) << ": (" << std::setprecision(10) << approxResult.first << ", " << approxResult.second
<< ")\n";
std::cout << "Result after iteration " << (iteration + 1) << ": (" << approxResult.first << ", " << approxResult.second << ")\n";
printTimings();
std::cout << '\n';
} else {
STORM_LOG_DEBUG("Result after iteration " << (iteration + 1) << ": (" << std::setprecision(10) << approxResult.first << ", "
<< approxResult.second << ")");
STORM_LOG_DEBUG("Result after iteration " << (iteration + 1) << ": (" << approxResult.first << ", " << approxResult.second << ")");
}

totalTimer.start();
Expand Down
12 changes: 8 additions & 4 deletions src/storm/utility/initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ void initializeLogger() {
sink->setFormatter(fptr);
}

/*!
* Set number of digits for printing output.
* @param digits Number of digits to print.
*/
void setOutputDigits(int digits) {
std::cout.precision(digits);
}

void setUp() {
initializeLogger();
setOutputDigits(10);
Expand All @@ -30,10 +38,6 @@ void cleanUp() {
// Intentionally left empty.
}

void setOutputDigits(int digits) {
std::cout.precision(digits);
}

void setOutputDigitsFromGeneralPrecision(double precision) {
if (precision >= 1 || precision < 0) {
setOutputDigits(10);
Expand Down
6 changes: 0 additions & 6 deletions src/storm/utility/initialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ void setUp();
*/
void cleanUp();

/*!
* Set number of digits for printing output.
* @param digits Number of digits to print.
*/
void setOutputDigits(int digits);

/*!
* Set number of digits for printing output from given precision requirement.
* For a precision of 1e-n we output at least n digits.
Expand Down

0 comments on commit a1a51da

Please sign in to comment.