Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/PowerTools++/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Model {
void update_hess_link();
var_* getVar(int vid);
void delVar(var_* v);
void addConstraint(Constraint c);
void addConstraint(const Constraint& c);
void addConstraint(Constraint* c);
void on_off(Constraint c, var<bool>& on);
void on_off(var<>& v, var<bool>& on);
Expand Down
2 changes: 1 addition & 1 deletion include/PowerTools++/PTSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ class PTSolver {
/* Destructor */
~PTSolver();

int run(int output, bool relax);
int run(int output, bool relax, int print_lvl=5);
};
#endif /* defined(__PowerTools____Solver__) */
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ find_library(BLAS_LIBRARIES NAMES blas coinblas PATHS ENV LIBRARY_PATH)
find_library(LAPACK_LIBRARIES NAMES lapack coinlapack PATHS ENV LIBRARY_PATH)
find_library(MUMPS_LIBRARIES NAMES coinmumps PATHS ENV LIBRARY_PATH)
add_library(PowerTools++ ${SOURCES} ${HEADERS})
target_link_libraries(PowerTools++ ${GUROBI_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${IPOPT_LIBRARIES} dl coinhsl coinmetis ${MUMPS_LIBRARIES})
target_link_libraries(PowerTools++ ${GUROBI_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${IPOPT_LIBRARIES} dl)


add_executable(PowerTools main.cpp)
Expand Down
2 changes: 1 addition & 1 deletion src/IpoptProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void IpoptProgram::finalize_solution( Ipopt::SolverReturn statu
}
// model->check_feasible(x);
model->_opt = model->_obj->eval(x);
cout << "\n************** Objective Function Value = " << model->_opt << " **************" << endl;
//cout << "\n************** Objective Function Value = " << model->_opt << " **************" << endl;
}

bool IpoptProgram::get_bounds_info(Index n, Number* x_l, Number* x_u,
Expand Down
2 changes: 1 addition & 1 deletion src/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void Model::delVar(var_* v){
assert(false);
};

void Model::addConstraint(Constraint c_){
void Model::addConstraint(const Constraint &c_){
Constraint* c = new Constraint(c_);
_cons.push_back(c);
c->set_idx(_idx_con++);
Expand Down
6 changes: 4 additions & 2 deletions src/PTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void PTSolver::set_model(Model* m) {
}


int PTSolver::run(int output, bool relax){
int PTSolver::run(int output, bool relax, int print_lvl){
//GurobiProgram* grbprog;
// Initialize the IpoptApplication and process the options

Expand All @@ -89,7 +89,9 @@ int PTSolver::run(int output, bool relax){
// iapp.Options()->SetNumericValue("tol", 1e-6);
// iapp->Options()->SetStringValue("derivative_test", "second-order");
// iapp.Options()->SetNumericValue("bound_relax_factor", 0);
// iapp.Options()->SetIntegerValue("print_level", 5);
iapp.Options()->SetIntegerValue("print_level", print_lvl);
if (print_lvl == 0) // stop printing of banner
iapp.Options()->SetStringValue("sb", "yes");

// iapp.Options()->SetStringValue("derivative_test_print_all", "yes");
status = iapp.OptimizeTNLP(tmp);
Expand Down