-
Notifications
You must be signed in to change notification settings - Fork 1
Testing presolve #8
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
base: main
Are you sure you want to change the base?
Conversation
| } else { | ||
| num_variables_string = temp_string; | ||
| } | ||
| const int num_variables = static_cast<int>(atoi(num_variables_string.c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atoi returns int anyways, no need to typecast
| const core::int_t num_inequality_rows = static_cast<core::int_t>(atoi(num_inequality_rows_string.c_str())); | ||
| // Get number of inequalities. | ||
| std::getline(problems_filestream, num_inequality_rows_string); | ||
| const int num_inequality_rows = static_cast<int>(atoi(num_inequality_rows_string.c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typecasting
| std::vector<core::int_t> matrix_row; | ||
| // Define vectors to read in constraints. | ||
| std::vector<int> problem_row; // A line in the input file | ||
| int constant_term; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do? naming isn't clear? Also a bit misleading since constant implies unchanging but this variable is reassigned a few times?
| matrix_row.clear(); | ||
|
|
||
| problem_matrix_.push_back(problem_matrix_row); | ||
| upper_bounds_.push_back(kMaxInt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switching to core::kIntInfinity. Works better algebraically and theoretically
|
|
||
| core::int_t num_equality_rows = static_cast<core::int_t>(atoi(num_equality_rows_string.c_str())); | ||
| std::getline(problems_filestream, num_equality_rows_string); | ||
| int num_equality_rows = static_cast<int>(atoi(num_equality_rows_string.c_str())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typecasting
| std::vector<std::vector<int>> problem_matrix_; | ||
|
|
||
| const core::int_t kMinInt = -32765; | ||
| const int kMaxInt = 32765; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove these
| std::vector<core::int_t> convertStringToVector(const std::string vector_string); | ||
| std::vector<int> convertStringToVector(const std::string vector_string); | ||
|
|
||
| std::vector<int> getProblemRowAsIntVector(const std::string problem_row_string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
documentation/docstrings?
| std::vector<core::int_t> min = reader_.lower_bounds_; | ||
| for (int i = 0; i < problem_matrix.size(); ++i) { | ||
| std::string upper_bound = std::to_string(upper_bounds[i]); | ||
| if (upper_bound == "32765") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be changed once upper bounds are of type core::kIntInfinity
| for (int row_num = 0; row_num < num_rows; ++row_num) { | ||
| // Getting row, constant term and bounds for the row. | ||
| std::vector<int> row = problem_matrix[row_num]; | ||
| int constant_term = row[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this never seems to be used?
| int lower_bound = lower_bounds[row_num]; | ||
| int upper_bound; | ||
|
|
||
| if (upper_bounds[row_num] == 32765) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to core::kIntInfinity
| cmake_minimum_required(VERSION 3.12.0) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 14) | ||
| set(CMAKE_CXX_STANDARD 11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They just released the preview for C++ 23 at the end of last year. C++ 14 is already quite old, why do we need to change it to C++11?
No description provided.