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.
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())); |
| 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.
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.
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())); |
| std::vector<std::vector<int>> problem_matrix_; | ||
|
|
||
| const core::int_t kMinInt = -32765; | ||
| const int kMaxInt = 32765; |
| 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.
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.
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.
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.
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.
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.