util

Utility functions and classes for the MindtPy solver.

Classes

GurobiPersistent4MindtPy(**kwds)

A new persistent interface to Gurobi.

Functions

add_orthogonality_cuts(working_model, ...)

Add orthogonality cuts.

add_var_bound(model, config)

This function will add bounds for variables in nonlinear constraints if they are not bounded.

calc_jacobians(constraint_list, ...)

Generates a map of jacobians for the variables in the model.

copy_var_list_values(from_list, to_list, config)

Copy variable values from one list to another.

copy_var_list_values_from_solution_pool(...)

Copy variable values from the solution pool to another list.

epigraph_reformulation(exp, slack_var_list, ...)

Epigraph reformulation.

fp_converged(working_model, mip_model, ...)

Calculates the euclidean norm between the discrete variables in the MIP and NLP models.

generate_lag_objective_function(model, ...)

The function generates the second-order Taylor approximation of the Lagrangean.

generate_norm1_norm_constraint(model, ...[, ...])

This function generates constraint (PF-OA main problem) for minimum Norm1 distance to setpoint_model.

generate_norm1_objective_function(model, ...)

This function generates objective (PF-OA main problem) for minimum Norm1 distance to setpoint_model.

generate_norm2sq_objective_function(model, ...)

This function generates objective (FP-NLP subproblem) for minimum euclidean distance to setpoint_model.

generate_norm_constraint(fp_nlp_model, ...)

Generate the norm constraint for the FP-NLP subproblem.

generate_norm_inf_objective_function(model, ...)

This function generates objective (PF-OA main problem) for minimum Norm Infinity distance to setpoint_model.

get_integer_solution(model[, string_zero])

Extract the value of integer variables from the provided model.

initialize_feas_subproblem(m, feasibility_norm)

Adds feasibility slack variables according to config.feasibility_norm (given an infeasible problem).

set_solver_constraint_violation_tolerance(...)

Set constraint violation tolerance for solvers.

set_solver_mipgap(opt, solver_name, config)

Set mipgap for subsolvers.

set_var_valid_value(var, var_val, ...)

This function tries to set a valid value for variable with the given input.

setup_results_object(results, model, config)

Record problem statistics for original model.

update_solver_timelimit(opt, solver_name, ...)

Updates the time limit for subsolvers.