-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unexpected exception #75
Comments
Thanks for the bug report. Unfortunately I cannot reproduce it, compiling and running #include "mp/nl.h"
#include <iostream>
struct DimensionPrinter : mp::NLHandler<int> {
void OnHeader(const mp::NLHeader &h) {
fmt::print("Variables: {}\n", h.num_vars);
fmt::print("Constraints: {}\n", h.num_algebraic_cons);
fmt::print("Nonzeros: {}\n", h.num_con_nonzeros);
}
};
int main() {
std::string filename = std::string("FinalPosture.nl");
DimensionPrinter printer;
try {
mp::ReadNLFile(filename, printer);
} catch (const std::exception &exc) {
std::cerr << exc.what();
}
} gives
on your .nl file. Are you using the latest version of the library from the repo? |
Yes, it is the latest version. |
Hi, here a project you can open with Qt creator. It is a simple form with a push button. Could you replicate the error? Please let me know. Thank you very much. |
No, I still can't replicate an exception. I get the same output as before when clicking PushButton:
|
Moreover, I get the same result even without recompiling |
Yes, quite weird. Could you replace line 1066 of ReportError("expected double"); with the following ReportError("expected double: '{}' {} {}", fmt::StringRef(ptr_, 10),
static_cast<const void*>(ptr_), static_cast<const void*>(end)); recompile, rerun and post the output? This might shed some light on what's going on. |
One possible explanation for this is that setlocale(LC_NUMERIC, "C"); |
Great, thanks for the confirmation. I think a better solution is to replace |
Hi Victor, I'll be waiting for your update. Meanwhile I put export LC_NUMERIC="C" Thank you again. On 27-01-2016 01:03, Victor Zverovich wrote:
Gianpaolo Gulletta |
Fixed in 1028153 and two commits after it which implement MSVC compatibility. Thanks again for reporting! |
Hi I have a weird problem.
I have the attached nl file I want to read.
I successfully run the nl-exampl.cc but when I run the following code in my own library:
I get the following exception:
FinalPosture.nl:22677:5: expected double.
Please what does it mean? How can I solve the problem?
Thank you.
FinalPosture.nl.zip
The text was updated successfully, but these errors were encountered: