cplexlpcompare
Compares two LP files created in cplex format and dumps differences to files.
|
Handles command line arguments and has the main method. More...
#include <vector>
#include <iostream>
#include "LPModel.h"
#include <boost/range/algorithm/set_algorithm.hpp>
#include <chrono>
#include <boost/program_options.hpp>
Go to the source code of this file.
Macros | |
#define | TIMING |
#define | INIT_TIMER auto start = std::chrono::high_resolution_clock::now() |
#define | START_TIMER start = std::chrono::high_resolution_clock::now() |
#define | STOP_TIMER() |
#define | STOP_TIMER_SEC() (STOP_TIMER() / 60) |
Functions | |
template<typename T > | |
void | printCounts (std::string detail_name, std::vector< T > &vec, std::vector< T > &vecother) |
Prints count of a given detail for both models, including differences. More... | |
template<> | |
void | printCounts (std::string detail_name, std::vector< lpcompare::Bound > &vec, std::vector< lpcompare::Bound > &vecother) |
printCounts specialization for Bounds, which will be sorted before set operations. More... | |
template<> | |
void | printCounts (std::string detail_name, std::vector< lpcompare::Constraint > &vec, std::vector< lpcompare::Constraint > &vecother) |
printCounts specialization for Constraints, which will be sorted before set operations. More... | |
template<typename T > | |
void | printCountsWithSort (std::string name, std::vector< T > &vec, std::vector< T > &vecother) |
Prints count of a given detail for both models, including differences. More... | |
void | printStats (LPModel *model) |
Prints statistics for a model. More... | |
template<typename T > | |
void | dumpdiff_if_requested (std::string detail_name, std::vector< T > &set1Except2, std::vector< T > &set2Except1) |
Dumps diffs to a file if dumping is requested. More... | |
void | setup_options (int argc, char *argv[]) |
Parses program arguments using boost program_options. More... | |
std::string | get_dump_filename (std::string model, std::string detail) |
Creates a filename to dump differences into. More... | |
bool | is_diffdumps_requested () |
Checks if diff dumps are requested. More... | |
int | main (int argc, char *argv[]) |
Variables | |
std::string | first_filename |
Filename of the first LP model. More... | |
std::string | second_filename |
Filename of the second LP model. More... | |
po::variables_map | vm |
Variable map for boost::program_options. More... | |
Handles command line arguments and has the main method.
Definition in file lpcompare.cpp.
#define INIT_TIMER auto start = std::chrono::high_resolution_clock::now() |
Definition at line 36 of file lpcompare.cpp.
#define START_TIMER start = std::chrono::high_resolution_clock::now() |
Definition at line 37 of file lpcompare.cpp.
#define STOP_TIMER | ( | ) |
Definition at line 38 of file lpcompare.cpp.
#define STOP_TIMER_SEC | ( | ) | (STOP_TIMER() / 60) |
Definition at line 42 of file lpcompare.cpp.
#define TIMING |
Definition at line 33 of file lpcompare.cpp.
void dumpdiff_if_requested | ( | std::string | detail_name, |
std::vector< T > & | set1Except2, | ||
std::vector< T > & | set2Except1 | ||
) |
Dumps diffs to a file if dumping is requested.
set1Except2 | List of elements that are in the first model but not in the second model. |
set2Except1 | List of elements that are in the second model but not in the first model. |
Definition at line 215 of file lpcompare.cpp.
std::string get_dump_filename | ( | std::string | model, |
std::string | detail | ||
) |
Creates a filename to dump differences into.
model | Model name. |
detail | Model detail. |
Definition at line 132 of file lpcompare.cpp.
bool is_diffdumps_requested | ( | ) |
Checks if diff dumps are requested.
Definition at line 141 of file lpcompare.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
void printCounts | ( | std::string | detail_name, |
std::vector< T > & | vec, | ||
std::vector< T > & | vecother | ||
) |
Prints count of a given detail for both models, including differences.
detail_name | Given name of the detail. |
vec | List of elements that are in the first model. |
vecother | List of elements that are in the second model. |
Definition at line 271 of file lpcompare.cpp.
void printCounts | ( | std::string | detail_name, |
std::vector< lpcompare::Bound > & | vec, | ||
std::vector< lpcompare::Bound > & | vecother | ||
) |
printCounts specialization for Bounds, which will be sorted before set operations.
detail_name | Given name of the detail. |
vec | List of elements that are in the first model. |
vecother | List of elements that are in the second model. |
Definition at line 384 of file lpcompare.cpp.
void printCounts | ( | std::string | detail_name, |
std::vector< lpcompare::Constraint > & | vec, | ||
std::vector< lpcompare::Constraint > & | vecother | ||
) |
printCounts specialization for Constraints, which will be sorted before set operations.
detail_name | Given name of the detail. |
vec | List of elements that are in the first model. |
vecother | List of elements that are in the second model. |
Definition at line 371 of file lpcompare.cpp.
void printCountsWithSort | ( | std::string | name, |
std::vector< T > & | vec, | ||
std::vector< T > & | vecother | ||
) |
Prints count of a given detail for both models, including differences.
Performs in-place sorting of vec and vecother.
detail_name | Given name of the detail. |
vec | List of elements that are in the first model. |
vecother | List of elements that are in the second model. |
Definition at line 304 of file lpcompare.cpp.
void printStats | ( | LPModel * | model | ) |
void setup_options | ( | int | argc, |
char * | argv[] | ||
) |
Parses program arguments using boost program_options.
argc | argument count. |
argv | argument list. |
Definition at line 89 of file lpcompare.cpp.
std::string first_filename |
Filename of the first LP model.
Definition at line 78 of file lpcompare.cpp.
std::string second_filename |
Filename of the second LP model.
Definition at line 79 of file lpcompare.cpp.
po::variables_map vm |
Variable map for boost::program_options.
Definition at line 81 of file lpcompare.cpp.