Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precision in solution file "all" #622

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

raller09
Copy link
Contributor

@raller09 raller09 commented Oct 4, 2023

Hi,

im testing with cbc solution files and my model.

Model.zip

CBC.exe "model.mps" 
-directory "%Temp%" 
-solve 
-printingOptions all -solution "all.cbc" 
-printingOptions allcsv -solution "allcsv.cbc"

with model.mps i want
y23 = 12345.670000

This is how cbc solves it.
But when I add the values ​​from x1 to x36 from "all.cbc", the result is 12345.66996

cbc uses
#define CLP_OUTPUT_FORMAT % 15.8g

I assume precision with "g" means:
Precision specifies the maximum number of significant digits output.
15 characters but only 8 significant digits.

Since the current format is certainly used by many, I have created an additional "allcsv" format in which the values ​​are separated by commas and "%.15g" is used.

Please check my changes.

I think the output could also be used for other outputs such as "normal" and "rows"?

Since pulp also uses the "all" format, I'm a little surprised that the accuracy there was sufficient.

Thank you for your great work.

@CLAassistant
Copy link

CLAassistant commented Oct 4, 2023

CLA assistant check
All committers have signed the CLA.

@svigerske svigerske requested a review from jjhforrest August 16, 2024 11:12
@jjhforrest
Copy link
Contributor

Fine by me.

src/CbcParameters.hpp Outdated Show resolved Hide resolved
@svigerske svigerske merged commit d1dbc98 into coin-or:master Oct 10, 2024
13 checks passed
@raller09 raller09 deleted the SolutionAllAsCsv branch October 10, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants