Showing preview only (7,915K chars total). Download the full file or copy to clipboard to get everything.
Repository: metab0t/PyOptInterface
Branch: master
Commit: 37d4e67baec4
Files: 831
Total size: 7.4 MB
Directory structure:
gitextract_81kqktr_/
├── .clang-format
├── .github/
│ ├── actions/
│ │ ├── setup_optimizers_linux/
│ │ │ └── action.yml
│ │ ├── setup_optimizers_macos/
│ │ │ └── action.yml
│ │ └── setup_optimizers_windows/
│ │ └── action.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── doc-build.yml
│ ├── linux-build.yml
│ ├── macos-build.yml
│ ├── wheel.yml
│ └── windows-build.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CMakeLists.txt
├── GEMINI.md
├── LICENSE.md
├── README.md
├── bench/
│ ├── bench_linopy_cvxpy.py
│ ├── bench_modify.jl
│ ├── bench_modify.mod
│ ├── bench_modify.py
│ ├── bench_modify.run
│ ├── bench_static.jl
│ ├── bench_static.py
│ ├── nqueens/
│ │ ├── .gitignore
│ │ ├── nqueens.jl
│ │ ├── nqueens_gurobipy.py
│ │ ├── nqueens_poi.py
│ │ └── nqueens_pythonmip.py
│ └── test_delete.py
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── requirements.txt
│ └── source/
│ ├── api/
│ │ ├── pyoptinterface.copt.rst
│ │ ├── pyoptinterface.gurobi.rst
│ │ ├── pyoptinterface.highs.rst
│ │ ├── pyoptinterface.knitro.rst
│ │ ├── pyoptinterface.mosek.rst
│ │ ├── pyoptinterface.rst
│ │ └── pyoptinterface.xpress.rst
│ ├── attribute/
│ │ ├── copt.md
│ │ ├── gurobi.md
│ │ ├── highs.md
│ │ ├── ipopt.md
│ │ ├── knitro.md
│ │ ├── mosek.md
│ │ └── xpress.md
│ ├── benchmark.md
│ ├── callback.md
│ ├── changelog.md
│ ├── common_model_interface.md
│ ├── conf.py
│ ├── constraint.md
│ ├── container.md
│ ├── copt.md
│ ├── develop.md
│ ├── examples/
│ │ ├── economic_dispatch.md
│ │ ├── optimal_control_rocket.md
│ │ └── optimal_power_flow.md
│ ├── expression.md
│ ├── faq.md
│ ├── getting_started.md
│ ├── gurobi.md
│ ├── highs.md
│ ├── index.md
│ ├── infeasibility.md
│ ├── ipopt.md
│ ├── knitro.md
│ ├── model.md
│ ├── mosek.md
│ ├── nonlinear.md
│ ├── numpy.md
│ ├── objective.md
│ ├── roadmap.md
│ ├── structure.md
│ ├── variable.md
│ └── xpress.md
├── include/
│ └── pyoptinterface/
│ ├── cache_model.hpp
│ ├── container.hpp
│ ├── copt_model.hpp
│ ├── core.hpp
│ ├── cppad_interface.hpp
│ ├── dylib.hpp
│ ├── gurobi_model.hpp
│ ├── highs_model.hpp
│ ├── ipopt_model.hpp
│ ├── knitro_model.hpp
│ ├── mosek_model.hpp
│ ├── nleval.hpp
│ ├── nlexpr.hpp
│ ├── solver_common.hpp
│ ├── tcc_interface.hpp
│ └── xpress_model.hpp
├── lib/
│ ├── cache_model.cpp
│ ├── copt_model.cpp
│ ├── copt_model_ext.cpp
│ ├── copt_model_ext_constants.cpp
│ ├── core.cpp
│ ├── core_ext.cpp
│ ├── cppad_interface.cpp
│ ├── cppad_interface_ext.cpp
│ ├── gurobi_model.cpp
│ ├── gurobi_model_ext.cpp
│ ├── gurobi_model_ext_constants.cpp
│ ├── highs_model.cpp
│ ├── highs_model_ext.cpp
│ ├── highs_model_ext_constants.cpp
│ ├── ipopt_model.cpp
│ ├── ipopt_model_ext.cpp
│ ├── knitro_model.cpp
│ ├── knitro_model_ext.cpp
│ ├── knitro_model_ext_constants.cpp
│ ├── main.cpp
│ ├── mosek_model.cpp
│ ├── mosek_model_ext.cpp
│ ├── mosek_model_ext_constants.cpp
│ ├── nleval.cpp
│ ├── nleval_ext.cpp
│ ├── nlexpr.cpp
│ ├── nlexpr_ext.cpp
│ ├── tcc_interface.cpp
│ ├── tcc_interface_ext.cpp
│ ├── xpress_model.cpp
│ ├── xpress_model_ext.cpp
│ └── xpress_model_ext_constants.cpp
├── optimizer_version.toml
├── pyproject.toml
├── scripts/
│ ├── generate_attribute_table.py
│ └── generate_solver_constants.py
├── skills/
│ └── pyoptinterface-expert/
│ ├── SKILL.md
│ └── references/
│ ├── api.md
│ └── examples.md
├── src/
│ └── pyoptinterface/
│ ├── __init__.py
│ ├── _src/
│ │ ├── __init__.py
│ │ ├── aml.py
│ │ ├── attributes.py
│ │ ├── codegen_c.py
│ │ ├── codegen_llvm.py
│ │ ├── comparison_constraint.py
│ │ ├── constraint_bridge.py
│ │ ├── copt.py
│ │ ├── cpp_graph_iter.py
│ │ ├── dylib.py
│ │ ├── gurobi.py
│ │ ├── highs.py
│ │ ├── ipopt.py
│ │ ├── jit_c.py
│ │ ├── jit_llvm.py
│ │ ├── knitro.py
│ │ ├── matrix.py
│ │ ├── monkeypatch.py
│ │ ├── mosek.py
│ │ ├── nlfunc.py
│ │ ├── solver_common.py
│ │ ├── tupledict.py
│ │ └── xpress.py
│ ├── copt.py
│ ├── gurobi.py
│ ├── highs.py
│ ├── ipopt.py
│ ├── knitro.py
│ ├── mosek.py
│ ├── nl.py
│ └── xpress.py
├── tests/
│ ├── conftest.py
│ ├── simple_cb.py
│ ├── test_basic.py
│ ├── test_close.py
│ ├── test_compare_constraint.py
│ ├── test_exp_cone.py
│ ├── test_iis.py
│ ├── test_in_constraint.py
│ ├── test_ipopt.py
│ ├── test_knitro.py
│ ├── test_lukvle10.py
│ ├── test_matrix_api.py
│ ├── test_nlp.py
│ ├── test_nlp_bilinear.py
│ ├── test_nlp_clnlbeam.py
│ ├── test_nlp_expression.py
│ ├── test_nlp_hs071.py
│ ├── test_nlp_multiple_run.py
│ ├── test_nlp_opf.py
│ ├── test_nlp_rocket.py
│ ├── test_operator.py
│ ├── test_preopt.py
│ ├── test_qp.py
│ ├── test_reducedcost.py
│ ├── test_simple_opt.py
│ ├── test_soc.py
│ ├── test_sos.py
│ ├── test_tupledict.py
│ ├── test_update.py
│ ├── tsp_cb.py
│ └── tsp_xpress.py
└── thirdparty/
├── ankerl/
│ ├── stl.h
│ └── unordered_dense.h
├── cppad/
│ ├── CMakeLists.txt
│ ├── include/
│ │ └── cppad/
│ │ ├── base_require.hpp
│ │ ├── configure.hpp
│ │ ├── core/
│ │ │ ├── abort_recording.hpp
│ │ │ ├── abs.hpp
│ │ │ ├── abs_normal_fun.hpp
│ │ │ ├── ad.hpp
│ │ │ ├── ad_assign.hpp
│ │ │ ├── ad_binary.hpp
│ │ │ ├── ad_ctor.hpp
│ │ │ ├── ad_fun.hpp
│ │ │ ├── ad_io.hpp
│ │ │ ├── ad_to_string.hpp
│ │ │ ├── ad_type.hpp
│ │ │ ├── ad_valued.hpp
│ │ │ ├── add.hpp
│ │ │ ├── add_eq.hpp
│ │ │ ├── arithmetic.hpp
│ │ │ ├── atan2.hpp
│ │ │ ├── atomic/
│ │ │ │ ├── four/
│ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ ├── call.hpp
│ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ ├── devel/
│ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ └── jac_sparsity.hpp
│ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ ├── forward.hpp
│ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ └── reverse.hpp
│ │ │ │ ├── one/
│ │ │ │ │ └── atomic.hpp
│ │ │ │ ├── three/
│ │ │ │ │ ├── afun.hpp
│ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ ├── forward.hpp
│ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ └── reverse.hpp
│ │ │ │ └── two/
│ │ │ │ ├── afun.hpp
│ │ │ │ ├── atomic.hpp
│ │ │ │ ├── clear.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── for_sparse_hes.hpp
│ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── option.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── azmul.hpp
│ │ │ ├── base2ad.hpp
│ │ │ ├── base_complex.hpp
│ │ │ ├── base_cond_exp.hpp
│ │ │ ├── base_double.hpp
│ │ │ ├── base_float.hpp
│ │ │ ├── base_hash.hpp
│ │ │ ├── base_limits.hpp
│ │ │ ├── base_std_math.hpp
│ │ │ ├── base_to_string.hpp
│ │ │ ├── bender_quad.hpp
│ │ │ ├── bool_fun.hpp
│ │ │ ├── bool_valued.hpp
│ │ │ ├── capacity_order.hpp
│ │ │ ├── check_for_nan.hpp
│ │ │ ├── chkpoint_one/
│ │ │ │ ├── chkpoint_one.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ ├── reverse.hpp
│ │ │ │ ├── set_hes_sparse_bool.hpp
│ │ │ │ ├── set_hes_sparse_set.hpp
│ │ │ │ ├── set_jac_sparse_bool.hpp
│ │ │ │ └── set_jac_sparse_set.hpp
│ │ │ ├── chkpoint_two/
│ │ │ │ ├── chkpoint_two.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── dynamic.hpp
│ │ │ │ ├── for_type.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── compare.hpp
│ │ │ ├── compound_assign.hpp
│ │ │ ├── con_dyn_var.hpp
│ │ │ ├── cond_exp.hpp
│ │ │ ├── convert.hpp
│ │ │ ├── cppad_assert.hpp
│ │ │ ├── dependent.hpp
│ │ │ ├── discrete/
│ │ │ │ └── discrete.hpp
│ │ │ ├── div.hpp
│ │ │ ├── div_eq.hpp
│ │ │ ├── drivers.hpp
│ │ │ ├── epsilon.hpp
│ │ │ ├── equal_op_seq.hpp
│ │ │ ├── for_hes_sparsity.hpp
│ │ │ ├── for_jac_sparsity.hpp
│ │ │ ├── for_one.hpp
│ │ │ ├── for_sparse_hes.hpp
│ │ │ ├── for_sparse_jac.hpp
│ │ │ ├── for_two.hpp
│ │ │ ├── forward/
│ │ │ │ └── forward.hpp
│ │ │ ├── fun_check.hpp
│ │ │ ├── fun_construct.hpp
│ │ │ ├── fun_eval.hpp
│ │ │ ├── graph/
│ │ │ │ ├── cpp_graph.hpp
│ │ │ │ ├── from_graph.hpp
│ │ │ │ ├── from_json.hpp
│ │ │ │ ├── graph_op_enum.hpp
│ │ │ │ ├── to_graph.hpp
│ │ │ │ └── to_json.hpp
│ │ │ ├── hash_code.hpp
│ │ │ ├── hessian.hpp
│ │ │ ├── identical.hpp
│ │ │ ├── independent/
│ │ │ │ └── independent.hpp
│ │ │ ├── integer.hpp
│ │ │ ├── jacobian.hpp
│ │ │ ├── lu_ratio.hpp
│ │ │ ├── mul.hpp
│ │ │ ├── mul_eq.hpp
│ │ │ ├── near_equal_ext.hpp
│ │ │ ├── new_dynamic.hpp
│ │ │ ├── num_skip.hpp
│ │ │ ├── numeric_limits.hpp
│ │ │ ├── omp_max_thread.hpp
│ │ │ ├── opt_val_hes.hpp
│ │ │ ├── optimize.hpp
│ │ │ ├── ordered.hpp
│ │ │ ├── parallel_ad.hpp
│ │ │ ├── pow.hpp
│ │ │ ├── print_for.hpp
│ │ │ ├── rev_hes_sparsity.hpp
│ │ │ ├── rev_jac_sparsity.hpp
│ │ │ ├── rev_one.hpp
│ │ │ ├── rev_sparse_hes.hpp
│ │ │ ├── rev_sparse_jac.hpp
│ │ │ ├── rev_two.hpp
│ │ │ ├── reverse.hpp
│ │ │ ├── sign.hpp
│ │ │ ├── sparse.hpp
│ │ │ ├── sparse_hes.hpp
│ │ │ ├── sparse_hessian.hpp
│ │ │ ├── sparse_jac.hpp
│ │ │ ├── sparse_jacobian.hpp
│ │ │ ├── standard_math.hpp
│ │ │ ├── std_math_11.hpp
│ │ │ ├── sub.hpp
│ │ │ ├── sub_eq.hpp
│ │ │ ├── subgraph_jac_rev.hpp
│ │ │ ├── subgraph_reverse.hpp
│ │ │ ├── subgraph_sparsity.hpp
│ │ │ ├── tape_link.hpp
│ │ │ ├── testvector.hpp
│ │ │ ├── to_csrc.hpp
│ │ │ ├── unary_minus.hpp
│ │ │ ├── unary_plus.hpp
│ │ │ ├── undef.hpp
│ │ │ ├── user_ad.hpp
│ │ │ ├── value.hpp
│ │ │ ├── var2par.hpp
│ │ │ ├── vec_ad/
│ │ │ │ └── vec_ad.hpp
│ │ │ └── zdouble.hpp
│ │ ├── cppad.hpp
│ │ ├── local/
│ │ │ ├── ad_tape.hpp
│ │ │ ├── atom_state.hpp
│ │ │ ├── atomic_index.hpp
│ │ │ ├── color_general.hpp
│ │ │ ├── color_symmetric.hpp
│ │ │ ├── cppad_colpack.hpp
│ │ │ ├── declare_ad.hpp
│ │ │ ├── define.hpp
│ │ │ ├── graph/
│ │ │ │ ├── cpp_graph_itr.hpp
│ │ │ │ ├── cpp_graph_op.hpp
│ │ │ │ ├── csrc_writer.hpp
│ │ │ │ ├── json_lexer.hpp
│ │ │ │ ├── json_parser.hpp
│ │ │ │ └── json_writer.hpp
│ │ │ ├── hash_code.hpp
│ │ │ ├── independent.hpp
│ │ │ ├── is_pod.hpp
│ │ │ ├── is_pod.hpp.in
│ │ │ ├── op_code_dyn.hpp
│ │ │ ├── op_code_var.hpp
│ │ │ ├── optimize/
│ │ │ │ ├── cexp_info.hpp
│ │ │ │ ├── csum_op_info.hpp
│ │ │ │ ├── csum_stacks.hpp
│ │ │ │ ├── extract_option.hpp
│ │ │ │ ├── get_cexp_info.hpp
│ │ │ │ ├── get_dyn_previous.hpp
│ │ │ │ ├── get_op_previous.hpp
│ │ │ │ ├── get_op_usage.hpp
│ │ │ │ ├── get_par_usage.hpp
│ │ │ │ ├── hash_code.hpp
│ │ │ │ ├── match_op.hpp
│ │ │ │ ├── optimize_run.hpp
│ │ │ │ ├── record_csum.hpp
│ │ │ │ ├── record_pv.hpp
│ │ │ │ ├── record_vp.hpp
│ │ │ │ ├── record_vv.hpp
│ │ │ │ ├── size_pair.hpp
│ │ │ │ └── usage.hpp
│ │ │ ├── play/
│ │ │ │ ├── addr_enum.hpp
│ │ │ │ ├── atom_op_info.hpp
│ │ │ │ ├── dyn_player.hpp
│ │ │ │ ├── player.hpp
│ │ │ │ ├── random_iterator.hpp
│ │ │ │ ├── random_setup.hpp
│ │ │ │ ├── sequential_iterator.hpp
│ │ │ │ └── subgraph_iterator.hpp
│ │ │ ├── pod_vector.hpp
│ │ │ ├── record/
│ │ │ │ ├── comp_op.hpp
│ │ │ │ ├── cond_exp.hpp
│ │ │ │ ├── dyn_recorder.hpp
│ │ │ │ ├── put_dyn_atomic.hpp
│ │ │ │ ├── put_var_atomic.hpp
│ │ │ │ ├── put_var_vecad.hpp
│ │ │ │ └── recorder.hpp
│ │ │ ├── set_get_in_parallel.hpp
│ │ │ ├── sparse/
│ │ │ │ ├── binary_op.hpp
│ │ │ │ ├── internal.hpp
│ │ │ │ ├── list_setvec.hpp
│ │ │ │ ├── pack_setvec.hpp
│ │ │ │ ├── size_setvec.hpp
│ │ │ │ ├── svec_setvec.hpp
│ │ │ │ └── unary_op.hpp
│ │ │ ├── std_set.hpp
│ │ │ ├── subgraph/
│ │ │ │ ├── arg_variable.hpp
│ │ │ │ ├── entire_call.hpp
│ │ │ │ ├── get_rev.hpp
│ │ │ │ ├── info.hpp
│ │ │ │ ├── init_rev.hpp
│ │ │ │ └── sparsity.hpp
│ │ │ ├── sweep/
│ │ │ │ ├── call_atomic.hpp
│ │ │ │ ├── dynamic.hpp
│ │ │ │ ├── for_hes.hpp
│ │ │ │ ├── for_jac.hpp
│ │ │ │ ├── forward0.hpp
│ │ │ │ ├── forward1.hpp
│ │ │ │ ├── forward2.hpp
│ │ │ │ ├── forward_0.hpp
│ │ │ │ ├── forward_any.hpp
│ │ │ │ ├── forward_dir.hpp
│ │ │ │ ├── rev_hes.hpp
│ │ │ │ ├── rev_jac.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── temp_file.hpp
│ │ │ ├── utility/
│ │ │ │ ├── cppad_vector_itr.hpp
│ │ │ │ └── vector_bool.hpp
│ │ │ ├── val_graph/
│ │ │ │ ├── base_op.hpp
│ │ │ │ ├── binary_op.hpp
│ │ │ │ ├── call_atomic.hpp
│ │ │ │ ├── call_op.hpp
│ │ │ │ ├── cexp_op.hpp
│ │ │ │ ├── comp_op.hpp
│ │ │ │ ├── compress.hpp
│ │ │ │ ├── con_op.hpp
│ │ │ │ ├── csum_op.hpp
│ │ │ │ ├── cumulative.hpp
│ │ │ │ ├── dead_code.hpp
│ │ │ │ ├── dis_op.hpp
│ │ │ │ ├── dyn_type.hpp
│ │ │ │ ├── enable_parallel.hpp
│ │ │ │ ├── fold_con.hpp
│ │ │ │ ├── fun2val.hpp
│ │ │ │ ├── op2arg_index.hpp
│ │ │ │ ├── op_enum2class.hpp
│ │ │ │ ├── op_hash_table.hpp
│ │ │ │ ├── op_iterator.hpp
│ │ │ │ ├── option.hpp
│ │ │ │ ├── pri_op.hpp
│ │ │ │ ├── print_op.hpp
│ │ │ │ ├── record.hpp
│ │ │ │ ├── record_new.hpp
│ │ │ │ ├── renumber.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ ├── summation.hpp
│ │ │ │ ├── tape.hpp
│ │ │ │ ├── unary_op.hpp
│ │ │ │ ├── val2fun.hpp
│ │ │ │ ├── val_optimize.hpp
│ │ │ │ ├── val_type.hpp
│ │ │ │ ├── var_type.hpp
│ │ │ │ └── vector_op.hpp
│ │ │ └── var_op/
│ │ │ ├── abs_op.hpp
│ │ │ ├── acos_op.hpp
│ │ │ ├── acosh_op.hpp
│ │ │ ├── add_op.hpp
│ │ │ ├── asin_op.hpp
│ │ │ ├── asinh_op.hpp
│ │ │ ├── atan_op.hpp
│ │ │ ├── atanh_op.hpp
│ │ │ ├── atomic_op.hpp
│ │ │ ├── cexp_op.hpp
│ │ │ ├── compare.hpp
│ │ │ ├── compare_op.hpp
│ │ │ ├── cond_op.hpp
│ │ │ ├── cos_op.hpp
│ │ │ ├── cosh_op.hpp
│ │ │ ├── cskip_op.hpp
│ │ │ ├── csum_op.hpp
│ │ │ ├── dis_op.hpp
│ │ │ ├── discrete_op.hpp
│ │ │ ├── div_op.hpp
│ │ │ ├── erf_op.hpp
│ │ │ ├── exp_op.hpp
│ │ │ ├── expm1_op.hpp
│ │ │ ├── load_op.hpp
│ │ │ ├── log1p_op.hpp
│ │ │ ├── log_op.hpp
│ │ │ ├── mul_op.hpp
│ │ │ ├── neg_op.hpp
│ │ │ ├── one_var.hpp
│ │ │ ├── par_op.hpp
│ │ │ ├── parameter_op.hpp
│ │ │ ├── pow_op.hpp
│ │ │ ├── pri_op.hpp
│ │ │ ├── print_op.hpp
│ │ │ ├── prototype_op.hpp
│ │ │ ├── sign_op.hpp
│ │ │ ├── sin_op.hpp
│ │ │ ├── sinh_op.hpp
│ │ │ ├── sqrt_op.hpp
│ │ │ ├── store_op.hpp
│ │ │ ├── sub_op.hpp
│ │ │ ├── tan_op.hpp
│ │ │ ├── tanh_op.hpp
│ │ │ ├── two_var.hpp
│ │ │ ├── var_op.hpp
│ │ │ └── zmul_op.hpp
│ │ ├── utility/
│ │ │ ├── check_numeric_type.hpp
│ │ │ ├── check_simple_vector.hpp
│ │ │ ├── create_dll_lib.hpp
│ │ │ ├── elapsed_seconds.hpp
│ │ │ ├── error_handler.hpp
│ │ │ ├── index_sort.hpp
│ │ │ ├── link_dll_lib.hpp
│ │ │ ├── lu_factor.hpp
│ │ │ ├── lu_invert.hpp
│ │ │ ├── lu_solve.hpp
│ │ │ ├── memory_leak.hpp
│ │ │ ├── nan.hpp
│ │ │ ├── near_equal.hpp
│ │ │ ├── ode_err_control.hpp
│ │ │ ├── ode_gear.hpp
│ │ │ ├── ode_gear_control.hpp
│ │ │ ├── omp_alloc.hpp
│ │ │ ├── poly.hpp
│ │ │ ├── pow_int.hpp
│ │ │ ├── romberg_mul.hpp
│ │ │ ├── romberg_one.hpp
│ │ │ ├── rosen_34.hpp
│ │ │ ├── runge_45.hpp
│ │ │ ├── set_union.hpp
│ │ │ ├── sparse2eigen.hpp
│ │ │ ├── sparse_rc.hpp
│ │ │ ├── sparse_rcv.hpp
│ │ │ ├── speed_test.hpp
│ │ │ ├── test_boolofvoid.hpp
│ │ │ ├── thread_alloc.hpp
│ │ │ ├── time_test.hpp
│ │ │ ├── to_string.hpp
│ │ │ ├── track_new_del.hpp
│ │ │ ├── vector.hpp
│ │ │ └── vector_bool.hpp
│ │ ├── utility.hpp
│ │ └── wno_conversion.hpp
│ └── src/
│ ├── cpp_graph_op.cpp
│ └── temp_file.cpp
├── fmt/
│ ├── CMakeLists.txt
│ ├── include/
│ │ └── fmt/
│ │ ├── args.h
│ │ ├── base.h
│ │ ├── chrono.h
│ │ ├── color.h
│ │ ├── compile.h
│ │ ├── core.h
│ │ ├── format-inl.h
│ │ ├── format.h
│ │ ├── os.h
│ │ ├── ostream.h
│ │ ├── printf.h
│ │ ├── ranges.h
│ │ ├── std.h
│ │ └── xchar.h
│ └── src/
│ ├── fmt.cc
│ ├── format.cc
│ └── os.cc
├── notes.md
├── solvers/
│ ├── copt/
│ │ └── copt.h
│ ├── gurobi/
│ │ └── gurobi_c.h
│ ├── highs/
│ │ ├── HConfig.h
│ │ ├── Highs.h
│ │ ├── filereaderlp/
│ │ │ ├── builder.hpp
│ │ │ ├── def.hpp
│ │ │ ├── model.hpp
│ │ │ └── reader.hpp
│ │ ├── interfaces/
│ │ │ └── highs_c_api.h
│ │ ├── io/
│ │ │ ├── Filereader.h
│ │ │ ├── FilereaderEms.h
│ │ │ ├── FilereaderLp.h
│ │ │ ├── FilereaderMps.h
│ │ │ ├── HMPSIO.h
│ │ │ ├── HMpsFF.h
│ │ │ ├── HighsIO.h
│ │ │ └── LoadOptions.h
│ │ ├── ipm/
│ │ │ ├── IpxSolution.h
│ │ │ ├── IpxWrapper.h
│ │ │ ├── basiclu/
│ │ │ │ ├── basiclu.h
│ │ │ │ ├── basiclu_factorize.h
│ │ │ │ ├── basiclu_get_factors.h
│ │ │ │ ├── basiclu_initialize.h
│ │ │ │ ├── basiclu_obj_factorize.h
│ │ │ │ ├── basiclu_obj_free.h
│ │ │ │ ├── basiclu_obj_get_factors.h
│ │ │ │ ├── basiclu_obj_initialize.h
│ │ │ │ ├── basiclu_obj_solve_dense.h
│ │ │ │ ├── basiclu_obj_solve_for_update.h
│ │ │ │ ├── basiclu_obj_solve_sparse.h
│ │ │ │ ├── basiclu_obj_update.h
│ │ │ │ ├── basiclu_object.h
│ │ │ │ ├── basiclu_solve_dense.h
│ │ │ │ ├── basiclu_solve_for_update.h
│ │ │ │ ├── basiclu_solve_sparse.h
│ │ │ │ ├── basiclu_update.h
│ │ │ │ ├── lu_def.h
│ │ │ │ ├── lu_file.h
│ │ │ │ ├── lu_internal.h
│ │ │ │ └── lu_list.h
│ │ │ └── ipx/
│ │ │ ├── basiclu_kernel.h
│ │ │ ├── basiclu_wrapper.h
│ │ │ ├── basis.h
│ │ │ ├── conjugate_residuals.h
│ │ │ ├── control.h
│ │ │ ├── crossover.h
│ │ │ ├── diagonal_precond.h
│ │ │ ├── forrest_tomlin.h
│ │ │ ├── guess_basis.h
│ │ │ ├── indexed_vector.h
│ │ │ ├── info.h
│ │ │ ├── ipm.h
│ │ │ ├── ipx_c.h
│ │ │ ├── ipx_config.h
│ │ │ ├── ipx_info.h
│ │ │ ├── ipx_internal.h
│ │ │ ├── ipx_parameters.h
│ │ │ ├── ipx_status.h
│ │ │ ├── iterate.h
│ │ │ ├── kkt_solver.h
│ │ │ ├── kkt_solver_basis.h
│ │ │ ├── kkt_solver_diag.h
│ │ │ ├── linear_operator.h
│ │ │ ├── lp_solver.h
│ │ │ ├── lu_factorization.h
│ │ │ ├── lu_update.h
│ │ │ ├── maxvolume.h
│ │ │ ├── model.h
│ │ │ ├── multistream.h
│ │ │ ├── normal_matrix.h
│ │ │ ├── power_method.h
│ │ │ ├── sparse_matrix.h
│ │ │ ├── sparse_utils.h
│ │ │ ├── splitted_normal_matrix.h
│ │ │ ├── starting_basis.h
│ │ │ ├── symbolic_invert.h
│ │ │ ├── timer.h
│ │ │ └── utils.h
│ │ ├── lp_data/
│ │ │ ├── HConst.h
│ │ │ ├── HStruct.h
│ │ │ ├── HighsAnalysis.h
│ │ │ ├── HighsCallback.h
│ │ │ ├── HighsCallbackStruct.h
│ │ │ ├── HighsDebug.h
│ │ │ ├── HighsIis.h
│ │ │ ├── HighsInfo.h
│ │ │ ├── HighsInfoDebug.h
│ │ │ ├── HighsLp.h
│ │ │ ├── HighsLpSolverObject.h
│ │ │ ├── HighsLpUtils.h
│ │ │ ├── HighsModelUtils.h
│ │ │ ├── HighsOptions.h
│ │ │ ├── HighsRanging.h
│ │ │ ├── HighsSolution.h
│ │ │ ├── HighsSolutionDebug.h
│ │ │ ├── HighsSolve.h
│ │ │ └── HighsStatus.h
│ │ ├── mip/
│ │ │ ├── HighsCliqueTable.h
│ │ │ ├── HighsConflictPool.h
│ │ │ ├── HighsCutGeneration.h
│ │ │ ├── HighsCutPool.h
│ │ │ ├── HighsDebugSol.h
│ │ │ ├── HighsDomain.h
│ │ │ ├── HighsDomainChange.h
│ │ │ ├── HighsDynamicRowMatrix.h
│ │ │ ├── HighsGFkSolve.h
│ │ │ ├── HighsImplications.h
│ │ │ ├── HighsLpAggregator.h
│ │ │ ├── HighsLpRelaxation.h
│ │ │ ├── HighsMipAnalysis.h
│ │ │ ├── HighsMipSolver.h
│ │ │ ├── HighsMipSolverData.h
│ │ │ ├── HighsModkSeparator.h
│ │ │ ├── HighsNodeQueue.h
│ │ │ ├── HighsObjectiveFunction.h
│ │ │ ├── HighsPathSeparator.h
│ │ │ ├── HighsPrimalHeuristics.h
│ │ │ ├── HighsPseudocost.h
│ │ │ ├── HighsRedcostFixing.h
│ │ │ ├── HighsSearch.h
│ │ │ ├── HighsSeparation.h
│ │ │ ├── HighsSeparator.h
│ │ │ ├── HighsTableauSeparator.h
│ │ │ ├── HighsTransformedLp.h
│ │ │ ├── MipTimer.h
│ │ │ └── feasibilityjump.hh
│ │ ├── model/
│ │ │ ├── HighsHessian.h
│ │ │ ├── HighsHessianUtils.h
│ │ │ └── HighsModel.h
│ │ ├── parallel/
│ │ │ ├── HighsBinarySemaphore.h
│ │ │ ├── HighsCacheAlign.h
│ │ │ ├── HighsCombinable.h
│ │ │ ├── HighsMutex.h
│ │ │ ├── HighsParallel.h
│ │ │ ├── HighsRaceTimer.h
│ │ │ ├── HighsSchedulerConstants.h
│ │ │ ├── HighsSpinMutex.h
│ │ │ ├── HighsSplitDeque.h
│ │ │ ├── HighsTask.h
│ │ │ └── HighsTaskExecutor.h
│ │ ├── pdlp/
│ │ │ ├── CupdlpWrapper.h
│ │ │ └── cupdlp/
│ │ │ ├── cupdlp_cs.h
│ │ │ ├── cupdlp_defs.h
│ │ │ ├── cupdlp_linalg.h
│ │ │ ├── cupdlp_proj.h
│ │ │ ├── cupdlp_restart.h
│ │ │ ├── cupdlp_scaling.h
│ │ │ ├── cupdlp_solver.h
│ │ │ ├── cupdlp_step.h
│ │ │ └── cupdlp_utils.c
│ │ ├── pdqsort/
│ │ │ └── pdqsort.h
│ │ ├── presolve/
│ │ │ ├── HPresolve.h
│ │ │ ├── HPresolveAnalysis.h
│ │ │ ├── HighsPostsolveStack.h
│ │ │ ├── HighsSymmetry.h
│ │ │ ├── ICrash.h
│ │ │ ├── ICrashUtil.h
│ │ │ ├── ICrashX.h
│ │ │ └── PresolveComponent.h
│ │ ├── qpsolver/
│ │ │ ├── a_asm.hpp
│ │ │ ├── a_quass.hpp
│ │ │ ├── basis.hpp
│ │ │ ├── crashsolution.hpp
│ │ │ ├── dantzigpricing.hpp
│ │ │ ├── devexpricing.hpp
│ │ │ ├── eventhandler.hpp
│ │ │ ├── factor.hpp
│ │ │ ├── feasibility_bounded.hpp
│ │ │ ├── feasibility_highs.hpp
│ │ │ ├── gradient.hpp
│ │ │ ├── instance.hpp
│ │ │ ├── matrix.hpp
│ │ │ ├── perturbation.hpp
│ │ │ ├── pricing.hpp
│ │ │ ├── qpconst.hpp
│ │ │ ├── qpvector.hpp
│ │ │ ├── quass.hpp
│ │ │ ├── ratiotest.hpp
│ │ │ ├── runtime.hpp
│ │ │ ├── scaling.hpp
│ │ │ ├── settings.hpp
│ │ │ ├── snippets.hpp
│ │ │ ├── statistics.hpp
│ │ │ └── steepestedgepricing.hpp
│ │ ├── simplex/
│ │ │ ├── HApp.h
│ │ │ ├── HEkk.h
│ │ │ ├── HEkkDual.h
│ │ │ ├── HEkkDualRHS.h
│ │ │ ├── HEkkDualRow.h
│ │ │ ├── HEkkPrimal.h
│ │ │ ├── HSimplex.h
│ │ │ ├── HSimplexDebug.h
│ │ │ ├── HSimplexNla.h
│ │ │ ├── HSimplexReport.h
│ │ │ ├── HighsSimplexAnalysis.h
│ │ │ ├── SimplexConst.h
│ │ │ ├── SimplexStruct.h
│ │ │ └── SimplexTimer.h
│ │ ├── test_kkt/
│ │ │ ├── DevKkt.h
│ │ │ └── KktCh2.h
│ │ ├── util/
│ │ │ ├── FactorTimer.h
│ │ │ ├── HFactor.h
│ │ │ ├── HFactorConst.h
│ │ │ ├── HFactorDebug.h
│ │ │ ├── HSet.h
│ │ │ ├── HVector.h
│ │ │ ├── HVectorBase.h
│ │ │ ├── HighsCDouble.h
│ │ │ ├── HighsComponent.h
│ │ │ ├── HighsDataStack.h
│ │ │ ├── HighsDisjointSets.h
│ │ │ ├── HighsHash.h
│ │ │ ├── HighsHashTree.h
│ │ │ ├── HighsInt.h
│ │ │ ├── HighsIntegers.h
│ │ │ ├── HighsLinearSumBounds.h
│ │ │ ├── HighsMatrixPic.h
│ │ │ ├── HighsMatrixSlice.h
│ │ │ ├── HighsMatrixUtils.h
│ │ │ ├── HighsMemoryAllocation.h
│ │ │ ├── HighsRandom.h
│ │ │ ├── HighsRbTree.h
│ │ │ ├── HighsSort.h
│ │ │ ├── HighsSparseMatrix.h
│ │ │ ├── HighsSparseVectorSum.h
│ │ │ ├── HighsSplay.h
│ │ │ ├── HighsTimer.h
│ │ │ ├── HighsUtils.h
│ │ │ └── stringutil.h
│ │ └── zstr/
│ │ ├── strict_fstream.hpp
│ │ └── zstr.hpp
│ ├── ipopt/
│ │ ├── IpReturnCodes.h
│ │ ├── IpReturnCodes.inc
│ │ ├── IpReturnCodes_inc.h
│ │ ├── IpStdCInterface.h
│ │ ├── IpTypes.h
│ │ └── IpoptConfig.h
│ ├── knitro/
│ │ └── knitro.h
│ ├── mosek/
│ │ ├── mosek_linux.h
│ │ └── mosek_win.h
│ └── xpress/
│ ├── function_list.txt
│ └── xpress_forward_decls.h
└── tcc/
└── libtcc.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
BasedOnStyle: Microsoft
IndentWidth: 4
UseTab: ForIndentation
SortIncludes: false
ColumnLimit: 100
AlignEscapedNewlines: Left
AlwaysBreakTemplateDeclarations : Yes
================================================
FILE: .github/actions/setup_optimizers_linux/action.yml
================================================
name: "Install optimizers on linux"
description: "Install optimizers and Setup licenses on linux"
inputs:
GUROBI_WLS:
description: "..."
required: false
default: ''
COPT_CLIENT_INI:
description: "..."
required: false
default: ''
MOSEK_LICENSE:
description: "..."
required: false
default: ''
KNITRO_LICENSE:
description: "..."
required: false
default: ''
GITHUB_TOKEN:
description: "..."
required: true
CHECK_LICENSE:
description: "..."
required: true
ARCH:
description: "..."
required: true
type: choice
default: "X64"
options:
- "X64"
- "ARM64"
runs:
using: "composite"
steps:
- name: Create directory to store installers
shell: bash
run: |
mkdir -p ~/installers
- name: Cache Installers
id: cache-installers-linux
uses: actions/cache@v4
env:
cache-name: cache-installers-linux
with:
path: ~/installers
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles('optimizer_version.toml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-
- if: ${{ (steps.cache-installers-linux.outputs.cache-hit != 'true') && (inputs.ARCH == 'X64') }}
shell: bash
name: Download X64 Installers
run: |
curl -L -o ~/installers/gurobi.tar.gz https://packages.gurobi.com/13.0/gurobi13.0.0_linux64.tar.gz
curl -L -o ~/installers/copt.tar.gz https://pub.shanshu.ai/download/copt/8.0.2/linux64/CardinalOptimizer-8.0.2-lnx64.tar.gz
curl -L -o ~/installers/mosek.tar.bz2 https://download.mosek.com/stable/10.2.0/mosektoolslinux64x86.tar.bz2
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-ubuntu2204-x86_64.tar.gz
- if: ${{ (steps.cache-installers-linux.outputs.cache-hit != 'true') && (inputs.ARCH == 'ARM64') }}
shell: bash
name: Download ARM64 Installers
run: |
curl -L -o ~/installers/gurobi.tar.gz https://packages.gurobi.com/13.0/gurobi13.0.0_armlinux64.tar.gz
curl -L -o ~/installers/copt.tar.gz https://pub.shanshu.ai/download/copt/8.0.2/aarch64/CardinalOptimizer-8.0.2-aarch64_lnx.tar.gz
curl -L -o ~/installers/mosek.tar.bz2 https://download.mosek.com/stable/10.2.0/mosektoolslinuxaarch64.tar.bz2
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-ubuntu2204-aarch64.tar.gz
- name: Setup Gurobi Installation Home
if: ${{ (inputs.ARCH == 'X64') && (inputs.GUROBI_WLS != '') }}
shell: bash
run: |
tar xfz ~/installers/gurobi.tar.gz -C ~/
ls ~/gurobi1300/linux64
# set environment variables
export GUROBI_HOME="${HOME}/gurobi1300/linux64"
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
- name: Setup Gurobi Installation Home
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.GUROBI_WLS != '') }}
shell: bash
run: |
tar xfz ~/installers/gurobi.tar.gz -C ~/
ls ~/gurobi1300/armlinux64
# set environment variables
export GUROBI_HOME="${HOME}/gurobi1300/armlinux64"
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
- name: Setup Gurobi Installation
if: ${{ inputs.GUROBI_WLS != '' }}
shell: bash
env:
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
run: |
echo "PATH=${PATH}:${GUROBI_HOME}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib" >> $GITHUB_ENV
echo $GUROBI_HOME
# setup license using secrets
echo "$GUROBI_WLS" > ~/gurobi.lic
echo "GRB_LICENSE_FILE=${HOME}/gurobi.lic" >> $GITHUB_ENV
- name: Test Gurobi
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
shell: bash
run: |
gurobi_cl
- name: Setup COPT Installation
shell: bash
env:
COPT_CLIENT_INI: ${{ inputs.COPT_CLIENT_INI }}
run: |
tar xfz ~/installers/copt.tar.gz -C ~/
ls ~/copt80
# set environment variables
export COPT_HOME="${HOME}/copt80"
echo "COPT_HOME=${COPT_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${COPT_HOME}/bin" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COPT_HOME}/lib" >> $GITHUB_ENV
echo $COPT_HOME
# Just use the size-limited license
# echo "$COPT_CLIENT_INI" > ~/client.ini
# echo "COPT_LICENSE_DIR=${HOME}" >> $GITHUB_ENV
- name: Test COPT
if: ${{ inputs.CHECK_LICENSE == 'true' }}
shell: bash
run: |
copt_cmd -c "quit"
- name: Setup MOSEK Installation Env
if: ${{ (inputs.ARCH == 'X64') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
run: |
tar jxf ~/installers/mosek.tar.bz2 -C ~/
ls ~/mosek
# set environment variables
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/linux64x86/bin"
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
- name: Setup MOSEK Installation Env
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
run: |
tar jxf ~/installers/mosek.tar.bz2 -C ~/
ls ~/mosek
# set environment variables
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/linuxaarch64/bin"
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
- name: Setup MOSEK Installation
if: ${{ inputs.MOSEK_LICENSE != '' }}
shell: bash
env:
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
run: |
echo "PATH=${PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo $MOSEK_10_2_BINDIR
# setup license using secrets
echo "$MOSEK_LICENSE" > ~/mosek.lic
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
- name: Test MOSEK
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
run: |
msktestlic
- name: Setup IPOPT Installation
shell: bash
run: |
sudo apt-get install -y libopenblas-dev liblapack3 libgfortran5
mkdir -p ~/ipopt
tar xfz ~/installers/idaes-solvers.tar.gz -C ~/ipopt
echo "PATH=${PATH}:${HOME}/ipopt" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/ipopt" >> $GITHUB_ENV
ls ~/ipopt
- name: Test IPOPT
shell: bash
run: |
ipopt -v
- name: Setup KNITRO license
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: bash
env:
KNITRO_LICENSE: ${{ inputs.KNITRO_LICENSE }}
run: |
echo "$KNITRO_LICENSE" > ${HOME}/artelys_lic.txt
echo "ARTELYS_LICENSE=${HOME}/artelys_lic.txt" >> $GITHUB_ENV
- name: Install KNITRO (using pip)
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: bash
run: |
python -m pip install knitro
================================================
FILE: .github/actions/setup_optimizers_macos/action.yml
================================================
name: "Install optimizers on macOS"
description: "Install optimizers and Setup licenses on macOS"
inputs:
GUROBI_WLS:
description: "..."
required: false
default: ''
COPT_CLIENT_INI:
description: "..."
required: false
default: ''
MOSEK_LICENSE:
description: "..."
required: false
default: ''
KNITRO_LICENSE:
description: "..."
required: false
default: ''
GITHUB_TOKEN:
description: "..."
required: true
CHECK_LICENSE:
description: "..."
required: true
ARCH:
description: "..."
required: true
type: choice
default: "X64"
options:
- "X64"
- "ARM64"
runs:
using: "composite"
steps:
- name: Create directory to store installers
shell: bash
run: |
mkdir -p ~/installers
- name: Cache Installers
id: cache-installers-macos
uses: actions/cache@v4
env:
cache-name: cache-installers-macos
with:
path: ~/installers
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles('optimizer_version.toml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-installers-macos.outputs.cache-hit != 'true' }}
shell: bash
name: Download Universal Installers
run: |
curl -L -o ~/installers/gurobi.pkg https://packages.gurobi.com/13.0/gurobi13.0.0_macos_universal2.pkg
curl -L -o ~/installers/copt.tar.gz https://pub.shanshu.ai/download/copt/8.0.2/osx64/CardinalOptimizer-8.0.2-universal_mac.tar.gz
- if: ${{ (steps.cache-installers-macos.outputs.cache-hit != 'true') && (inputs.ARCH == 'X64') }}
shell: bash
name: Download X64 Installers
run: |
curl -L -o ~/installers/mosek.tar.bz2 https://download.mosek.com/stable/10.2.0/mosektoolsosx64x86.tar.bz2
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-darwin-x86_64.tar.gz
- if: ${{ (steps.cache-installers-macos.outputs.cache-hit != 'true') && (inputs.ARCH == 'ARM64') }}
shell: bash
name: Download ARM64 Installers
run: |
curl -L -o ~/installers/mosek.tar.bz2 https://download.mosek.com/stable/10.2.0/mosektoolsosxaarch64.tar.bz2
curl -L -o ~/installers/idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-darwin-aarch64.tar.gz
- name: Setup Gurobi Installation
if: ${{ inputs.GUROBI_WLS != '' }}
shell: bash
env:
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
run: |
pkgutil --expand-full ~/installers/gurobi.pkg ~/gurobi
ls ~/gurobi
# set environment variables
export GUROBI_HOME="${HOME}/gurobi/gurobi13.0.0_macos_universal2.component.pkg/Payload/Library/gurobi1300/macos_universal2"
echo "GUROBI_HOME=${GUROBI_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${GUROBI_HOME}/bin" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${GUROBI_HOME}/lib" >> $GITHUB_ENV
echo $GUROBI_HOME
ls $GUROBI_HOME
# setup license using secrets
echo "$GUROBI_WLS" > ~/gurobi.lic
echo "GRB_LICENSE_FILE=${HOME}/gurobi.lic" >> $GITHUB_ENV
- name: Test Gurobi
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
shell: bash
run: |
gurobi_cl
- name: Setup COPT Installation
shell: bash
env:
COPT_CLIENT_INI: ${{ inputs.COPT_CLIENT_INI }}
run: |
tar xfz ~/installers/copt.tar.gz -C ~/
ls ~/copt80
# set environment variables
export COPT_HOME="${HOME}/copt80"
echo "COPT_HOME=${COPT_HOME}" >> $GITHUB_ENV
echo "PATH=${PATH}:${COPT_HOME}/bin" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${COPT_HOME}/lib" >> $GITHUB_ENV
echo $COPT_HOME
ls $COPT_HOME
# Just use the size-limited license
# echo "$COPT_CLIENT_INI" > ~/client.ini
# echo "COPT_LICENSE_DIR=${HOME}" >> $GITHUB_ENV
- name: Test COPT
if: ${{ inputs.CHECK_LICENSE == 'true' }}
shell: bash
run: |
copt_cmd -c "quit"
- name: Setup MOSEK X64 Installation
if: ${{ (inputs.ARCH == 'X64') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
env:
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
run: |
tar jxf ~/installers/mosek.tar.bz2 -C ~/
ls ~/mosek/10.2/tools/platform
# set environment variables
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/osx64x86/bin"
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo "PATH=${PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo $MOSEK_10_2_BINDIR
ls $MOSEK_10_2_BINDIR
# setup license using secrets
echo "$MOSEK_LICENSE" > ~/mosek.lic
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
- name: Setup MOSEK ARM64 Installation
if: ${{ (inputs.ARCH == 'ARM64') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
env:
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
run: |
tar jxf ~/installers/mosek.tar.bz2 -C ~/
ls ~/mosek/10.2/tools/platform
# set environment variables
export MOSEK_10_2_BINDIR="${HOME}/mosek/10.2/tools/platform/osxaarch64/bin"
echo "MOSEK_10_2_BINDIR=${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo "PATH=${PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${MOSEK_10_2_BINDIR}" >> $GITHUB_ENV
echo $MOSEK_10_2_BINDIR
ls $MOSEK_10_2_BINDIR
# setup license using secrets
echo "$MOSEK_LICENSE" > ~/mosek.lic
echo "MOSEKLM_LICENSE_FILE=${HOME}/mosek.lic" >> $GITHUB_ENV
- name: Test MOSEK
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
shell: bash
run: |
msktestlic
- name: Setup IPOPT Installation
shell: bash
run: |
mkdir -p ~/ipopt
tar xfz ~/installers/idaes-solvers.tar.gz -C ~/ipopt
echo "PATH=${PATH}:${HOME}/ipopt" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${HOME}/ipopt" >> $GITHUB_ENV
ls ~/ipopt
- name: Test IPOPT
shell: bash
run: |
ipopt -v
- name: Setup KNITRO License
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: bash
env:
KNITRO_LICENSE: ${{ inputs.KNITRO_LICENSE }}
run: |
echo "$KNITRO_LICENSE" > ~/artelys_lic.txt
echo "ARTELYS_LICENSE=${HOME}/artelys_lic.txt" >> $GITHUB_ENV
- name: Install KNITRO (using pip)
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: bash
run: |
python -m pip install knitro
================================================
FILE: .github/actions/setup_optimizers_windows/action.yml
================================================
name: "Install optimizers on windows"
description: "Install optimizers and Setup licenses on windows"
inputs:
GUROBI_WLS:
description: "..."
required: false
default: ''
COPT_CLIENT_INI:
description: "..."
required: false
default: ''
MOSEK_LICENSE:
description: "..."
required: false
default: ''
KNITRO_LICENSE:
description: "..."
required: false
default: ''
GITHUB_TOKEN:
description: "..."
required: true
CHECK_LICENSE:
description: "..."
required: true
runs:
using: "composite"
steps:
- name: Install lessmsi
shell: pwsh
run: |
curl -L -o D:\lessmsi.zip https://github.com/activescott/lessmsi/releases/download/v1.10.0/lessmsi-v1.10.0.zip
7z x D:\lessmsi.zip -oD:\lessmsi
echo "PATH=$env:PATH;D:\lessmsi" >> $env:GITHUB_ENV
- name: Test lessmsi
shell: pwsh
run: |
lessmsi h
- name: Create directory to store installers
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path "D:\installers"
- name: Cache Installers
id: cache-installers-windows
uses: actions/cache@v4
env:
cache-name: cache-installers-windows
with:
path: D:\installers
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('optimizer_version.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-installers-windows.outputs.cache-hit != 'true' }}
shell: pwsh
name: Download Installers
run: |
curl -L -o D:\installers\gurobi.msi https://packages.gurobi.com/13.0/Gurobi-13.0.0-win64.msi
curl -L -o D:\installers\copt.zip https://pub.shanshu.ai/download/copt/8.0.2/win64/CardinalOptimizer-8.0.2-win64.zip
curl -L -o D:\installers\mosek.msi https://download.mosek.com/stable/10.2.0/moseksetupwin64x86.msi
curl -L -o D:\installers\idaes-solvers.tar.gz https://github.com/IDAES/idaes-ext/releases/download/3.4.2/idaes-solvers-windows-x86_64.tar.gz
- name: List Installers
shell: pwsh
run: |
Get-ChildItem -Path D:\installers
- name: Setup Gurobi Installation
if: ${{ inputs.GUROBI_WLS != '' }}
shell: pwsh
env:
GUROBI_WLS: ${{ inputs.GUROBI_WLS }}
run: |
lessmsi x D:\installers\gurobi.msi "D:\" gurobi_cl.exe
lessmsi x D:\installers\gurobi.msi "D:\" gurobi130.dll gurobi130.lib
lessmsi x D:\installers\gurobi.msi "D:\" gurobi_c.h
ls D:\SourceDir\gurobi1300\win64
# set environment variables
echo "GUROBI_HOME=D:\SourceDir\gurobi1300\win64" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\SourceDir\gurobi1300\win64\bin" >> $env:GITHUB_ENV
echo $env:GUROBI_HOME
# setup license using secrets
echo $env:GUROBI_WLS > D:\gurobi.lic
echo "GRB_LICENSE_FILE=D:\gurobi.lic" >> $env:GITHUB_ENV
- name: Test Gurobi
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.GUROBI_WLS != '') }}
shell: pwsh
run: |
gurobi_cl
- name: Setup COPT Installation
shell: pwsh
env:
COPT_CLIENT_INI: ${{ inputs.COPT_CLIENT_INI }}
run: |
# unzip with 7zip
7z x D:\installers\copt.zip -oD:\
ls D:\copt80
# set environment variables
echo "COPT_HOME=D:\copt80" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\copt80\bin" >> $env:GITHUB_ENV
echo $env:COPT_HOME
# Just use the size-limited license
# echo $env:COPT_CLIENT_INI > D:\client.ini
# echo "COPT_LICENSE_DIR=D:\" >> $env:GITHUB_ENV
- name: Test COPT
if: ${{ inputs.CHECK_LICENSE == 'true' }}
shell: pwsh
run: |
copt_cmd -c "quit"
- name: Setup MOSEK Installation
if: ${{ inputs.MOSEK_LICENSE != '' }}
shell: pwsh
env:
MOSEK_LICENSE: ${{ inputs.MOSEK_LICENSE }}
run: |
lessmsi x D:\installers\mosek.msi "D:\" msktestlic.exe
lessmsi x D:\installers\mosek.msi "D:\" mosek64_10_2.dll mosek64_10_2.lib tbb12.dll svml_dispmd.dll
lessmsi x D:\installers\mosek.msi "D:\" mosek.h
ls D:\SourceDir\PFiles\Mosek\10.2\tools\platform\win64x86
# set environment variables
echo "MOSEK_10_2_BINDIR=D:\SourceDir\PFiles\Mosek\10.2\tools\platform\win64x86\bin" >> $env:GITHUB_ENV
echo "PATH=$env:PATH;D:\SourceDir\PFiles\Mosek\10.2\tools\platform\win64x86\bin" >> $env:GITHUB_ENV
echo $env:MOSEK_10_2_BINDIR
# setup license using secrets
echo $env:MOSEK_LICENSE > D:\mosek.lic
echo "MOSEKLM_LICENSE_FILE=D:\mosek.lic" >> $env:GITHUB_ENV
- name: Test MOSEK
if: ${{ (inputs.CHECK_LICENSE == 'true') && (inputs.MOSEK_LICENSE != '') }}
shell: pwsh
run: |
msktestlic
- name: Setup IPOPT solver
shell: pwsh
run: |
7z x -so D:\installers\idaes-solvers.tar.gz | 7z x -si -ttar -oD:\ipopt
echo "PATH=D:\ipopt;$env:PATH" >> $env:GITHUB_ENV
ls D:\ipopt
- name: Test IPOPT
shell: pwsh
run: |
ipopt -v
- name: Setup KNITRO License
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: pwsh
env:
KNITRO_LICENSE: ${{ inputs.KNITRO_LICENSE }}
run: |
# setup license using secrets
echo $env:KNITRO_LICENSE > D:\artelys_lic.txt
echo "ARTELYS_LICENSE=D:\artelys_lic.txt" >> $env:GITHUB_ENV
- name: Install KNITRO (using pip)
if: ${{ inputs.KNITRO_LICENSE != '' }}
shell: pwsh
run: |
python -m pip install knitro
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/doc-build.yml
================================================
name: gh-pages
on:
push:
branches:
- master
permissions:
contents: write
jobs:
doc_build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.13"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: ./.github/actions/setup_optimizers_linux
with:
GUROBI_WLS: ${{ secrets.GUROBI_WLS }}
COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }}
MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }}
KNITRO_LICENSE: ${{ secrets.KNITRO_LICENSE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECK_LICENSE: false
- name: Build
run: |
python -m pip list
python -m pip install nanobind scikit-build-core[pyproject] typing_extensions
python -m pip install --no-build-isolation -v .
python -c "import pyoptinterface as poi; print(dir(poi))"
- name: Build documentation
run: |
pip install -r docs/requirements.txt
cd docs
make html
cd ..
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html
================================================
FILE: .github/workflows/linux-build.yml
================================================
name: linux-build
on:
pull_request:
push:
branches:
- master
jobs:
linux_build:
runs-on: ${{ matrix.os }}
# Only allow one build at a time otherwise we can run out of licenses
concurrency:
group: linux_build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
# python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.13"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: ./.github/actions/setup_optimizers_linux
with:
GUROBI_WLS: ${{ secrets.GUROBI_WLS }}
COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }}
MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }}
KNITRO_LICENSE: ${{ secrets.KNITRO_LICENSE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECK_LICENSE: true
ARCH: ${{ runner.arch }}
- name: Build
run: |
python -m pip list
python -m pip install nanobind scikit-build-core[pyproject] typing_extensions
python -m pip install --no-build-isolation -v .
python -c "import pyoptinterface as poi; print(dir(poi))"
python -m pip wheel -w dist --no-build-isolation .
- name: Test
run: |
python -m pip install pytest numpy scipy highsbox llvmlite tccbox
python -m pytest tests -v
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: pyoptinterface-wheel-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}
path: dist/
================================================
FILE: .github/workflows/macos-build.yml
================================================
name: macos-build
on:
pull_request:
push:
branches:
- master
jobs:
macos_build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14]
# python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.11", "3.13"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
MACOSX_DEPLOYMENT_TARGET: 10.14
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: ./.github/actions/setup_optimizers_macos
with:
GUROBI_WLS: ${{ secrets.GUROBI_WLS }}
COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }}
MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }}
KNITRO_LICENSE: ${{ secrets.KNITRO_LICENSE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECK_LICENSE: false
ARCH: ${{ runner.arch }}
- name: Build
run: |
python -m pip list
python -m pip install nanobind scikit-build-core[pyproject] typing_extensions
python -m pip install --no-build-isolation -v .
python -c "import pyoptinterface as poi; print(dir(poi))"
python -m pip wheel -w dist --no-build-isolation .
- name: Test
run: |
python -m pip install pytest numpy scipy highsbox llvmlite tccbox
python -m pytest tests -k "highs or ipopt" -v
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: pyoptinterface-wheel-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}
path: dist/
================================================
FILE: .github/workflows/wheel.yml
================================================
name: cibuildwheel
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish wheels to PyPI: (testpypi/pypi/none)'
required: false
type: choice
options:
- testpypi
- pypi
- none
default: none
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest-large, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
env:
# Select wheels
CIBW_BUILD: "*-manylinux_x86_64 *-manylinux_aarch64 *-win_amd64 *-macosx_x86_64 *-macosx_arm64"
CIBW_SKIP: "cp38-* cp3??t-*"
CIBW_ARCHS: "native"
# use manylinux2014
CIBW_MANYLINUX_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
CIBW_MANYLINUX_AARCH64_IMAGE: "quay.io/pypa/manylinux2014_aarch64"
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=10.14
CIBW_TEST_COMMAND: "python -c \"import pyoptinterface as poi; print(dir(poi))\""
with:
package-dir: .
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"
- uses: actions/upload-artifact@v7
with:
name: cibw-wheels-${{ runner.os }}-${{ runner.arch }}
path: ./wheelhouse/*.whl
publish-to-testpypi:
name: Publish Python wheels to TestPyPI
needs:
- build_wheels
runs-on: ubuntu-latest
if: github.event.inputs.publish == 'testpypi'
environment:
name: testpypi
url: https://test.pypi.org/p/pyoptinterface
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist/
- name: List all the dists
run: ls -l dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish Python wheels to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
if: github.event.inputs.publish == 'pypi'
environment:
name: pypi
url: https://pypi.org/project/pyoptinterface/
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
pattern: cibw-wheels-*
merge-multiple: true
path: dist/
- name: List all the dists
run: ls -l dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
================================================
FILE: .github/workflows/windows-build.yml
================================================
name: windows-build
on:
pull_request:
push:
branches:
- master
jobs:
windows_build:
runs-on: windows-latest
# Only allow one build at a time otherwise we can run out of licenses
concurrency:
group: windows_build
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- uses: ./.github/actions/setup_optimizers_windows
with:
GUROBI_WLS: ${{ secrets.GUROBI_WLS }}
COPT_CLIENT_INI: ${{ secrets.COPT_CLIENT_INI }}
MOSEK_LICENSE: ${{ secrets.MOSEK_LICENSE }}
KNITRO_LICENSE: ${{ secrets.KNITRO_LICENSE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECK_LICENSE: true
- name: Build
run: |
python -m pip list
python -m pip install nanobind scikit-build-core[pyproject] typing_extensions
python -m pip install --no-build-isolation -v .
python -c "import pyoptinterface as poi; print(dir(poi))"
python -m pip wheel -w dist --no-build-isolation .
- name: Test
run: |
python -m pip install pytest numpy scipy highsbox llvmlite tccbox
python -m pytest tests -v
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: pyoptinterface-wheel-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python-version }}
path: dist/
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
build/
.pytest_cache/
.mypy_cache/
dist/
.idea/
.vscode/
.claude/
bench/local
debug/
docs/jupyter_execute
docs/build
*.lp
*.sol
================================================
FILE: .pre-commit-config.yaml
================================================
repos:
# C++ 格式化 - clang-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.1
hooks:
- id: clang-format
types_or: [c++, c]
files: \.(cpp|hpp|c|h|cc|cxx|hxx)$
exclude: ^thirdparty/
# Python 格式化 - black
- repo: https://github.com/psf/black
rev: 26.3.1
hooks:
- id: black
language_version: python3
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.15...3.27)
project(pyoptinterface)
set(CMAKE_CXX_STANDARD 20)
# Linux: -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# we need to ensure all shared libraries can look up its own directory to load other shared libraries
# this is very important for CppAD users because we extract its thread_alloc as a shared library
function(set_rpath target)
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
set_target_properties(${target} PROPERTIES INSTALL_RPATH "@loader_path")
elseif(UNIX)
set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN")
elseif(WIN32)
endif()
endfunction()
if(MSVC)
# Add /MP flag for multi-processor compilation
add_compile_options(/MP)
add_compile_options(/utf-8)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
# use AVX2
add_compile_options(/arch:AVX2)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# add_compile_options(-march=haswell)
endif()
endif()
add_subdirectory(thirdparty/fmt)
add_subdirectory(thirdparty/cppad)
set(POI_INSTALL_DIR ${SKBUILD_PLATLIB_DIR}/pyoptinterface/_src)
add_library(core STATIC)
target_sources(core PRIVATE
include/pyoptinterface/cache_model.hpp
include/pyoptinterface/core.hpp
include/pyoptinterface/container.hpp
include/pyoptinterface/dylib.hpp
include/pyoptinterface/solver_common.hpp
lib/cache_model.cpp
lib/core.cpp
)
target_include_directories(core PUBLIC include thirdparty)
target_link_libraries(core PUBLIC fmt)
add_library(nlexpr STATIC)
target_sources(nlexpr PRIVATE
include/pyoptinterface/nlexpr.hpp
lib/nlexpr.cpp
)
target_include_directories(nlexpr PUBLIC include thirdparty)
target_link_libraries(nlexpr PUBLIC core)
add_library(nleval STATIC)
target_sources(nleval PRIVATE
include/pyoptinterface/nleval.hpp
lib/nleval.cpp
)
target_link_libraries(nleval PUBLIC nlexpr core)
add_library(cppad_interface STATIC)
target_sources(cppad_interface PRIVATE
include/pyoptinterface/cppad_interface.hpp
lib/cppad_interface.cpp
)
target_include_directories(cppad_interface PUBLIC include thirdparty)
target_link_libraries(cppad_interface PUBLIC nlexpr cppad)
add_library(tcc_interface STATIC)
target_sources(tcc_interface PRIVATE
include/pyoptinterface/tcc_interface.hpp
lib/tcc_interface.cpp
)
target_include_directories(tcc_interface PUBLIC include thirdparty)
target_link_libraries(tcc_interface PUBLIC fmt)
# Build Python extensions
find_package(Python ${PYTHON_VERSION}
REQUIRED COMPONENTS Interpreter Development.Module
OPTIONAL_COMPONENTS Development.SABIModule)
# Import nanobind through CMake's find_package mechanism
find_package(nanobind CONFIG REQUIRED)
nanobind_add_module(
core_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/core_ext.cpp
)
target_link_libraries(core_ext PUBLIC core)
install(TARGETS core_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
nanobind_add_module(
nlexpr_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/nlexpr_ext.cpp
)
target_link_libraries(nlexpr_ext PUBLIC nlexpr)
install(TARGETS nlexpr_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
nanobind_add_module(
nleval_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/nleval_ext.cpp
)
target_link_libraries(nleval_ext PUBLIC nleval)
install(TARGETS nleval_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
nanobind_add_module(
cppad_interface_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/cppad_interface_ext.cpp
)
target_link_libraries(cppad_interface_ext PUBLIC cppad_interface)
install(TARGETS cppad_interface_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
nanobind_add_module(
tcc_interface_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/tcc_interface_ext.cpp
)
target_link_libraries(tcc_interface_ext PUBLIC tcc_interface)
install(TARGETS tcc_interface_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# Solvers
# Gurobi
add_library(gurobi_model STATIC)
target_sources(gurobi_model PRIVATE
include/pyoptinterface/gurobi_model.hpp
lib/gurobi_model.cpp
)
target_link_libraries(gurobi_model PUBLIC core nlexpr)
nanobind_add_module(
gurobi_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/gurobi_model_ext.cpp
lib/gurobi_model_ext_constants.cpp
)
target_link_libraries(gurobi_model_ext PUBLIC gurobi_model)
install(TARGETS gurobi_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# COPT
add_library(copt_model STATIC)
target_sources(copt_model PRIVATE
include/pyoptinterface/copt_model.hpp
lib/copt_model.cpp
)
target_link_libraries(copt_model PUBLIC core nlexpr)
nanobind_add_module(
copt_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/copt_model_ext.cpp
lib/copt_model_ext_constants.cpp
)
target_link_libraries(copt_model_ext PUBLIC copt_model)
install(TARGETS copt_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# MOSEK
add_library(mosek_model STATIC)
target_sources(mosek_model PRIVATE
include/pyoptinterface/mosek_model.hpp
lib/mosek_model.cpp
)
target_link_libraries(mosek_model PUBLIC core)
nanobind_add_module(
mosek_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/mosek_model_ext.cpp
lib/mosek_model_ext_constants.cpp
)
target_link_libraries(mosek_model_ext PUBLIC mosek_model)
install(TARGETS mosek_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# HiGHS
add_library(highs_model STATIC)
target_sources(highs_model PRIVATE
include/pyoptinterface/highs_model.hpp
lib/highs_model.cpp
)
target_include_directories(highs_model PUBLIC thirdparty/solvers/highs)
target_link_libraries(highs_model PUBLIC core)
# target_link_libraries(highs_model PUBLIC HiGHS::HiGHS)
nanobind_add_module(
highs_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/highs_model_ext.cpp
lib/highs_model_ext_constants.cpp
)
target_link_libraries(highs_model_ext PUBLIC highs_model)
install(TARGETS highs_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# IPOPT
add_library(ipopt_model STATIC)
target_sources(ipopt_model PRIVATE
include/pyoptinterface/ipopt_model.hpp
lib/ipopt_model.cpp
)
target_link_libraries(ipopt_model PUBLIC nlexpr nleval)
nanobind_add_module(
ipopt_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/ipopt_model_ext.cpp
)
target_link_libraries(ipopt_model_ext PUBLIC ipopt_model)
install(TARGETS ipopt_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# XPRESS
add_library(xpress_model STATIC)
target_sources(xpress_model PRIVATE
include/pyoptinterface/xpress_model.hpp
lib/xpress_model.cpp
)
target_link_libraries(xpress_model PUBLIC core nlexpr)
nanobind_add_module(
xpress_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/xpress_model_ext.cpp
lib/xpress_model_ext_constants.cpp
)
target_link_libraries(xpress_model_ext PUBLIC xpress_model)
install(TARGETS xpress_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
if(DEFINED ENV{XPRESSDIR})
message(STATUS "Detected Xpress header file: $ENV{XPRESSDIR}/include")
target_include_directories(xpress_model PRIVATE $ENV{XPRESSDIR}/include)
target_include_directories(xpress_model_ext PRIVATE $ENV{XPRESSDIR}/include)
endif()
# KNITRO
add_library(knitro_model STATIC)
target_sources(knitro_model PRIVATE
include/pyoptinterface/knitro_model.hpp
lib/knitro_model.cpp
)
target_link_libraries(knitro_model PUBLIC core cppad_interface)
nanobind_add_module(
knitro_model_ext
STABLE_ABI NB_STATIC NB_DOMAIN pyoptinterface
lib/knitro_model_ext.cpp
lib/knitro_model_ext_constants.cpp
)
target_link_libraries(knitro_model_ext PUBLIC knitro_model)
install(TARGETS knitro_model_ext LIBRARY DESTINATION ${POI_INSTALL_DIR})
# stub
nanobind_add_stub(
core_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.core_ext
OUTPUT ${POI_INSTALL_DIR}/core_ext.pyi
)
nanobind_add_stub(
nlexpr_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.nlexpr_ext
OUTPUT ${POI_INSTALL_DIR}/nlexpr_ext.pyi
)
nanobind_add_stub(
nleval_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.nleval_ext
OUTPUT ${POI_INSTALL_DIR}/nleval_ext.pyi
)
nanobind_add_stub(
cppad_interface_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.cppad_interface_ext
OUTPUT ${POI_INSTALL_DIR}/cppad_interface_ext.pyi
)
nanobind_add_stub(
tcc_interface_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.tcc_interface_ext
OUTPUT ${POI_INSTALL_DIR}/tcc_interface_ext.pyi
)
nanobind_add_stub(
gurobi_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.gurobi_model_ext
OUTPUT ${POI_INSTALL_DIR}/gurobi_model_ext.pyi
)
nanobind_add_stub(
copt_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.copt_model_ext
OUTPUT ${POI_INSTALL_DIR}/copt_model_ext.pyi
)
nanobind_add_stub(
mosek_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.mosek_model_ext
OUTPUT ${POI_INSTALL_DIR}/mosek_model_ext.pyi
)
nanobind_add_stub(
highs_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.highs_model_ext
OUTPUT ${POI_INSTALL_DIR}/highs_model_ext.pyi
)
nanobind_add_stub(
ipopt_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.ipopt_model_ext
OUTPUT ${POI_INSTALL_DIR}/ipopt_model_ext.pyi
)
nanobind_add_stub(
xpress_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.xpress_model_ext
OUTPUT ${POI_INSTALL_DIR}/xpress_model_ext.pyi
)
nanobind_add_stub(
knitro_model_ext_stub
INSTALL_TIME
MODULE pyoptinterface._src.knitro_model_ext
OUTPUT ${POI_INSTALL_DIR}/knitro_model_ext.pyi
)
set(ENABLE_TEST_MAIN OFF BOOL "Enable test c++ function with a main.cpp")
if(ENABLE_TEST_MAIN)
add_executable(test_main lib/main.cpp)
target_link_libraries(test_main PUBLIC core nleval cppad_interface)
endif()
================================================
FILE: GEMINI.md
================================================
# PyOptInterface Modeling Guidelines
When modeling with `pyoptinterface_native`, adhere to these patterns.
## Solver Initialization
- Use `pyoptinterface.<solver>.Model()`. Supported: `highs`, `gurobi`, `copt`, `ipopt`, `knitro`, `mosek`, `xpress`.
- For Gurobi, you can manage environments with `poi.gurobi.Env()`.
## Variables
- `model.add_variable(lb=None, ub=None, domain=poi.VariableDomain.Continuous, name="", start=None)`
- `model.add_m_variables(shape, ...)` returns a NumPy array of variables.
## Constraints
- Linear: `model.add_linear_constraint(expr, sense, rhs)` or `model.add_linear_constraint(lhs <= rhs)`.
- Quadratic: `model.add_quadratic_constraint(expr, sense, rhs)`.
- Matrix: `model.add_m_linear_constraints(A, x, sense, b)`.
- Nonlinear: Wrap in `with nl.graph():` and use `model.add_nl_constraint(expr)`.
## Objective
- `model.set_objective(expr, sense)`.
- Nonlinear: `with nl.graph(): model.add_nl_objective(expr, sense)`.
## Attributes
- Get: `model.get_model_attribute(poi.ModelAttribute.TerminationStatus)`.
- Set: `model.set_variable_attribute(v, poi.VariableAttribute.LowerBound, 0.0)`.
- Results: `model.get_variable_attribute(v, poi.VariableAttribute.Value)`.
## Common Utilities
- `poi.quicksum(terms)`: Efficiently sum variables/expressions.
- `poi.Eq`, `poi.Leq`, `poi.Geq`: Aliases for constraint senses.
================================================
FILE: LICENSE.md
================================================
Copyright (c) 2023: Yue Yang
The PyOptInterface is licensed under the **[MPL]** version 2.0:
[MPL]: https://www.mozilla.org/MPL/2.0/
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
The design and implementation of the PyOptInterface is inspired by the [JuMP.jl] project.
[JuMP.jl]: https://jump.dev
================================================
FILE: README.md
================================================
PyOptInterface (Python Optimization Interface)
=======
[](https://pypi.org/pypi/pyoptinterface/)
**PyOptInterface** is an open-source Python library to provide a unified API to construct and solve optimization models with various optimizers.
The detailed documentation can be found [here](https://metab0t.github.io/PyOptInterface/).
## Key features compared with other modeling interfaces
It is designed as a very thin wrapper of native C API of optimizers and attempts to provide common abstractions of an algebraic modelling environment including model, variable, constraint and expression with the least overhead of performance.
The key features of PyOptInterface include:
- Very fast speed to construct optimization model (10x faster than Pyomo, comparable with JuMP.jl and some official Python bindings provided by vendors of optimizer)
- Highly efficient structured automatic differentiation for nonlinear optimization with JIT compilation (faster than other NLP frameworks)
- Low overhead to modify and re-solve the problem incrementally (including adding/removing variables/constraints, changing objective function, etc.)
- Unified API to cover common usages, write once and the code works for all optimizers
- You still have escape hatch to query or modify solver-specific parameter/attribute/information for different optimizers directly like the vendor-specific Python binding of optimizer
## Benchmark
The benchmark comparing PyOptInterface with some other modeling interfaces can be found [here](https://metab0t.github.io/PyOptInterface/benchmark.html). PyOptInterface is among the fastest modeling interfaces in terms of model construction time and automatic differentiation of nonlinear optimization problems.
## Installation
PyOptInterface is available on PyPI. You can install it via pip:
```
pip install pyoptinterface
```
After installation, you can import the package in Python console:
```python
import pyoptinterface as poi
```
PyOptInterface has no dependencies other than Python itself. However, to use it with a specific optimizer, you need to install the corresponding optimizer manually. The details can be found on [the configurations of optimizers](https://metab0t.github.io/PyOptInterface/getting_started.html).
In order to provide out-of-the-box support for open source optimizers (currently we support [HiGHS](https://github.com/ERGO-Code/HiGHS)), PyOptInterface can also be installed with pre-built optimizers. You can install them via pip:
```
pip install pyoptinterface[highs]
```
It will install a full-featured binary version of HiGHS optimizer via [highsbox](http://github.com/metab0t/highsbox), which can be used with PyOptInterface.
## What kind of problems can PyOptInterface solve?
It currently supports the following problem types:
- Linear Programming (LP)
- Mixed-Integer Linear Programming (MILP)
- Quadratic Programming (QP)
- Mixed-Integer Quadratic Programming (MIQP)
- Quadratically Constrained Quadratic Programming (QCQP)
- Mixed-Integer Quadratically Constrained Quadratic Programming (MIQCQP)
- Second-Order Cone Programming (SOCP)
- Mixed-Integer Second-Order Cone Programming (MISOCP)
- Exponential Cone Programming (ECP)
- Mixed-Integer Exponential Cone Programming (MIECP)
- Nonlinear Programming (NLP)
## What optimizers does PyOptInterface support?
It currently supports the following optimizers:
- [COPT](https://shanshu.ai/copt) ( Commercial )
- [Gurobi](https://www.gurobi.com/) ( Commercial )
- [Xpress](https://www.fico.com/en/products/fico-xpress-optimization) ( Commercial )
- [HiGHS](https://github.com/ERGO-Code/HiGHS) ( Open source )
- [Mosek](https://www.mosek.com/) ( Commercial )
- [Ipopt](https://github.com/coin-or/Ipopt) ( Open source )
- [KNITRO](https://www.artelys.com/solvers/knitro/) ( Commercial )
## Short Example
```python
import pyoptinterface as poi
from pyoptinterface import highs
model = highs.Model()
x = model.add_variable(lb=0, ub=1, domain=poi.VariableDomain.Continuous, name="x")
y = model.add_variable(lb=0, ub=1, domain=poi.VariableDomain.Integer, name="y")
con = model.add_linear_constraint(x + y >= 1.2, name="con")
obj = 2*x
model.set_objective(obj, poi.ObjectiveSense.Minimize)
model.set_model_attribute(poi.ModelAttribute.Silent, False)
model.optimize()
print(model.get_model_attribute(poi.ModelAttribute.TerminationStatus))
# TerminationStatusCode.OPTIMAL
x_val = model.get_value(x)
# 0.2
y_val = model.get_value(y)
# 1.0
```
## Citation
If you use PyOptInterface in your research, please consider citing [the following paper](https://ieeexplore.ieee.org/document/10721402):
```bibtex
@article{yang2024accelerating,
title={Accelerating Optimal Power Flow with Structure-aware Automatic Differentiation and Code Generation},
author={Yang, Yue and Lin, Chenhui and Xu, Luo and Yang, Xiaodong and Wu, Wenchuan and Wang, Bin},
journal={IEEE Transactions on Power Systems},
year={2024},
publisher={IEEE}
}
```
## License
PyOptInterface is licensed under MPL-2.0 License.
It uses [nanobind](https://github.com/wjakob/nanobind), [fmtlib](https://github.com/fmtlib/fmt) and [martinus/unordered_dense](https://github.com/martinus/unordered_dense) as dependencies.
The design of PyOptInterface is inspired by [JuMP.jl](https://jump.dev).
Some solver-related code in `src` folder is adapted from the corresponding solver interface package in `JuMP.jl`
ecosystem, which is licensed under MIT License.
The header files in `thirdparty/solvers` directory are from the corresponding distribution of optimizers and are licensed under their own licenses.
================================================
FILE: bench/bench_linopy_cvxpy.py
================================================
import time
from numpy import arange
import numpy as np
import pandas as pd
import linopy
import pyoptinterface as poi
from pyoptinterface import copt, gurobi, highs
import cvxpy
def create_linopy_model(N):
m = linopy.Model()
x = m.add_variables(coords=[arange(N), arange(N)])
y = m.add_variables(coords=[arange(N), arange(N)])
m.add_constraints(x - y >= arange(N))
m.add_constraints(x + y >= 0)
m.add_objective((2 * x).sum() + y.sum())
return m
def create_cvxpy_model(N):
x = cvxpy.Variable((N, N))
y = cvxpy.Variable((N, N))
constraints = []
for i in range(N):
constraints.append(x[:, i] - y[:, i] >= np.arange(N))
constraints.append(x + y >= 0)
objective = cvxpy.Minimize(2 * cvxpy.sum(x) + cvxpy.sum(y))
return cvxpy.Problem(objective, constraints)
def create_poi_model(Model, N):
m = Model()
x = m.add_m_variables((N, N))
y = m.add_m_variables((N, N))
for i in range(N):
for j in range(N):
m.add_linear_constraint(x[i, j] - y[i, j], poi.Geq, i)
m.add_linear_constraint(x[i, j] + y[i, j], poi.Geq, 0)
expr = poi.ExprBuilder()
poi.quicksum_(expr, x, lambda x: 2 * x)
poi.quicksum_(expr, y)
m.set_objective(expr)
return m
def bench(N, solver_name):
results = {}
t0 = time.time()
Model = {
"copt": copt.Model,
"gurobi": gurobi.Model,
"highs": highs.Model,
}.get(solver_name, None)
if Model:
model = create_poi_model(Model, N)
model.optimize()
t1 = time.time()
results["n_variables"] = 2 * N * N
results["poi"] = t1 - t0
t0 = time.time()
model = create_linopy_model(N)
model.solve(solver_name=solver_name, io_api="direct")
t1 = time.time()
results["linopy"] = t1 - t0
t0 = time.time()
solver = {"gurobi": cvxpy.GUROBI, "copt": cvxpy.COPT}.get(solver_name, None)
if solver:
model = create_cvxpy_model(N)
model.solve(solver=cvxpy.GUROBI)
t1 = time.time()
results["cvxpy"] = t1 - t0
return results
def main(solver_name="gurobi"):
Ns = range(100, 501, 100)
results = []
for N in Ns:
results.append(bench(N, solver_name))
# create a DataFrame
df = pd.DataFrame(results, index=Ns)
# show result
print(df)
if __name__ == "__main__":
# solver_name can be "copt", "gurobi", "highs"
main("gurobi")
================================================
FILE: bench/bench_modify.jl
================================================
using JuMP
import MathOptInterface as MOI
using Gurobi
using COPT
function bench_jump(model, N::Int, M::Int)
I = 1:N
@variable(model, x[I])
@constraint(model, sum(x[i] for i = I) == N)
@objective(model, Min, sum(i / N * x[i] for i = I))
# for j in 1:M:N
for j in [1]
last_variable = j + M - 1
if last_variable > N
last_variable = N
end
deleted_variables = [x[i] for i in j:last_variable]
delete(model, deleted_variables)
optimize!(model)
end
end
function gurobi_model()
optimizer = optimizer_with_attributes(
Gurobi.Optimizer,
"Presolve" => 0,
"TimeLimit" => 0.0,
MOI.Silent() => true,
)
model = direct_model(optimizer)
return model
end
function copt_model()
optimizer = optimizer_with_attributes(
COPT.Optimizer,
"Presolve" => 0,
"TimeLimit" => 0.0,
MOI.Silent() => true,
)
model = direct_model(optimizer)
return model
end
function bench_gurobi(N, M)
model = gurobi_model()
bench_jump(model, N, M)
end
function bench_copt(N, M)
model = copt_model()
bench_jump(model, N, M)
end
function main(N, M)
time_dict = Dict{String,Float64}()
println("N: $N, M: $M")
println("Gurobi starts")
t1 = time()
bench_gurobi(N, M)
t2 = time()
println("Gurobi ends and takes ", t2 - t1, " seconds")
time_dict["gurobi"] = t2 - t1
println("COPT starts")
t1 = time()
bench_copt(N, M)
t2 = time()
println("COPT ends and takes ", t2 - t1, " seconds")
time_dict["copt"] = t2 - t1
return time_dict
end
main(5, 1)
result_dict = Dict()
for N in [1000000]
for M in [10000]
result_dict[(N, M)] = main(N, M)
end
end
result_dict
================================================
FILE: bench/bench_modify.mod
================================================
param N;
var x{1..N} >= 0;
s.t. c1: sum {i in 1..N} x[i] = N;
minimize obj: sum {i in 1..N div 2} i / N * x[i];
================================================
FILE: bench/bench_modify.py
================================================
import pyoptinterface as poi
from pyoptinterface import gurobi, copt
import gurobipy as gp
import coptpy as cp
import time
def bench_poi_base(model, N, M):
I = range(N)
x = poi.make_nd_variable(model, I)
model.set_model_attribute(poi.ModelAttribute.Silent, True)
model.set_model_attribute(poi.ModelAttribute.TimeLimitSec, 0.0)
model.set_raw_parameter("Presolve", 0)
expr = poi.ExprBuilder()
for i in range(N):
expr.add(i / N * x[i])
model.set_objective(expr, poi.ObjectiveSense.Minimize)
expr = poi.quicksum(x)
model.add_linear_constraint(expr, poi.ConstraintSense.GreaterEqual, N)
# for i in range(0, N, M):
for i in [0]:
last_variable = min(i + M, N)
deleted_variables = [x[j] for j in range(i, last_variable)]
model.delete_variables(deleted_variables)
model.optimize()
def bench_poi_gurobi(N, M):
model = gurobi.Model()
bench_poi_base(model, N, M)
def bench_poi_copt(N, M):
model = copt.Model()
bench_poi_base(model, N, M)
def bench_gp(N, M):
model = gp.Model()
I = range(N)
x = model.addVars(I)
obj = gp.quicksum(i / N * x[i] for i in range(N))
model.setObjective(obj)
model.addConstr(x.sum() == N)
model.setParam("OutputFlag", 0)
model.setParam("TimeLimit", 0.0)
model.setParam("Presolve", 0)
# for j in range(0, N, M):
for j in [0]:
last_variable = min(j + M, N)
for k in range(j, last_variable):
model.remove(x[k])
model.optimize()
def bench_cp(N, M):
env = cp.Envr()
model = env.createModel("m")
I = range(N)
x = model.addVars(I)
model.setParam("Logging", 0)
model.setParam("TimeLimit", 0.0)
model.setParam("Presolve", 0)
obj = cp.quicksum(i / N * x[i] for i in range(N))
model.setObjective(obj)
model.addConstr(x.sum() == N)
# for j in range(0, N, M):
for j in [0]:
last_variable = min(j + M, N)
for k in range(j, last_variable):
x[k].remove()
model.solve()
def main(N, M):
result = dict()
t1 = time.perf_counter()
bench_poi_gurobi(N, M)
t2 = time.perf_counter()
result["poi_gurobi"] = t2 - t1
t1 = time.perf_counter()
bench_gp(N, M)
t2 = time.perf_counter()
result["gurobipy"] = t2 - t1
t1 = time.perf_counter()
bench_poi_copt(N, M)
t2 = time.perf_counter()
result["poi_copt"] = t2 - t1
t1 = time.perf_counter()
bench_cp(N, M)
t2 = time.perf_counter()
result["coptpy"] = t2 - t1
return result
result_dict = dict()
for N in [1000000]:
for M in [100000]:
print(f"N = {N}, M = {M}")
result = main(N, M)
result_dict[(N, M)] = result
print(result_dict)
================================================
FILE: bench/bench_modify.run
================================================
param t0;
param t1;
let t0 := time();
model bench_modify.mod;
let N := 10000;
option solver_msg 0;
option presolve 0;
option solver 'gurobi';
option gurobi_options 'outlev=0 timelim=2 presolve=0';
solve >NUL;
for {j in (N div 2 + 1)..N} {
let x[j] := 0;
solve >NUL;
}
let t1 := time();
printf "%d\n", t1-t0;
================================================
FILE: bench/bench_static.jl
================================================
using JuMP
using Gurobi
using COPT
using MosekTools
function bench_jump(model, M, N)
@variable(model, x[1:M, 1:N] >= 0)
@constraint(model, sum(x) == M * N / 2)
@objective(model, Min, sum(x[i, j]^2 for i in 1:M, j in 1:N))
set_silent(model)
set_time_limit_sec(model, 0.0)
set_optimizer_attribute(model, "Presolve", 0)
optimize!(model)
end
function bench_gurobi(M::Int, N::Int)
model = direct_model(Gurobi.Optimizer())
bench_jump(model, M, N)
end
function bench_copt(M::Int, N::Int)
model = direct_model(COPT.Optimizer())
bench_jump(model, M, N)
end
function bench_mosek(M::Int, N::Int)
model = direct_model(Mosek.Optimizer())
bench_jump(model, M, N)
end
function main(M::Int, N::Int)
println("Gurobi starts")
t1 = time()
bench_gurobi(M, N)
t2 = time()
println("Gurobi ends and takes ", t2 - t1, " seconds")
println("COPT starts")
t1 = time()
bench_copt(M, N)
t2 = time()
println("COPT ends and takes ", t2 - t1, " seconds")
println("Mosek starts")
t1 = time()
bench_mosek(M, N)
t2 = time()
println("Mosek ends and takes ", t2 - t1, " seconds")
end
================================================
FILE: bench/bench_static.py
================================================
import pyoptinterface as poi
from pyoptinterface import gurobi, copt, mosek
import pyomo.environ as pyo
from pyomo.common.timing import TicTocTimer
import linopy
import gurobipy as gp
import coptpy as cp
import mosek as msk
def bench_poi_base(model, M, N):
I = range(M)
J = range(N)
x = poi.make_nd_variable(model, I, J, lb=0.0)
expr = poi.quicksum(x)
con = model.add_linear_constraint(expr, poi.ConstraintSense.Equal, M * N / 2)
obj = poi.quicksum(x, lambda v: v * v)
model.set_objective(obj, poi.ObjectiveSense.Minimize)
model.set_model_attribute(poi.ModelAttribute.Silent, True)
model.set_model_attribute(poi.ModelAttribute.TimeLimitSec, 0.0)
if isinstance(model, gurobi.Model) or isinstance(model, copt.Model):
model.set_raw_parameter("Presolve", 0)
elif isinstance(model, mosek.Model):
model.set_raw_parameter("MSK_IPAR_PRESOLVE_USE", 0)
model.optimize()
def bench_poi_gurobi(M, N):
model = gurobi.Model()
bench_poi_base(model, M, N)
def bench_poi_copt(M, N):
model = copt.Model()
bench_poi_base(model, M, N)
def bench_poi_mosek(M, N):
model = mosek.Model()
bench_poi_base(model, M, N)
def bench_pyomo_base(solver, M, N):
model = pyo.ConcreteModel()
I = range(M)
J = range(N)
model.x = pyo.Var(I, J)
for var in model.x.values():
var.setlb(0.0)
model.c = pyo.Constraint(
expr=pyo.quicksum(var for var in model.x.values()) == M * N / 2
)
model.o = pyo.Objective(expr=sum(v * v for v in model.x.values()))
solver.solve(model, load_solutions=False)
def bench_pyomo_gurobi(M, N):
solver = pyo.SolverFactory("gurobi_direct")
solver.options["timelimit"] = 0.0
solver.options["presolve"] = False
bench_pyomo_base(solver, M, N)
def bench_pyomo_mosek(M, N):
solver = pyo.SolverFactory("mosek_direct")
solver.options["dparam.optimizer_max_time"] = 0.0
solver.options["iparam.presolve_use"] = 0
bench_pyomo_base(solver, M, N)
def bench_linopy_gurobi(M, N):
model = linopy.Model()
I = range(M)
J = range(N)
x = model.add_variables(lower=0.0, coords=[I, J], name="x")
model.add_constraints(x.sum() == M * N / 2)
model.add_objective((x * x).sum())
model.solve("gurobi", io_api="direct", OutputFlag=0, TimeLimit=0.0, Presolve=0)
def bench_gp(M, N):
model = gp.Model()
I = range(M)
J = range(N)
x = model.addVars(I, J, lb=0.0, name="x")
expr = x.sum()
con = model.addConstr(expr == M * N / 2)
obj = gp.quicksum(v * v for v in x.values())
model.setObjective(obj)
model.setParam("OutputFlag", 0)
model.setParam("TimeLimit", 0.0)
model.setParam("Presolve", 0)
model.optimize()
def bench_cp(M, N):
env = cp.Envr()
model = env.createModel("m")
I = range(M)
J = range(N)
x = model.addVars(I, J, lb=0.0, nameprefix="x")
expr = x.sum()
con = model.addConstr(expr == M * N / 2)
obj = cp.quicksum(v * v for v in x.values())
model.setObjective(obj)
model.setParam("Logging", 0)
model.setParam("TimeLimit", 0.0)
model.setParam("Presolve", 0)
model.solve()
def streamprinter(text):
pass
def bench_msk(M, N):
with msk.Env() as env:
with env.Task(0, 0) as task:
task.set_Stream(msk.streamtype.log, streamprinter)
# Total number of variables (M*N for 'x')
numvar = M * N
# Add variables
for j in range(numvar):
task.appendvars(1)
# Variable bounds - All variables are greater than 0.0
for j in range(numvar):
task.putvarbound(j, msk.boundkey.ra, 0.0, 1e9)
# Objective
indx = list(range(M * N))
val = [2.0] * (M * N)
task.putqobj(indx, indx, val)
task.putobjsense(msk.objsense.minimize)
# Constraint - Sum of elements in 'x' equals M * N / 2
task.appendcons(1) # One linear constraint
indx = list(range(M * N)) # Indices of 'x' variables
val = [1.0] * (M * N) # Coefficients are 1
task.putarow(0, indx, val)
task.putconbound(0, msk.boundkey.fx, M * N / 2, M * N / 2)
# Set solver parameters
task.putdouparam(msk.dparam.optimizer_max_time, 0.0)
task.putintparam(msk.iparam.presolve_use, msk.presolvemode.off)
# Solve the problem
task.optimize()
M = 1000
N = 100
timer = TicTocTimer()
tests = [
"gurobi",
"copt",
# "mosek",
]
if "gurobi" in tests:
timer.tic("poi_gurobi starts")
bench_poi_gurobi(M, N)
timer.toc("poi_gurobi ends")
timer.tic("linopy_gurobi starts")
bench_linopy_gurobi(M, N)
timer.toc("linopy_gurobi ends")
timer.tic("gurobi starts")
bench_gp(M, N)
timer.toc("gurobi ends")
timer.tic("pyomo_gurobi starts")
bench_pyomo_gurobi(M, N)
timer.toc("pyomo_gurobi ends")
if "copt" in tests:
timer.tic("poi_copt starts")
bench_poi_copt(M, N)
timer.toc("poi_copt ends")
timer.tic("cp starts")
bench_cp(M, N)
timer.toc("cp ends")
if "mosek" in tests:
timer.tic("poi_mosek starts")
bench_poi_mosek(M, N)
timer.toc("poi_mosek ends")
timer.tic("mosek starts")
bench_msk(M, N)
timer.toc("mosek ends")
timer.tic("pyomo_mosek starts")
bench_pyomo_mosek(M, N)
timer.toc("pyomo_mosek ends")
================================================
FILE: bench/nqueens/.gitignore
================================================
*.csv
================================================
FILE: bench/nqueens/nqueens.jl
================================================
using JuMP
import Gurobi
import LinearAlgebra
function solve_nqueens(N)
model = direct_model(Gurobi.Optimizer())
set_silent(model)
set_time_limit_sec(model, 0.0)
set_optimizer_attribute(model, "Presolve", 0)
@variable(model, x[1:N, 1:N], Bin)
for i in 1:N
@constraint(model, sum(x[i, :]) == 1)
@constraint(model, sum(x[:, i]) == 1)
end
for i in -(N - 1):(N-1)
@constraint(model, sum(LinearAlgebra.diag(x, i)) <= 1)
@constraint(model, sum(LinearAlgebra.diag(reverse(x; dims=1), i)) <= 1)
end
optimize!(model)
end
function main(io::IO, Ns = 800:400:2000)
for n in Ns
start = time()
model = solve_nqueens(n)
run_time = round(Int, time() - start)
content = "jump nqueens-$n $run_time"
println(stdout, content)
println(io, content)
end
end
main(stdout, [5])
open(joinpath(@__DIR__, "benchmarks.csv"), "a") do io
main(io)
end
================================================
FILE: bench/nqueens/nqueens_gurobipy.py
================================================
from gurobipy import *
import numpy as np
import os
import time
def solve_nqueens(N):
model = Model("queens")
model.setParam("OutputFlag", 0)
model.setParam("TimeLimit", 0.0)
model.setParam("Presolve", 0)
x = np.empty((N, N), dtype=object)
for i in range(N):
for j in range(N):
x[i, j] = model.addVar(vtype=GRB.BINARY)
for i in range(N):
# Row and column
model.addConstr(quicksum(x[i, :]) == 1.0)
model.addConstr(quicksum(x[:, i]) == 1.0)
flipx = np.fliplr(x)
for i in range(-N + 1, N):
# Diagonal
model.addConstr(quicksum(x.diagonal(i)) <= 1.0)
# Anti-diagonal
model.addConstr(quicksum(flipx.diagonal(i)) <= 1.0)
model.optimize()
def main(Ns=range(800, 2001, 400)):
dir = os.path.realpath(os.path.dirname(__file__))
for n in Ns:
start = time.time()
solve_nqueens(n)
run_time = round(time.time() - start)
content = "gurobipy nqueens-%i %i" % (n, run_time)
print(content)
with open(dir + "/benchmarks.csv", "a") as io:
io.write(f"{content}\n")
return
main()
================================================
FILE: bench/nqueens/nqueens_poi.py
================================================
import pyoptinterface as poi
from pyoptinterface import gurobi
import numpy as np
import os
import time
def solve_nqueens(N):
model = gurobi.Model()
x = np.empty((N, N), dtype=object)
for i in range(N):
for j in range(N):
x[i, j] = model.add_variable(domain=poi.VariableDomain.Binary)
for i in range(N):
# Row and column
model.add_linear_constraint(poi.quicksum(x[i, :]), poi.Eq, 1.0)
model.add_linear_constraint(poi.quicksum(x[:, i]), poi.Eq, 1.0)
flipx = np.fliplr(x)
for i in range(-N + 1, N):
# Diagonal
model.add_linear_constraint(poi.quicksum(x.diagonal(i)), poi.Leq, 1.0)
# Anti-diagonal
model.add_linear_constraint(poi.quicksum(flipx.diagonal(i)), poi.Leq, 1.0)
model.set_model_attribute(poi.ModelAttribute.Silent, True)
model.set_model_attribute(poi.ModelAttribute.TimeLimitSec, 0.0)
model.set_raw_parameter("Presolve", 0)
model.optimize()
def main(Ns=range(800, 2001, 400)):
dir = os.path.realpath(os.path.dirname(__file__))
for n in Ns:
start = time.time()
solve_nqueens(n)
run_time = round(time.time() - start)
content = "poi nqueens-%i %i" % (n, run_time)
print(content)
with open(dir + "/benchmarks.csv", "a") as io:
io.write(f"{content}\n")
return
main()
================================================
FILE: bench/nqueens/nqueens_pythonmip.py
================================================
from mip.model import *
from mip import GUROBI
import numpy as np
import os
import time
def solve_nqueens(N):
model = Model("queens", solver_name=GUROBI)
# set parameters
model.solver.set_int_param("OutputFlag", 0)
model.solver.set_dbl_param("TimeLimit", 0.0)
model.solver.set_int_param("Presolve", 0)
x = np.empty((N, N), dtype=object)
for i in range(N):
for j in range(N):
x[i, j] = model.add_var(var_type="B")
for i in range(N):
# Row and column
model.add_constr(xsum(x[i, :]) == 1.0)
model.add_constr(xsum(x[:, i]) == 1.0)
flipx = np.fliplr(x)
for i in range(-N + 1, N):
# Diagonal
model.add_constr(xsum(x.diagonal(i)) <= 1.0)
# Anti-diagonal
model.add_constr(xsum(flipx.diagonal(i)) <= 1.0)
model.optimize()
def main(Ns=range(800, 2001, 400)):
dir = os.path.realpath(os.path.dirname(__file__))
for n in Ns:
start = time.time()
solve_nqueens(n)
run_time = round(time.time() - start)
content = "pythonmip nqueens-%i %i" % (n, run_time)
print(content)
with open(dir + "/benchmarks.csv", "a") as io:
io.write(f"{content}\n")
return
main()
================================================
FILE: bench/test_delete.py
================================================
import gurobipy as gp
import coptpy as cp
import pyoptinterface as poi
from pyoptinterface import copt
def bench_poi_base(N):
model = copt.Model()
I = range(N)
x = poi.make_nd_variable(model, I, lb=0.0)
model.add_linear_constraint(x[0] + x[N - 1], poi.ConstraintSense.GreaterEqual, 1.0)
model.set_model_attribute(poi.ModelAttribute.Silent, False)
model.set_model_attribute(poi.ModelAttribute.TimeLimitSec, 2.0)
model.set_raw_parameter("Presolve", 0)
obj = poi.ExprBuilder()
for i in range(N):
obj.add(x[i] * x[i])
model.set_objective(obj, poi.ObjectiveSense.Minimize)
for i in range(N // 2):
model.delete_variable(x[i])
model.optimize()
def gp_delete(N):
model = gp.Model()
I = range(N)
x = model.addVars(I, lb=0.0)
model.addConstr(x[0] + x[N - 1] >= 1.0)
obj = gp.quicksum(x[i] * x[i] for i in range(N))
model.setObjective(obj)
model.setParam("OutputFlag", 1)
model.setParam("TimeLimit", 2.0)
model.setParam("Presolve", 0)
for j in range(N // 2):
model.remove(x[j])
model.optimize()
def cp_delete(N):
env = cp.Envr()
model = env.createModel("m")
I = range(N)
x = model.addVars(I, lb=0.0)
model.addConstr(x[0] + x[N - 1] >= 1.0)
obj = cp.quicksum(x[i] * x[i] for i in range(N))
model.setObjective(obj)
model.setParam("Logging", 1)
model.setParam("TimeLimit", 2.0)
model.setParam("Presolve", 0)
for j in range(N // 2):
x[j].remove()
model.solve()
if __name__ == "__main__":
N = 20
cp_delete(N)
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
================================================
FILE: docs/make.bat
================================================
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
if "%1" == "" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
================================================
FILE: docs/requirements.txt
================================================
sphinx
myst-parser
myst-nb
sphinx-copybutton
furo
numpy
scipy
highsbox
tccbox
llvmlite
matplotlib
================================================
FILE: docs/source/api/pyoptinterface.copt.rst
================================================
pyoptinterface.copt package
====================================
.. automodule:: pyoptinterface.copt
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/api/pyoptinterface.gurobi.rst
================================================
pyoptinterface.gurobi package
====================================
.. automodule:: pyoptinterface.gurobi
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/api/pyoptinterface.highs.rst
================================================
pyoptinterface.highs package
====================================
.. automodule:: pyoptinterface.highs
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/api/pyoptinterface.knitro.rst
================================================
pyoptinterface.knitro package
====================================
.. automodule:: pyoptinterface.knitro
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/api/pyoptinterface.mosek.rst
================================================
pyoptinterface.mosek package
====================================
.. automodule:: pyoptinterface.mosek
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/api/pyoptinterface.rst
================================================
pyoptinterface package
===========================
.. automodule:: pyoptinterface
:members:
:undoc-members:
:show-inheritance:
Submodules
-----------
.. toctree::
:maxdepth: 2
pyoptinterface.gurobi.rst
pyoptinterface.copt.rst
pyoptinterface.xpress.rst
pyoptinterface.mosek.rst
pyoptinterface.highs.rst
================================================
FILE: docs/source/api/pyoptinterface.xpress.rst
================================================
pyoptinterface.xpress package
====================================
.. automodule:: pyoptinterface.xpress
:members:
:inherited-members:
:undoc-members:
:show-inheritance:
================================================
FILE: docs/source/attribute/copt.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ✅
- ❌
* - DualObjectiveValue
- ✅
- ❌
* - NodeCount
- ✅
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ✅
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ✅
* - Silent
- ✅
- ✅
* - SimplexIterations
- ✅
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ✅
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ✅
- ❌
* - IISUpperBound
- ✅
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ✅
- ❌
:::
================================================
FILE: docs/source/attribute/gurobi.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ✅
- ❌
* - DualObjectiveValue
- ✅
- ❌
* - NodeCount
- ✅
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ✅
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ✅
* - Silent
- ✅
- ✅
* - SimplexIterations
- ✅
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ✅
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ✅
- ❌
* - IISUpperBound
- ✅
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ✅
- ❌
:::
================================================
FILE: docs/source/attribute/highs.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ❌
- ❌
* - DualObjectiveValue
- ❌
- ❌
* - NodeCount
- ❌
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ❌
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ✅
* - Silent
- ✅
- ✅
* - SimplexIterations
- ❌
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ✅
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ❌
- ❌
* - IISUpperBound
- ❌
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ❌
- ❌
:::
================================================
FILE: docs/source/attribute/ipopt.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - ObjectiveSense
- ❌
- ❌
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ❌
- ❌
* - DualObjectiveValue
- ❌
- ❌
* - NodeCount
- ❌
- ❌
* - NumberOfThreads
- ❌
- ❌
* - ObjectiveBound
- ❌
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ❌
- ❌
* - Silent
- ❌
- ✅
* - SimplexIterations
- ❌
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ❌
- ❌
* - SolveTimeSec
- ❌
- ❌
* - TimeLimitSec
- ❌
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ❌
- ❌
* - PrimalStart
- ✅
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ❌
- ❌
* - IISUpperBound
- ❌
- ❌
* - ReducedCost
- ❌
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ❌
- ❌
:::
================================================
FILE: docs/source/attribute/knitro.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ❌
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ✅
- ❌
* - DualObjectiveValue
- ❌
- ❌
* - NodeCount
- ✅
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ✅
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ❌
* - Silent
- ❌
- ✅
* - SimplexIterations
- ❌
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ❌
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ❌
- ❌
* - IISUpperBound
- ❌
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
:::
================================================
FILE: docs/source/attribute/mosek.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ❌
- ❌
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ❌
- ❌
* - DualObjectiveValue
- ✅
- ❌
* - NodeCount
- ❌
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ❌
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ✅
* - Silent
- ✅
- ✅
* - SimplexIterations
- ❌
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ❌
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ❌
- ❌
* - IISUpperBound
- ❌
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ❌
- ❌
:::
================================================
FILE: docs/source/attribute/xpress.md
================================================
### Supported [model attribute](#pyoptinterface.ModelAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - ObjectiveSense
- ✅
- ✅
* - DualStatus
- ✅
- ❌
* - PrimalStatus
- ✅
- ❌
* - RawStatusString
- ✅
- ❌
* - TerminationStatus
- ✅
- ❌
* - BarrierIterations
- ✅
- ❌
* - DualObjectiveValue
- ✅
- ❌
* - NodeCount
- ✅
- ❌
* - NumberOfThreads
- ✅
- ✅
* - ObjectiveBound
- ✅
- ❌
* - ObjectiveValue
- ✅
- ❌
* - RelativeGap
- ✅
- ✅
* - Silent
- ✅
- ✅
* - SimplexIterations
- ✅
- ❌
* - SolverName
- ✅
- ❌
* - SolverVersion
- ✅
- ❌
* - SolveTimeSec
- ✅
- ❌
* - TimeLimitSec
- ✅
- ✅
:::
### Supported [variable attribute](#pyoptinterface.VariableAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Value
- ✅
- ❌
* - LowerBound
- ✅
- ✅
* - UpperBound
- ✅
- ✅
* - Domain
- ✅
- ✅
* - PrimalStart
- ✅
- ✅
* - Name
- ✅
- ✅
* - IISLowerBound
- ✅
- ❌
* - IISUpperBound
- ✅
- ❌
* - ReducedCost
- ✅
- ❌
:::
### Supported [constraint attribute](#pyoptinterface.ConstraintAttribute)
:::{list-table}
:header-rows: 1
* - Attribute
- Get
- Set
* - Name
- ✅
- ✅
* - Primal
- ✅
- ❌
* - Dual
- ✅
- ❌
* - IIS
- ✅
- ❌
:::
================================================
FILE: docs/source/benchmark.md
================================================
# Benchmark
## Model construction time
The benchmark is adapted from [the JuMP paper](https://github.com/jump-dev/JuMPPaperBenchmarks). Eight optimization models with different sizes are selected as test cases, including four facility location models and four linear quadratic control problems. We conduct two rounds of benchmark using Gurobi and COPT as optimizer respectively. For each model, we measure the total time of modeling interface to generate model and pass it to the optimizer, and the time limit of optimizer is set to 0.0 seconds to avoid the influence of solution process.
All code to run the benchmarks is available at [https://github.com/metab0t/PyOptInterface_benchmark](https://github.com/metab0t/PyOptInterface_benchmark).
:::{table} Time (second) to generate model and pass it to Gurobi optimizer.
:widths: auto
:align: center
| Model | Variables | C++ | PyOptInterface | JuMP | gurobipy | Pyomo |
| --------- | --------- | ---- | -------------- | ---- | -------- | ----- |
| fac-25 | 67651 | 0.2 | 0.2 | 0.2 | 1.2 | 4.1 |
| fac-50 | 520301 | 0.8 | 1.2 | 1.8 | 9.7 | 32.7 |
| fac-75 | 1732951 | 2.7 | 4.1 | 6.6 | 32.5 | 119.3 |
| fac-100 | 4080601 | 6.3 | 10.0 | 17.8 | 79.1 | 286.3 |
| lqcp-500 | 251501 | 0.9 | 1.5 | 1.3 | 6.3 | 23.8 |
| lqcp-1000 | 1003001 | 3.7 | 6.0 | 6.1 | 26.7 | 106.6 |
| lqcp-1500 | 2254501 | 8.3 | 14.0 | 17.7 | 61.8 | 234.0 |
| lqcp-2000 | 4006001 | 14.5 | 24.9 | 38.3 | 106.9 | 444.1 |
:::
:::{table} Time (second) to generate model and pass it to COPT optimizer.
:widths: auto
:align: center
| Model | Variables | C++ | PyOptInterface | JuMP | coptpy | Pyomo |
| --------- | --------- | ---- | -------------- | ---- | ------ | ----- |
| fac-25 | 67651 | 0.3 | 0.2 | 0.3 | 0.6 | 4.1 |
| fac-50 | 520301 | 2.2 | 1.5 | 2.7 | 5.4 | 32.8 |
| fac-75 | 1732951 | 8.1 | 6.6 | 10.2 | 20.3 | 117.4 |
| fac-100 | 4080601 | 22.4 | 23.4 | 30.3 | 58.0 | 284.0 |
| lqcp-500 | 251501 | 3.8 | 3.1 | 3.0 | 6.6 | 26.4 |
| lqcp-1000 | 1003001 | 16.0 | 15.5 | 13.9 | 28.1 | 112.1 |
| lqcp-1500 | 2254501 | 37.6 | 32.4 | 33.7 | 64.6 | 249.3 |
| lqcp-2000 | 4006001 | 68.2 | 60.3 | 66.2 | 118.4 | 502.4 |
:::
Recently, there are a lot of requests to test the performance of PyOptInterface compared with [linopy](https://github.com/PyPSA/linopy) and [cvxpy](https://github.com/cvxpy/cvxpy), so we prepare a [benchmark](https://github.com/metab0t/PyOptInterface/blob/master/bench/bench_linopy_cvxpy.py).
This is the result of benchmark, where the performance of PyOptInterface exceeds linopy and cvxpy significantly.
:::{table} Time (second) to generate and solve a linear programming model with Gurobi optimizer.
:widths: auto
:align: center
| N | Variables | PyOptInterface | linopy | cvxpy |
| --- | --------- | -------------- | -------- | --------- |
| 100 | 20000 | 0.076867 | 0.433379 | 0.224613 |
| 200 | 80000 | 0.356767 | 0.959883 | 0.927248 |
| 300 | 180000 | 0.796876 | 2.080950 | 2.681649 |
| 400 | 320000 | 1.375459 | 3.715881 | 6.174171 |
| 500 | 500000 | 2.222600 | 6.297467 | 12.153747 |
:::
## Nonlinear programming
We use the AC Optimal Power Flow problem to benchmark performance of PyOptInterface against different modeling languages. The code is released at [GitHub](https://github.com/metab0t/opf_benchmark) and the result is published by our paper [Accelerating Optimal Power Flow with Structure-aware Automatic Differentiation and Code Generation](https://ieeexplore.ieee.org/document/10721402).
================================================
FILE: docs/source/callback.md
================================================
# Callback
:::{attention}
The behavior of callback function highly depends on the optimizer and the specific problem. Please refer to the official documentation of the optimizer for more details.
:::
In most optimization problems, we build the model, set the parameters, and then call the optimizer to solve the problem. However, in some cases, we may want to monitor the optimization process and intervene in the optimization process. For example, we may want to stop the optimization process when a certain condition is met, or we may want to record the intermediate results of the optimization process. In these cases, we can use the callback function. The callback function is a user-defined function that is called by the optimizer at specific points during the optimization process. Callback is especially useful for mixed-integer programming problems, where we can control the branch and bound process in callback functions.
Callback is not supported for all optimizers. Currently, we only support callback for Gurobi, COPT, and Xpress optimizer. Because callback is tightly coupled with the optimizer, we choose not to implement a strictly unified API for callback. Instead, we try to unify the common parts of the callback API and aim to provide all callback features included in the vendored Python bindings.
In PyOptInterface, the callback function is simply a Python function that takes two arguments:
- `model`: The instance of the [optimization model](model.md)
- `where`: The flag indicates the stage of optimization process when our callback function is invoked. For Gurobi, the value of `where` is [CallbackCodes](https://www.gurobi.com/documentation/current/refman/cb_codes.html#sec:CallbackCodes). For COPT, the value of `where` is called as [callback contexts](https://guide.coap.online/copt/en-doc/callback.html) such as `COPT.CBCONTEXT_MIPNODE` and `COPT.CBCONTEXT_MIPRELAX`. For Xpress, the `where` value corresponds to specific callback points such as `XPRS.CB_CONTEXT.PREINTSOL` or `XPRS.CB_CONTEXT.OPTNODE`. A description of supported Xpress callbacks can be found [here](https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/chapter5.html?scroll=section5002).
In the function body of the callback function, we can do the following four kinds of things:
- Query the current information of the optimization process. For scalar information, we can use `model.cb_get_info` function to get the information, and its argument is the value of [`what`](https://www.gurobi.com/documentation/current/refman/cb_codes.html) in Gurobi and the value of [callback information](https://guide.coap.online/copt/en-doc/information.html#chapinfo-cbc) in COPT. For Xpress, use regular attribute access methods such as `model.get_raw_attribute`. For array information such as the MIP solution or relaxation, PyOptInterface provides special functions such as `model.cb_get_solution` and `model.cb_get_relaxation`.
- Add lazy constraint: Use `model.cb_add_lazy_constraint` just like `model.add_linear_constraint` except for the `name` argument.
- Add user cut: Use `model.cb_add_user_cut` just like `model.add_linear_constraint` except for the `name` argument.
- Set a heuristic solution: Use `model.cb_set_solution` to set individual values of variables and use `model.cb_submit_solution` to submit the solution to the optimizer immediately (`model.cb_submit_solution` will be called automatically in the end of callback if `model.cb_set_solution` is called).
- Terminate the optimizer: Use `model.cb_exit`.
Here is an example of a callback function that stops the optimization process when the objective value reaches a certain threshold:
```python
import pyoptinterface as poi
from pyoptinterface import gurobi, copt, xpress
GRB = gurobi.GRB
COPT = copt.COPT
XPRS = xpress.XPRS
def cb_gurobi(model, where):
if where == GRB.Callback.MIPSOL:
obj = model.cb_get_info(GRB.Callback.MIPSOL_OBJ)
if obj < 10:
model.cb_exit()
def cb_copt(model, where):
if where == COPT.CBCONTEXT_MIPSOL:
obj = model.cb_get_info("MipCandObj")
if obj < 10:
model.cb_exit()
def cb_xpress(model, where):
if where == XPRS.CB_CONTEXT.PREINTSOL:
obj = model.get_raw_attribute("LPOBJVAL")
if obj < 10:
model.cb_exit()
```
To use the callback function, we need to call `model.set_callback(cb)` to pass the callback function to the optimizer. For COPT and Xpress, `model.set_callback` needs an additional argument `where` to specify the context where the callback function is invoked. For Gurobi, the `where` argument is not needed.
```python
model_gurobi = gurobi.Model()
model_gurobi.set_callback(cb_gurobi)
model_copt = copt.Model()
model_copt.set_callback(cb_copt, COPT.CBCONTEXT_MIPSOL)
# callback can also be registered for multiple contexts
model_copt.set_callback(cb_copt, COPT.CBCONTEXT_MIPSOL + COPT.CBCONTEXT_MIPNODE)
model_xpress = xpress.Model()
model_xpress.set_callback(cb_xpress, XPRS.CB_CONTEXT.PREINTSOL)
# callback can also be registered for multiple contexts
model_xpress.set_callback(cb_xpress, XPRS.CB_CONTEXT.PREINTSOL + XPRS.CB_CONTEXT.CUTROUND)
```
In order to help users to migrate code using gurobipy, coptpy, and Xpress Python to PyOptInterface, we list a translation table as follows.
:::{table} Callback in gurobipy and PyOptInterface
:align: left
| gurobipy | PyOptInterface |
| -------------------------------------- | ------------------------------------------------------- |
| `model.optimize(cb)` | `model.set_callback(cb) ` |
| `model.cbGet(GRB.Callback.SPX_OBJVAL)` | `model.cb_get_info(GRB.Callback.SPX_OBJVAL)` |
| `model.cbGetSolution(var)` | `model.cb_get_solution(var)` |
| `model.cbGetNodelRel(var)` | `model.cb_get_relaxation(var)` |
| `model.cbLazy(x[0] + x[1] <= 3)` | `model.cb_add_lazy_constraint(x[0] + x[1], poi.Leq, 3)` |
| `model.cbCut(x[0] + x[1] <= 3)` | `model.cb_add_user_cut(x[0] + x[1], poi.Leq, 3)` |
| `model.cbSetSolution(x, 1.0)` | `model.cb_set_solution(x, 1.0)` |
| `objval = model.cbUseSolution()` | `objval = model.cb_submit_solution()` |
| `model.termimate()` | `model.cb_exit()` |
:::
:::{table} Callback in coptpy and PyOptInterface
:align: left
| coptpy | PyOptInterface |
| ---------------------------------------------- | ------------------------------------------------------- |
| `model.setCallback(cb, COPT.CBCONTEXT_MIPSOL)` | `model.set_callback(cb, COPT.CBCONTEXT_MIPSOL)` |
| `CallbackBase.getInfo(COPT.CbInfo.BestBnd)` | `model.cb_get_info(COPT.CbInfo.BestBnd)` |
| `CallbackBase.getSolution(var)` | `model.cb_get_solution(var)` |
| `CallbackBase.getRelaxSol(var)` | `model.cb_get_relaxation(var)` |
| `CallbackBase.getIncumbent(var)` | `model.cb_get_incumbent(var)` |
| `CallbackBase.addLazyConstr(x[0] + x[1] <= 3)` | `model.cb_add_lazy_constraint(x[0] + x[1], poi.Leq, 3)` |
| `CallbackBase.addUserCut(x[0] + x[1] <= 3)` | `model.cb_add_user_cut(x[0] + x[1], poi.Leq, 3)` |
| `CallbackBase.setSolution(x, 1.0) ` | `model.cb_set_solution(x, 1.0)` |
| `CallbackBase.loadSolution()` | `model.cb_submit_solution()` |
| `CallbackBase.interrupt()` | `model.cb_exit()` |
:::
:::{table} Callback in Xpress Python and PyOptInterface
:align: left
| Xpress Python | PyOptInterface |
| ------------------------------------------------------ | ------------------------------------------------------------- |
| `model.addPreIntsolCallback(cb)` | `model.set_callback(cb, XPRS.CB_CONTEXT.PREINTSOL)` |
| `model.attributes.bestbound` | `model.get_raw_attribute("BESTBOUND")` |
| `model.getCallbackSolution(var)` | `model.cb_get_solution(var)` |
| `model.getCallbackSolution(var)` | `model.cb_get_relaxation(var)` |
| `model.getSolution(var)` | `model.cb_get_incumbent(var)` |
| `model.addCuts(0, 'L', 3, [0], [0, 1], [1, 1])` | `model.cb_add_lazy_constraint(x[0] + x[1], poi.Leq, 3)` |
| `model.addManagedCuts(1, 'L', 3, [0], [0, 1], [1, 1])` | `model.cb_add_user_cut(x[0] + x[1], poi.Leq, 3)` |
| `model.addMipSol([x], [1.0])` | `model.cb_set_solution(x, 1.0)` + `model.cb_submit_solution()` |
| `model.interrupt()` | `model.cb_exit()` |
:::
For a detailed example to use callbacks in PyOptInterface, we provide a [concrete callback example](https://github.com/metab0t/PyOptInterface/blob/master/tests/tsp_cb.py) to solve the Traveling Salesman Problem (TSP) with callbacks in PyOptInterface, gurobipy, coptpy, and Xpress Python. The example is adapted from the official Gurobi example [tsp.py](https://www.gurobi.com/documentation/current/examples/tsp_py.html).
================================================
FILE: docs/source/changelog.md
================================================
# Changelog
## 0.6.1
- Fix some bugs in Mosek interface
- Update documentation of Knitro
## 0.6.0
- Add support for KNITRO solver, including nonlinear optimization, callbacks, license management, and documentation
- Add support for Xpress solver, including linear, quadratic, NLP, callbacks, and reduced cost support
- Add `ReducedCost` variable attribute
- Add checks in IpoptModel to raise an error when accessing variable values, objective value, constraint primal or dual before calling `optimize()` or after modifying the model
- Fix the sign of dual multiplier in IPOPT
- Fix Hessian matrix ordering in HiGHS (sort elements in the same column by row number)
- Fix initial value of nonlinear optimization in COPT
- Fix `poi.ExprBuilder` operation with itself
- Allow `poi.quicksum` for high dimensional numpy array directly without needing `.flat`
- Support Gurobi 13, COPT 8, HiGHS 1.12
- Support finding Gurobi in pixi environment
- Update CppAD to 20260000 and fmt to 12.1.0
## 0.5.1
- Support llvmlite 0.45.0
## 0.5.0
- Overhaul of the nonlinear programming interface and now PyOptInterface can solve nonlinear programming problems with COPT, Gurobi and IPOPT.
- Use `model.add_linear_constraint(x+y, (1.0, 2.0))` to add two-sided linear constraints
- Add `poi.ScalarAffineFunction.from_numpy` to create scalar affine functions from numpy arrays quickly
## 0.4.1
- Support writing solution files in HiGHS
- Pass the names of variables and constraints to HiGHS
- Add `model.close()` and `env.close()` methods to allow users release the license of commercial solvers manually
## 0.4.0
- Add `model.add_m_variables` and `model.add_m_linear_constraints` matrix modeling API
- Add `model.computeIIS` and IIS related attributes for constraint and variable
- Implement constraint based on compare operators, now you can use `model.add_linear_constraint(x + y <= 1.0)` directly
- Drop support for Python 3.8
- Add wheels for Linux ARM64
- Supports HiGHS 1.9.0 and Mosek 11
## 0.3.0
- Add `model.set_variable_bounds(variable, lb, ub)` to make it easier to change variable bounds
- Introduce nonlinear programming support of Ipopt
- Support new versions of optimizers
- Various minor bug fixes
## 0.2.8
- Fix bugs in HiGHS and MOSEK when the quadratic objective function contains nondiagonal terms
## 0.2.7
- Fix bugs in HiGHS termination status
## 0.2.6
- Add rotated second-order cone support for COPT, Gurobi and Mosek
- Add exponential cone support for COPT and Mosek
- Requires COPT version >= 7.1.4 to support exponential cone
## 0.2.5
- Fix `add_linear_constraint` of HiGHS optimizer to consider the constant term in expression correctly
- Make `make_tupledict` slightly faster
## 0.2.4
- Add `map` method for `tupledict` class
- Add type stubs for C++ extension modules
## 0.2.3
- Fix a bug when deleting constraint in HiGHS
## 0.2.2
- Fix the performance issue with HiGHS optimizer
## 0.2.1
- Fix the DLL search paths on Windows
## 0.2.0
- Supports callback for Gurobi and COPT
- Release GIL when calling `model.optimize()`
## 0.1.1
- Add `Model.write` method to write model to files
## 0.1.0
- First release on PyPI
================================================
FILE: docs/source/common_model_interface.md
================================================
# Common Model Interface
Generally speaking, the following APIs are common to all optimizers except for adding constraint
because different optimizers may support different types of constraints.
## Model
### Get/set model attributes
```{py:function} model.set_model_attribute(attr, value)
set the value of a model attribute
:param pyoptinterface.ModelAttribute attr: the attribute to set
:param value: the value to set
```
```{py:function} model.get_model_attribute(attr)
get the value of a model attribute
:param pyoptinterface.ModelAttribute attr: the attribute to get
:return: the value of the attribute
```
## Variable
### Add a variable to the model
```{py:function} model.add_variable([lb=-inf, ub=+inf, domain=pyoptinterface.VariableDomain.Continuous, name=""])
add a variable to the model
:param float lb: the lower bound of the variable, optional, defaults to $-\infty$
:param float ub: the upper bound of the variable, optional, defaults to $+\infty$
:param pyoptinterface.VariableDomain domain: the domain of the variable, optional, defaults to
continuous
:param str name: the name of the variable, optional
:return: the handle of the variable
```
### Add multidimensional variables to the model as <project:#pyoptinterface.tupledict>
```{py:function} model.add_variables(*coords, [lb=-inf, ub=+inf, domain=pyoptinterface.VariableDomain.Continuous, name=""])
add a multidimensional variable to the model
:param coords: the coordinates of the variable, can be a list of Iterables
:param float lb: the lower bound of the variable, optional, defaults to $-\infty$
:param float ub: the upper bound of the variable, optional, defaults to $+\infty$
:param pyoptinterface.VariableDomain domain: the domain of the variable, optional, defaults to
continuous
:param str name: the name of the variable, optional
:return: the multi-dimensional variable
:rtype: pyoptinterface.tupledict
```
### Add multidimensional variables to the model as `numpy.ndarray`
```{py:function} model.add_m_variables(shape, [lb=-inf, ub=+inf, domain=pyoptinterface.VariableDomain.Continuous, name=""])
add a multidimensional variable to the model as `numpy.ndarray`
:param shape: the shape of the variable, can be a tuple of integers or an integer
:param float lb: the lower bound of the variable, optional, defaults to $-\infty$
:param float ub: the upper bound of the variable, optional, defaults to $+\infty$
:param pyoptinterface.VariableDomain domain: the domain of the variable, optional, defaults to
continuous
:param str name: the name of the variable, optional
:return: the multidimensional variable
:rtype: numpy.ndarray
```
### Get/set variable attributes
```{py:function} model.set_variable_attribute(var, attr, value)
set the value of a variable attribute
:param var: the handle of the variable
:param pyoptinterface.VariableAttribute attr: the attribute to set
:param value: the value to set
```
```{py:function} model.get_variable_attribute(var, attr)
get the value of a variable attribute
:param var: the handle of the variable
:param pyoptinterface.VariableAttribute attr: the attribute to get
:return: the value of the attribute
```
### Delete variable
```{py:function} model.delete_variable(var)
delete a variable from the model
:param var: the handle of the variable
```
```{py:function} model.is_variable_active(var)
query whether a variable is active
:param var: the handle of the variable
:return: whether the variable is active
:rtype: bool
```
### Modify the bounds of variable
```{py:function} model.set_variable_bounds(var, lb, ub)
set the lower and upper bounds of a variable
:param var: the handle of the variable
:param float lb: the new lower bound value
:param float ub: the new upper bound value
```
## Expression
### Get the value of an expression (including variable)
```{py:function} model.get_value(expr_or_var)
get the value of an expression or a variable after optimization
:param expr_or_var: the handle of the expression or the variable
:return: the value of the expression or the variable
:rtype: float
```
### Pretty print expression (including variable)
```{py:function} model.pprint(expr_or_var)
pretty print an expression in a human-readable format
:param expr_or_var: the handle of the expression or the variable
:return: the human-readable format of the expression
:rtype: str
```
## Constraint
### Add a constraint to the model
- <project:#model.add_linear_constraint>
- <project:#model.add_quadratic_constraint>
- <project:#model.add_second_order_cone_constraint>
- <project:#model.add_sos_constraint>
### Add linear constraints as matrix form to the model
```{py:function} model.add_m_linear_constraints(A, vars, sense, b, [name=""])
add linear constraints as matrix form to the model $Ax \le b$ or $Ax = b$ or $Ax \ge b$
:param A: the matrix of coefficients, can be a dense `numpy.ndarray` or a sparse matrix `scipy.sparse.sparray`
:param vars: the variables in the constraints, can be a list or a 1-d `numpy.ndarray` returned by `add_m_variables`
:param pyoptinterface.ConstraintSense sense: the sense of the constraints
:param b: the right-hand side of the constraints, should be a 1-d `numpy.ndarray`
:param str name: the name of the constraints, optional
:return: the handles of linear constraints
:rtype: numpy.ndarray
```
### Get/set constraint attributes
```{py:function} model.set_constraint_attribute(con, attr, value)
set the value of a constraint attribute
:param con: the handle of the constraint
:param pyoptinterface.ConstraintAttribute attr: the attribute to set
:param value: the value to set
```
```{py:function} model.get_constraint_attribute(con, attr)
get the value of a constraint attribute
:param con: the handle of the constraint
:param pyoptinterface.ConstraintAttribute attr: the attribute to get
:return: the value of the attribute
```
### Delete constraint
```{py:function} model.delete_constraint(con)
delete a constraint from the model
:param con: the handle of the constraint
```
```{py:function} model.is_constraint_active(con)
query whether a constraint is active
:param con: the handle of the constraint
:return: whether the variable is active
:rtype: bool
```
### Modify constraint
```{py:function} model.set_normalized_rhs(con, value)
set the right-hand side of a normalized constraint
:param con: the handle of the constraint
:param value: the new right-hand side value
```
```{py:function} model.get_normalized_rhs(con)
get the right-hand side of a normalized constraint
:param con: the handle of the constraint
:return: the right-hand side value
```
```{py:function} model.set_normalized_coefficient(con, var, value)
set the coefficient of a variable in a normalized constraint
:param con: the handle of the constraint
:param var: the handle of the variable
:param value: the new coefficient value
```
```{py:function} model.get_normalized_coefficient(con, var)
get the coefficient of a variable in a normalized constraint
:param con: the handle of the constraint
:param var: the handle of the variable
:return: the coefficient value
```
## Objective
### Set the objective function
```{py:function} model.set_objective(expr, [sense=pyoptinterface.ObjectiveSense.Minimize])
set the objective function of the model
:param expr: the handle of the expression
:param pyoptinterface.ObjectiveSense sense: the sense of the objective function (Minimize/Maximize), defaults to Minimize
```
### Modify the linear part of the objective function
```{py:function} model.set_objective_coefficient(var, value)
modify the coefficient of a variable in the linear part of the objective function
:param var: the handle of the variable
:param float value: the new coefficient value
```
```{py:function} model.get_objective_coefficient(var)
get the coefficient of a variable in the linear part of the objective function
:param var: the handle of the variable
:return: the coefficient value
```
================================================
FILE: docs/source/conf.py
================================================
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "PyOptInterface"
copyright = "2024, Yue Yang"
author = "Yue Yang"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.githubpages",
"sphinx_copybutton",
"myst_nb",
]
source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".md": "myst-nb",
}
myst_enable_extensions = ["colon_fence", "amsmath", "dollarmath", "fieldlist"]
templates_path = ["_templates"]
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "furo"
html_static_path = ["_static"]
================================================
FILE: docs/source/constraint.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Constraint
PyOptInterface supports the following types of constraints:
- Linear Constraint
- Quadratic Constraint
- Second-Order Cone Constraint
- Special Ordered Set (SOS) Constraint
:::{note}
Not all optimizers support all types of constraints. Please refer to the documentation of the
optimizer you are using to see which types of constraints are supported.
:::
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import copt
model = copt.Model()
```
## Constraint Sense
The sense of a constraint can be one of the following:
- `poi.Eq`: equal
- `poi.Leq`: less than or equal
- `poi.Geq`: greater than or equal
They are the abbreviations of `poi.ConstraintSense.Equal`, `poi.ConstraintSense.LessEqual` or `poi.ConstraintSense.GreaterEqual` and can be used in the `sense` argument of the constraint creation functions.
## Linear Constraint
It is defined as:
$$
\begin{align}
\text{expr} &= a^T x + b &\leq \text{rhs} \\
\text{expr} &= a^T x + b &= \text{rhs} \\
\text{expr} &= a^T x + b &\geq \text{rhs}
\end{align}
$$
It can be added to the model using the `add_linear_constraint` method of the `Model` class.
```{code-cell}
x = model.add_variable(name="x")
y = model.add_variable(name="y")
con = model.add_linear_constraint(2.0*x + 3.0*y, poi.Leq, 1.0)
```
```{py:function} model.add_linear_constraint(expr, sense, rhs, [name=""])
add a linear constraint to the model
:param expr: the expression of the constraint
:param pyoptinterface.ConstraintSense sense: the sense of the constraint
:param float rhs: the right-hand side of the constraint
:param str name: the name of the constraint, optional
:return: the handle of the constraint
```
:::{note}
PyOptInterface provides <project:#pyoptinterface.Eq>, <project:#pyoptinterface.Leq>, and <project:#pyoptinterface.Geq> as alias of <project:#pyoptinterface.ConstraintSense> to represent the sense of the constraint with a shorter name.
:::
The linear constraint can also be created with a comparison operator, like `<=`, `==`, or `>=`:
```{code-cell}
model.add_linear_constraint(2.0*x + 3.0*y <= 1.0)
model.add_linear_constraint(2.0*x + 3.0*y == 1.0)
model.add_linear_constraint(2.0*x + 3.0*y >= 1.0)
```
If you want to express a two-sided linear constraint, you can use the `add_linear_constraint` method with a tuple to represent the left-hand side and right-hand side of the constraint like:
```{code-cell}
model.add_linear_constraint(2.0*x + 3.0*y, (1.0, 2.0))
```
which is equivalent to:
```{code-cell}
model.add_linear_constraint(2.0*x + 3.0*y, poi.Leq, 2.0)
model.add_linear_constraint(2.0*x + 3.0*y, poi.Geq, 1.0)
```
:::{note}
The two-sided linear constraint is not implemented for Gurobi because of its [special handling of range constraints](https://docs.gurobi.com/projects/optimizer/en/12.0/reference/c/model.html#c.GRBaddrangeconstr).
:::
## Quadratic Constraint
Like the linear constraint, it is defined as:
$$
\begin{align}
\text{expr} &= x^TQx + a^Tx + b &\leq \text{rhs} \\
\text{expr} &= x^TQx + a^Tx + b &= \text{rhs} \\
\text{expr} &= x^TQx + a^Tx + b &\geq \text{rhs}
\end{align}
$$
It can be added to the model using the `add_quadratic_constraint` method of the `Model` class.
```{code-cell}
x = model.add_variable(name="x")
y = model.add_variable(name="y")
expr = x*x + 2.0*x*y + 4.0*y*y
con = model.add_quadratic_constraint(expr, poi.ConstraintSense.LessEqual, 1.0)
```
```{py:function} model.add_quadratic_constraint(expr, sense, rhs, [name=""])
add a quadratic constraint to the model
:param expr: the expression of the constraint
:param pyoptinterface.ConstraintSense sense: the sense of the constraint, which can be `GreaterEqual`, `Equal`, or `LessEqual`
:param float rhs: the right-hand side of the constraint
:param str name: the name of the constraint, optional
:return: the handle of the constraint
```
Similarly, the quadratic constraint can also be created with a comparison operator, like `<=`, `==`, or `>=`:
```python
model.add_quadratic_constraint(x*x + 2.0*x*y + 4.0*y*y <= 1.0)
model.add_quadratic_constraint(x*x + 2.0*x*y + 4.0*y*y == 1.0)
model.add_quadratic_constraint(x*x + 2.0*x*y + 4.0*y*y >= 1.0)
```
:::{note}
Some solvers like COPT (as of 7.2.9) only supports convex quadratic constraints, which means the quadratic term must be positive semidefinite. If you try to add a non-convex quadratic constraint, an exception will be raised.
:::
The two-sided quadratic constraint can also be created with a tuple to represent the left-hand side and right-hand side of the constraint like:
```python
model.add_quadratic_constraint(x*x + 2.0*x*y + 4.0*y*y, (1.0, 2.0))
```
:::{note}
Currently, two-sided quadratic constraint is only implemented for IPOPT.
:::
## Second-Order Cone Constraint
It is defined as:
$$
variables=(t,x) \in \mathbb{R}^{N} : t \ge \lVert x \rVert_2
$$
It can be added to the model using the `add_second_order_cone_constraint` method of the `Model`
class.
```{code-cell}
N = 6
vars = [model.add_variable() for i in range(N)]
con = model.add_second_order_cone_constraint(vars)
```
There is another form of second-order cone constraint called as rotated second-order cone constraint, which is defined as:
$$
variables=(t_{1},t_{2},x) \in \mathbb{R}^{N} : 2 t_1 t_2 \ge \lVert x \rVert_2^2
$$
```{py:function} model.add_second_order_cone_constraint(variables, [name="", rotated=False])
add a second order cone constraint to the model
:param variables: the variables of the constraint, can be a list of variables
:param str name: the name of the constraint, optional
:param bool rotated: whether the constraint is a rotated second-order cone constraint, optional
:return: the handle of the constraint
```
## Exponential Cone Constraint
It is defined as:
$$
variables=(t,s,r) \in \mathbb{R}^{3} : t \ge s \exp(\frac{r}{s}), s \ge 0
$$
The dual form is:
$$
variables=(t,s,r) \in \mathbb{R}^{3} : t \ge -r \exp(\frac{s}{r} - 1), r \le 0
$$
Currently, only COPT(after 7.1.4), Mosek support exponential cone constraint natively.
Xpress supports exponential cones by mapping them into generic NLP formulas at the API level.
It can be added to the model using the `add_exp_cone_constraint` method of the `Model` class.
```{py:function} model.add_exp_cone_constraint(variables, [name="", dual=False])
add a second order cone constraint to the model
:param variables: the variables of the constraint, can be a list of variables
:param str name: the name of the constraint, optional
:param bool dual: whether the constraint is dual form of exponential cone, optional
:return: the handle of the constraint
```
## Special Ordered Set (SOS) Constraint
SOS constraints are used to model special structures in the optimization problem.
It contains two types: `SOS1` and `SOS2`, the details can be found in [Wikipedia](https://en.wikipedia.org/wiki/Special_ordered_set).
It can be added to the model using the `add_sos_constraint` method of the `Model` class.
```{code-cell}
N = 6
vars = [model.add_variable(domain=poi.VariableDomain.Binary) for i in range(N)]
con = model.add_sos_constraint(vars, poi.SOSType.SOS1)
```
```{py:function} model.add_sos_constraint(variables, sos_type, [weights])
add a special ordered set constraint to the model
:param variables: the variables of the constraint, can be a list of variables
:param pyoptinterface.SOSType sos_type: the type of the SOS constraint, which can be `SOS1` or `SOS2`
:param weights: the weights of the variables, optional, will be set to 1 if not provided
:type weights: list[float]
:return: the handle of the constraint
```
## Constraint Attributes
After a constraint is created, we can query or modify its attributes. The following table lists the
standard [constraint attributes](#pyoptinterface.ConstraintAttribute):
:::{list-table} **Standard [constraint attributes](#pyoptinterface.ConstraintAttribute)**
:header-rows: 1
:widths: 20 20
* - Attribute name
- Type
* - Name
- str
* - Primal
- float
* - Dual
- float
* - IIS
- bool
:::
The most common attribute we will use is the `Dual` attribute, which represents the dual multiplier of the constraint after optimization.
```python
# get the dual multiplier of the constraint after optimization
dual = model.get_constraint_attribute(con, poi.ConstraintAttribute.Dual)
```
## Delete constraint
We can delete a constraint by calling the `delete_constraint` method of the model:
```python
model.delete_constraint(con)
```
After a constraint is deleted, it cannot be used in the model anymore, otherwise an exception
will be raised.
We can query whether a constraint is active by calling the `is_constraint_active` method of the
model:
```python
is_active = model.is_constraint_active(con)
```
## Modify constraint
For linear and quadratic constraints, we can modify the right-hand side of a constraint by
calling the `set_normalized_rhs` method of the model.
For linear constraints, we can modify the coefficients of the linear part of the constraint by
calling the `set_normalized_coefficient` method of the model.
```python
con = model.add_linear_constraint(x + y, poi.Leq, 1.0)
# modify the right-hand side of the constraint
model.set_normalized_rhs(con, 2.0)
# modify the coefficient of the linear part of the constraint
model.set_normalized_coefficient(con, x, 2.0)
```
================================================
FILE: docs/source/container.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Container
In our previous examples, we only use scalar variable, constraint and expression. However, in many cases, we need to handle a large number of variables, constraints and expressions.
In general, PyOptInterface does not restrict the ways to store these objects. You can use a list, a dictionary, or any other data structure to store them, because PyOptInterface only requires the handle of the object to manipulate it and each handle is a compact C++ object that can be easily stored and passed around. In other words, we follow the Bring Your Own Container (BYOC) principle.
However, in the context of optimization, we often needs to represent the model in a more structured way. The most classic example is [`Set`](https://ampl.com/wp-content/uploads/Chapter-5-Simple-Sets-and-Indexing-AMPL-Book.pdf) in AMPL, which provides a flexible way to represent multi-dimensional data with custom indexing. The concept is also widely used in other optimization modeling languages, such as [JuMP](https://jump.dev/JuMP.jl/stable/manual/containers/) in Julia and [Pyomo](https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Sets.html) in Python.
In PyOptInterface, we provide a simple container named `tupledict` to represent multidimensional data. It is a dictionary-like object that can be indexed by multiple keys. It is a convenient way to store and manipulate multi-dimensional data in PyOptInterface. The design and usage of `tupledict` is inspired by the `tupledict` in [gurobipy](https://www.gurobi.com/documentation/current/refman/py_tupledict.html).
We will use `tupledict` to demonstrate how to use a container to store and manipulate multi-dimensional data in PyOptInterface.
Simply speaking, `tupledict` is a derived class of Python dict where the keys represent multidimensional indices as n-tuple, and the values are typically variables, constraints or expressions.
## Create a `tupledict`
`tuplelist` can be created by calling the `tupledict` constructor. The following example creates a `tupledict` with two keys:
```{code-cell}
import pyoptinterface as poi
td = poi.tupledict()
td[1, 2] = 3
td[4, 5] = 6
print(td)
```
It can also be created by passing a dictionary to the constructor:
```{code-cell}
td = poi.tupledict({(1, 2): 3, (4, 5): 6})
```
In most cases, we have multiple indices as the axis and define a rule to construct the `tupledict`. `make_tupledict` provide a convenient way to create a `tupledict` from a list of indices and a function that maps the indices to the values. The following example creates a `tupledict` with two keys:
```{code-cell}
I = range(3)
J = [6, 7]
K = ("Asia", "Europe")
def f(i, j, k):
return f"value_{i}_{j}_{k}"
td = poi.make_tupledict(I, J, K, rule=f)
print(td)
```
Sometimes we need to create a `tupledict` with a sparse pattern where some combinations of indices are missing. `make_tupledict` also provides a convenient way to create a `tupledict` with a sparse pattern, you only need to return `None` when the corresponding value is unwanted. The following example creates a `tupledict` with a sparse pattern:
```{code-cell}
I = range(3)
J = [6, 7]
K = ("Asia", "Europe")
def f(i, j, k):
if i == 0 and j == 6 and k == "Asia":
return "value_0_6_Asia"
else:
return None
td = poi.make_tupledict(I, J, K, rule=f)
print(td)
```
For highly sparse patterns, you can provide the sparse indices directly to make it more efficient.
```
I = range(2)
J = range(8)
K = range(8)
# We only want to construct (i, j, k) where j=k
JK = [(j, j) for j in J]
def f(i, j, k):
return f"value_{i}_{j}_{k}"
# JK will be flattened as j and k during construction
td = poi.make_tupledict(I, JK, rule=f)
print(td)
```
## Set/get values
Like normal dictionary in Python, the values of a `tupledict` can be set or get by using the `[]` operator. The following example sets and gets the values of a `tupledict`:
```{code-cell}
td = poi.tupledict({(1, 2): 3, (4, 5): 6})
td[1, 2] = 4
print(f"{td[1, 2]=}")
td[4, 8] = 7
print(f"{td[4, 8]=}")
```
As a representation of multidimensional data, `tupledict` also provides a way to iterate some axis efficiently.
`tupledict.select` can be used to select a subset of the `tupledict` by fixing some indices. The following example selects a subset of the `tupledict`:
```{code-cell}
td = poi.make_tupledict(range(3), range(3), range(3), rule=lambda i, j, k: f"value_{i}_{j}_{k}")
# Select the subset where i=1
# "*" means wildcard that matches any value for j and k
# select returns a generator and can be converted to a list
subset_values_iterator = td.select(1, "*", "*")
subset_values = list(subset_values_iterator)
# Select the subset where j=2 and k=1
subset_values = list(td.select("*", 2, 1))
# the iterator can retuen the (key, value) pair if we pass with_key=True to select
subset_kv_iterator = td.select(1, "*", "*", with_key=True)
```
## Apply a function to values with `map` method
`tupledict` provides a `map` method to apply a function to each value in the `tupledict`. The following example applies a function to each value in the `tupledict`:
```{code-cell}
td = poi.make_tupledict(range(3), range(2), rule=lambda i, j: i+j)
td_new = td.map(lambda x: x*x)
td, td_new
```
## Building a model with `tupledict`
`tupledict` can be used to store and manipulate multi-dimensional variables, constraints and expressions. Using it correctly will make building model more easily.
The following example demonstrates how to use `tupledict` to build a model:
$$
\min \quad & \sum_{i=0}^{I} \sum_{j=0}^{J} x_{ij}^2 \\
\textrm{s.t.} \quad & \sum_{i=0}^{I} x_{ij} = 1, \quad \forall j \\
\quad & x_{ij} \geq 0, \quad \forall i, j
$$
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import highs
model = highs.Model()
I = range(10)
J = range(20)
x = poi.make_tupledict(I, J, rule=lambda i, j: model.add_variable(lb=0, name=f"x({i},{j})"))
def constraint_rule(j):
expr = poi.quicksum(x.select("*", j))
con = model.add_linear_constraint(expr, poi.ConstraintSense.Equal, 1, name=f"con_{j}")
return con
constraint = poi.make_tupledict(J, rule=constraint_rule)
obj = poi.quicksum(x.values(), lambda x: x*x)
model.set_objective(obj, poi.ObjectiveSense.Minimize)
model.optimize()
x_value = x.map(model.get_value)
```
Here we use two utility functions to simplify how we express the sum notation
```{py:function} quicksum(values, [f=None])
Create a new expression by summing up a list of values (optionally, you can apply a function to
each value in advance)
:param values: iterator of values
:param f: a function that takes a value and returns a new value
:return: the handle of the new expression
:rtype: pyoptinterface.ExprBuilder
```
There is also an in-place version:
```{py:function} quicksum_(expr, values, [f=None])
Add a list of values to an existing expression (optionally, you can apply a function to each value in advance)
:param pyoptinterface.ExprBuilder expr: the handle of the existing expression
:param values: iterator of values
:param f: a function that takes a value and returns a new value
:return: None
```
We notice that `poi.make_tupledict(I, J, rule=lambda i, j: model.add_variable(lb=0, name=f"x({i},{j})"))` is a frequently used pattern to create a `tupledict` of variables, so we provide a convenient way to create a `tupledict` of variables by calling [`model.add_variables`](#model.add_variables):
```python
x = model.add_variables(I, J, lb=0, name="x")
```
================================================
FILE: docs/source/copt.md
================================================
# COPT
## Initial setup
```python
from pyoptinterface import copt
model = copt.Model()
```
You need to follow the instructions in [Getting Started](getting_started.md#copt) to set up the optimizer correctly.
If you want to manage the license of COPT manually, you can create a `copt.Env` object and pass it to the constructor of the `copt.Model` object, otherwise we will initialize an implicit global `copt.Env` object automatically and use it.
```python
env = copt.Env()
model = copt.Model(env)
```
## The capability of `copt.Model`
### Supported constraints
:::{list-table}
:header-rows: 1
* - Constraint
- Supported
* - <project:#model.add_linear_constraint>
- ✅
* - <project:#model.add_quadratic_constraint>
- ✅
* - <project:#model.add_second_order_cone_constraint>
- ✅
* - <project:#model.add_exp_cone_constraint>
- ✅
* - <project:#model.add_sos_constraint>
- ✅
:::
```{include} attribute/copt.md
```
## Solver-specific operations
### Parameter
For [solver-specific parameters](https://guide.coap.online/copt/en-doc/parameter.html), we provide `get_raw_parameter` and `set_raw_parameter` methods to get and set the parameters.
```python
model = copt.Model()
# get the value of the parameter
value = model.get_raw_parameter("TimeLimit")
# set the value of the parameter
model.set_raw_parameter("TimeLimit", 10.0)
```
### Attribute
COPT supports [attribute](https://guide.coap.online/copt/en-doc/attribute.html) for the model. We provide `model.get_raw_attribute(name:str)` to get the value of attribute.
### Information
COPT provides [information](https://guide.coap.online/copt/en-doc/information.html) for the model components. We provide methods to access the value of information.
- Information of variable: `model.get_variable_info(variable, name: str)`
- Information of constraint: `model.get_constraint_info(constraint, name: str)`
We also provide `copt.COPT` to contain all the constants in `coptpy.COPT`.
For number of variables (columns) in the problem:
```python
cols = model.get_raw_attribute(copt.COPT.Attr.Cols)
```
For reduced cost of a variable:
```python
rc = model.get_variable_info(variable, copt.COPT.Info.RedCost)
```
For upper bound of a constraint:
```python
ub = model.get_constraint_info(constraint, copt.COPT.Info.UB)
```
================================================
FILE: docs/source/develop.md
================================================
# Developer Guide
This section is intended for developers who want to contribute to the PyOptInterface library. It provides an overview of the codebase, the development process, and the guidelines for contributing to the project.
## Codebase Overview
The PyOptInterface library is a C++/Python mixed library. The core parts are implemented in C++ and exposed to Python via [nanobind](https://github.com/wjakob/nanobind). The build system is based on [scikit-build-core](https://github.com/scikit-build/scikit-build-core).
The codebase is organized as follows:
- `include/pyoptinterface`: The header files of the C++ library.
- `lib`: The source files of the C++ library.
- `src`: The Python interface.
- `tests`: The test cases.
- `thirdparty`: The third-party dependencies.
## Development Process
Supposing you want to contribute to PyOptInterface, you can follow these steps:
Firstly, fork the [PyOptInterface repository](https://github.com/metab0t/PyOptInterface) on GitHub and clone your forked repository to your local machine: `git clone https://github.com/<your-username>/PyOptInterface.git`.
Next, you should set up the development environment. The third-party optimizers must be configured following the instructions in [getting started](getting_started.md). In order to build PyOptInterface from source, you need the following dependencies:
- CMake
- A recent C++ compiler (We routinely test with GCC 10, latest MSVC and Apple Clang on the CI)
- Python 3.8 or later
- Python packages: `scikit-build-core`, can be installed by running `pip install scikit-build-core[pyproject]`
Then, you can build the project by running the following commands:
```bash
pip install --no-build-isolation -ve .
```
You will see a new `build` directory created in the project root. The Python package is installed in editable mode, so you can modify the source code and test the changes without reinstalling the package.
After making changes to the code, you should run the test cases to ensure that everything is working as expected. You can run the test cases by executing the following command (installing `pytest` is required):
```bash
pytest tests
```
The tests of PyOptInterface are still scarce, so you are encouraged to write new test cases for the new features you add.
Finally, you can submit a pull request to the [PyOptInterface repository](https://github.com/metab0t/PyOptInterface)
## Building Documentation
The documentation of PyOptInterface is built using [Sphinx](https://www.sphinx-doc.org/).
Firstly, you should install the dependencies for building the documentation:
```bash
pip install -r docs/requirements.txt
```
You can build the documentation by running the following commands:
```bash
cd docs
make html
```
The docs are built in the `docs/build/html` directory. You can open the `index.html` file in a web browser to view the documentation.
## Contributing Guidelines
When contributing to PyOptInterface, please follow these guidelines:
- Make sure that the code is well formatted and documented. The C++ code is formatted using [clang-format](https://clang.llvm.org/docs/ClangFormat.html) and the Python code is formatted using [black](https://black.readthedocs.io/en/stable/).
- For big changes like adding interface for a new optimizer, please open a thread in [**Discussion**](https://github.com/metab0t/PyOptInterface/discussions) to discuss the design before starting the implementation.
================================================
FILE: docs/source/examples/economic_dispatch.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Economic Dispatch
Economic dispatch is a classic optimization problem in power systems. It is used to determine the optimal power output of a set of generators to meet the demand at the lowest cost. The problem can be formulated as a linear programming problem or a quadratic programming problem depending on the formulation used to model the economic cost.
In this example, we will show how to use PyOptInterface to solve an economic dispatch problem using the quadratic programming formulation.
## Problem Formulation
$$
\min \quad & \sum_{t=1}^T \sum_{i=1}^{N_G} a_i P_{i,t}^2 + b_i P_{i,t} + c_i \\
\textrm{s.t.} \quad & \sum_{i=1}^{N_G} P_{i,t} = \sum_{i=1}^{N_D} D_{i,t}\\
\quad & P_{min,i} \leq P_{i,t} \leq P_{max,i} \\
\quad & -Rdn_{i} \leq P_{i,t} - P_{i,t-1} \leq Rup_{i}
$$
We consider a system with $N_G$ generators and $N_D$ demands. The decision variables are the power output of the generators $P_{i,t}$ for $i=1,\ldots,N_G$ and $t=1,\ldots,T$. The objective function is the total cost of the generators, which is the sum of the quadratic cost, the linear cost, and the constant cost. The first constraint ensures that the total power output of the generators meets the demand. The second and third constraints are the power output limits of the generators. The last constraint is the ramping limits of the generators.
## Implementation
Firstly, we need to create a model object. We will use the HiGHS solver in this example because it is an excellent open-source solver and supports quadratic programming problems. You need to read the [installation guide](../highs.md#initial-setup) to install the HiGHS solver manually and set the path to shared library of HiGHS as described in the guide.
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import highs
model = highs.Model()
```
Then, we need to create new variables in the model to represent the power output of the generators. We will use the [`add_variables`](#model.add_variables) method to add multidimensional variables to the model.
```{code-cell}
T = 24
N_G = 3
P_min = [50, 50, 50]
P_max = [100, 100, 100]
a_cost = [0.01, 0.015, 0.02]
b_cost = [1, 1.5, 2]
c_cost = [0, 0, 0]
Rup = [20, 20, 20]
Rdn = [20, 20, 20]
P = model.add_variables(range(N_G), range(T), name="P")
```
For the lower and upper bound of variables, we can set the corresponding [variable attribute](#pyoptinterface.VariableAttribute) to set them.
```{code-cell}
for i in range(N_G):
for t in range(T):
model.set_variable_attribute(P[i, t], poi.VariableAttribute.LowerBound, P_min[i])
model.set_variable_attribute(P[i, t], poi.VariableAttribute.UpperBound, P_max[i])
```
Next, we need to add the power balance constraint to the model. We will use the [`add_linear_constraint`](#model.add_linear_constraint) method to add a linear constraint to the model. The multidimensional constraint is managed by `tupledict` and we use the `make_tupledict` method to create a multidimensional constraint.
The total demand is assumed to be a constant in this example.
```{code-cell}
total_demand = [220 for _ in range(T)]
def con(t):
lhs = poi.quicksum(P[i, t] for i in range(N_G))
rhs = total_demand[t]
return model.add_linear_constraint(lhs, poi.Eq, rhs, name=f"powerbalance_{t}")
powebalance_constraints = poi.make_tupledict(range(T), rule=con)
```
```{code-cell}
def rampup_con(i, t):
if t == 0:
return None
lhs = P[i, t] - P[i, t-1]
rhs = Rup[i]
return model.add_linear_constraint(lhs, poi.Leq, rhs, name=f"rampup_{i}_{t}")
rampup_constraints = poi.make_tupledict(range(N_G), range(T), rule=rampup_con)
def rampdown_con(i, t):
if t == 0:
return None
lhs = P[i, t] - P[i, t-1]
rhs = -Rdn[i]
return model.add_linear_constraint(lhs, poi.Geq, rhs, name=f"rampdown_{i}_{t}")
rampdown_constraints = poi.make_tupledict(range(N_G), range(T), rule=rampdown_con)
```
Then, we need to add the quadratic objective function to the model. We will use the [`set_objective`](#model.set_objective) method to set the objective function of the model.
```{code-cell}
obj = poi.ExprBuilder()
for t in range(T):
for i in range(N_G):
obj += a_cost[i] * P[i, t] * P[i, t] + b_cost[i] * P[i, t] + c_cost[i]
model.set_objective(obj)
```
Finally, we can solve the model and query the solution.
```{code-cell}
model.optimize()
print(model.get_model_attribute(poi.ModelAttribute.TerminationStatus))
print("Objective value: ", model.get_value(obj))
```
The optimal value of decision variables can be queried via `get_value` function.
```{code-cell}
import numpy as np
P_value = np.fromiter(
(model.get_value(P[i, t]) for i in range(N_G) for t in range(T)), float
).reshape(N_G, T)
P_value
```
## Change the load and solve the model again
We can change the load and solve the model again without creating a new model from scratch by modifying the right-hand side of the power balance constraint.
For example, we increase the load and solve the model again.
```{code-cell}
total_demand = [220 + 1.0 * t for t in range(T)]
for t in range(T):
model.set_normalized_rhs(powebalance_constraints[t], total_demand[t])
model.optimize()
print(model.get_model_attribute(poi.ModelAttribute.TerminationStatus))
print("Objective value: ", model.get_value(obj))
P_value = np.fromiter(
(model.get_value(P[i, t]) for i in range(N_G) for t in range(T)), float
).reshape(N_G, T)
print(P_value)
```
================================================
FILE: docs/source/examples/optimal_control_rocket.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Optimal Control of a Rocket
This example is adapted from [the JuMP tutorial](https://jump.dev/JuMP.jl/stable/tutorials/nonlinear/rocket_control/).
The goal is to show that there are explicit repeated structures in discretized optimal control problem regarded as a nonlinear program (NLP). We will use the optimal control of a rocket as an example to demonstrate how to exploit these structures to solve the problem more efficiently via PyOptInterface.
## Problem Formulation
The problem is to find the optimal control of a rocket to maximize the altitude at the final time while satisfying the dynamics of the rocket. The dynamics of the rocket are described by the following ordinary differential equations (ODEs):
$$
\begin{align*}
\frac{dh}{dt} &= v \\
\frac{dv}{dt} &= -g(h) + \frac{u-D(h,v)}{m} \\
\frac{dm}{dt} &= -\frac{u}{c}
\end{align*}
$$
where $h$ is the altitude, $v$ is the velocity, $m$ is the mass, $u$ is the thrust, $g(h)$ is the gravitational acceleration, and $D(h,v)$ is the drag force. The thrust $u$ is the control variable.
The drag force is given by $D(h,v) = D_c v^2 \exp(-h_c \frac{h-h_0}{h_0})$, and the gravitational acceleration is given by $g(h) = g_0 (\frac{h_0}{h})^2$.
By discretizing the ODEs, we obtain the following nonlinear program:
$$
\begin{align*}
\frac{h_{t+1}-h_t}{\Delta t} &= v_t \\
\frac{v_{t+1}-v_t}{\Delta t} &= -g(h_t) + \frac{u_t-D(h_t,v_t)}{m_t} \\
\frac{m_{t+1}-m_t}{\Delta t} &= -\frac{u_t}{c}
\end{align*}
$$
where $h_t$, $v_t$, and $m_t$ are the altitude, velocity, and mass at time $t$, respectively, and $\Delta t$ is the time step.
## Implementation
In the discretized optimal control problem, the variables at two adjacent time points share the same algebraic relationship.
```{code-cell}
import math
import pyoptinterface as poi
from pyoptinterface import nl, ipopt
model = ipopt.Model()
h_0 = 1.0
v_0 = 0.0
m_0 = 1.0
g_0 = 1.0
T_c = 3.5
h_c = 500.0
v_c = 620.0
m_c = 0.6
c = 0.5 * math.sqrt(g_0 * h_0)
m_f = m_c * m_0
D_c = 0.5 * v_c * (m_0 / g_0)
T_max = T_c * m_0 * g_0
nh = 1000
```
Then, we declare variables and set boundary conditions.
```{code-cell}
h = model.add_m_variables(nh, lb=1.0)
v = model.add_m_variables(nh, lb=0.0)
m = model.add_m_variables(nh, lb=m_f, ub=m_0)
T = model.add_m_variables(nh, lb=0.0, ub=T_max)
step = model.add_variable(lb=0.0)
# Boundary conditions
model.set_variable_bounds(h[0], h_0, h_0)
model.set_variable_bounds(v[0], v_0, v_0)
model.set_variable_bounds(m[0], m_0, m_0)
model.set_variable_bounds(m[-1], m_f, m_f)
```
Next, we add the dynamics constraints.
```{code-cell}
for i in range(nh - 1):
with nl.graph():
h1 = h[i]
h2 = h[i + 1]
v1 = v[i]
v2 = v[i + 1]
m1 = m[i]
m2 = m[i + 1]
T1 = T[i]
T2 = T[i + 1]
model.add_nl_constraint(h2 - h1 - 0.5 * step * (v1 + v2) == 0)
D1 = D_c * v1 * v1 * nl.exp(-h_c * (h1 - h_0)) / h_0
D2 = D_c * v2 * v2 * nl.exp(-h_c * (h2 - h_0)) / h_0
g1 = g_0 * h_0 * h_0 / (h1 * h1)
g2 = g_0 * h_0 * h_0 / (h2 * h2)
dv1 = (T1 - D1) / m1 - g1
dv2 = (T2 - D2) / m2 - g2
model.add_nl_constraint(v2 - v1 - 0.5 * step * (dv1 + dv2) == 0)
model.add_nl_constraint(m2 - m1 + 0.5 * step * (T1 + T2) / c == 0)
```
Finally, we add the objective function. We want to maximize the altitude at the final time, so we set the objective function to be the negative of the altitude at the final time.
```{code-cell}
model.set_objective(-h[-1])
```
After solving the problem, we can plot the results.
```{code-cell}
model.optimize()
```
```{code-cell}
h_value = []
for i in range(nh):
h_value.append(model.get_value(h[i]))
print("Optimal altitude: ", h_value[-1])
```
The plot of the altitude of the rocket is shown below.
```{code-cell}
import matplotlib.pyplot as plt
plt.plot(h_value)
plt.xlabel("Time")
plt.ylabel("Altitude")
plt.show()
```
================================================
FILE: docs/source/examples/optimal_power_flow.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Optimal Power Flow
Alternating current optimal power flow (ACOPF) is a fundamental nonlinear optimization problem in power systems. It is used to determine the optimal power flow of a power system to minimize the generation cost while satisfying the power flow equations and system constraints.
In this example, we will show how to use PyOptInterface to solve an single-period optimal power flow problem using the structured nonlinear programming formulation.
## Problem Formulation
$$
\min \quad & \sum_{i \in G} a_i P_{i}^2 + b_i P_{i} + c_i \\
\textrm{s.t.} \quad & \theta_r = 0 \quad & \forall r \in R \\
\quad & P_{min,i} \leq P_{i} \leq P_{max,i} \quad & \forall i \in G \\
\quad & Q_{min,i} \leq Q_{i} \leq Q_{max,i} \quad & \forall i \in G \\
\quad & V_{min,b} \leq V_{b} \leq V_{max,b} \quad & \forall b \in BUS \\
\quad & \sum_{i \in G_b} P_{i} - \sum_{i \in D_b} L^P_{i} - G_{sh,b} V_b^2 = \sum_{(i, j) \in BRANCH} P_{ij} \quad & \forall b \in BUS \\
\quad & \sum_{i \in G_b} Q_{i} - \sum_{i \in D_b} L^Q_{i} + B_{sh,b} V_b^2 = \sum_{(i, j) \in BRANCH} Q_{ij} \quad & \forall b \in BUS \\
\quad & P_{ij} = G_{ij} V_i^2 - V_i V_j (G_{ij}\cos(\theta_i-\theta_j)+B_{ij}\sin(\theta_i-\theta_j)) \quad & \forall (i, j) \in BRANCH \\
\quad & Q_{ij} = -B^C_{ij} V_i^2 - B_{ij} V_i^2 - V_i V_j (G_{ij}\sin(\theta_i-\theta_j)-B_{ij}\cos(\theta_i-\theta_j)) \quad & \forall (i, j) \in BRANCH \\
\quad & P_{ji} = G_{ij} V_j^2 - V_i V_j (G_{ij}\cos(\theta_j-\theta_i)+B_{ij}\sin(\theta_j-\theta_i)) \quad & \forall (i, j) \in BRANCH \\
\quad & Q_{ji} = -B^C_{ij} V_j^2 - B_{ij} V_j^2 - V_i V_j (G_{ij}\sin(\theta_j-\theta_i)-B_{ij}\cos(\theta_j-\theta_i)) \quad & \forall (i, j) \in BRANCH \\
\quad & -S_{max,ij} \leq P_{ij}^2 + Q_{ij}^2 \leq S_{max,ij} \quad & \forall (i, j) \in BRANCH \\
\quad & -\Delta\theta_{min,ij} \leq \theta_i - \theta_j \leq -\Delta\theta_{max,ij} \quad & \forall (i, j) \in BRANCH
$$
The decision variables are the active power output of the generators $P_{i}$, reactive power output of the generators $Q_{i}$, voltage magnitude of the buses $V_{b}$, phase angle of the buses $\theta_{b}$ for $b \in BUS$ and the branch power flows $P_{ij}$ and $Q_{ij}$ for $(i, j) \in BRANCH$.
The objective function is the total cost of the generators, which is the sum of the quadratic cost, the linear cost, and the constant cost. The first constraint ensures that the phase angle of the reference bus is zero. The second and third constraints are the active and reactive power output limits of the generators. The fourth constraint is the voltage magnitude limits of the buses. The fifth and sixth constraints are the power balance equations of the buses. The seventh and eighth constraints are the power flow equations of the branches. The ninth and tenth constraints are the power flow equations of the branches in the opposite direction. The eleventh and twelfth constraints are the apparent power limits of the branches. The last constraint is the phase angle difference limits of the branches.
## Implementation
We will use PJM 5-bus system as an example to demonstrate the implementation of the optimal power flow problem. The PJM 5-bus system is a small power system with 5 buses and 6 branches. The system data is shown below.
```{code-cell}
branches = [
# (from, to, R, X, B, angmin, angmax, Smax)
(0, 1, 0.00281, 0.0281, 0.00712, -30.0, 30.0, 4.00),
(0, 3, 0.00304, 0.0304, 0.00658, -30.0, 30.0, 4.26),
(0, 4, 0.00064, 0.0064, 0.03126, -30.0, 30.0, 4.26),
(1, 2, 0.00108, 0.0108, 0.01852, -30.0, 30.0, 4.26),
(2, 3, 0.00297, 0.0297, 0.00674, -30.0, 30.0, 4.26),
(3, 4, 0.00297, 0.0297, 0.00674, -30.0, 30.0, 2.40),
]
buses = [
# (Pd, Qd, Gs, Bs, Vmin, Vmax)
(0.0, 0.0000, 0.0, 0.0, 0.9, 1.1),
(3.0, 0.9861, 0.0, 0.0, 0.9, 1.1),
(3.0, 0.9861, 0.0, 0.0, 0.9, 1.1),
(4.0, 1.3147, 0.0, 0.0, 0.9, 1.1),
(0.0, 0.0000, 0.0, 0.0, 0.9, 1.1),
]
generators = [
# (bus, Pmin, Pmax, Qmin, Qmax, a, b, c)
(0, 0.0, 0.4, -0.300, 0.300, 0.0, 1400, 0.0),
(0, 0.0, 1.7, -1.275, 1.275, 0.0, 1500, 0.0),
(2, 0.0, 5.2, -3.900, 3.900, 0.0, 3000, 0.0),
(3, 0.0, 2.0, -1.500, 1.500, 0.0, 4000, 0.0),
(4, 0.0, 6.0, -4.500, 4.500, 0.0, 1000, 0.0),
]
slack_bus = 3
```
Then we declare the variables:
```{code-cell}
import math
import pyoptinterface as poi
from pyoptinterface import nl, ipopt
model = ipopt.Model()
N_branch = len(branches)
N_bus = len(buses)
N_gen = len(generators)
Pbr_from = model.add_m_variables(N_branch)
Qbr_from = model.add_m_variables(N_branch)
Pbr_to = model.add_m_variables(N_branch)
Qbr_to = model.add_m_variables(N_branch)
V = model.add_m_variables(N_bus, name="V")
theta = model.add_m_variables(N_bus, name="theta")
for i in range(N_bus):
Vmin, Vmax = buses[i][4], buses[i][5]
model.set_variable_bounds(V[i], Vmin, Vmax)
model.set_variable_bounds(theta[slack_bus], 0.0, 0.0)
P = model.add_variables(range(N_gen), name="P")
Q = model.add_variables(range(N_gen), name="Q")
for i in range(N_gen):
model.set_variable_bounds(P[i], generators[i][1], generators[i][2])
model.set_variable_bounds(Q[i], generators[i][3], generators[i][4])
```
Next, we add the constraints:
```{code-cell}
# nonlinear constraints
for k in range(N_branch):
with nl.graph():
branch = branches[k]
R, X, Bc2 = branch[2], branch[3], branch[4]
G = R / (R**2 + X**2)
B = -X / (R**2 + X**2)
Bc = Bc2 / 2
i = branch[0]
j = branch[1]
Vi = V[i]
Vj = V[j]
theta_i = theta[i]
theta_j = theta[j]
Pij = Pbr_from[k]
Qij = Qbr_from[k]
Pji = Pbr_to[k]
Qji = Qbr_to[k]
sin_ij = nl.sin(theta_i - theta_j)
cos_ij = nl.cos(theta_i - theta_j)
Pij_eq = G * Vi**2 - Vi * Vj * (G * cos_ij + B * sin_ij) - Pij
Qij_eq = -(B + Bc) * Vi**2 - Vi * Vj * (G * sin_ij - B * cos_ij) - Qij
Pji_eq = G * Vj**2 - Vi * Vj * (G * cos_ij - B * sin_ij) - Pji
Qji_eq = -(B + Bc) * Vj**2 - Vi * Vj * (-G * sin_ij - B * cos_ij) - Qji
model.add_nl_constraint(
Pij_eq == 0.0,
)
model.add_nl_constraint(
Qij_eq == 0.0,
)
model.add_nl_constraint(
Pji_eq == 0.0,
)
model.add_nl_constraint(
Qji_eq == 0.0,
)
# power balance constraints
P_balance_eq = [poi.ExprBuilder() for i in range(N_bus)]
Q_balance_eq = [poi.ExprBuilder() for i in range(N_bus)]
for b in range(N_bus):
Pd, Qd = buses[b][0], buses[b][1]
Gs, Bs = buses[b][2], buses[b][3]
Vb = V[b]
P_balance_eq[b] -= poi.quicksum(
Pbr_from[k] for k in range(N_branch) if branches[k][0] == b
)
P_balance_eq[b] -= poi.quicksum(
Pbr_to[k] for k in range(N_branch) if branches[k][1] == b
)
P_balance_eq[b] += poi.quicksum(
P[i] for i in range(N_gen) if generators[i][0] == b
)
P_balance_eq[b] -= Pd
P_balance_eq[b] -= Gs * Vb * Vb
Q_balance_eq[b] -= poi.quicksum(
Qbr_from[k] for k in range(N_branch) if branches[k][0] == b
)
Q_balance_eq[b] -= poi.quicksum(
Qbr_to[k] for k in range(N_branch) if branches[k][1] == b
)
Q_balance_eq[b] += poi.quicksum(
Q[i] for i in range(N_gen) if generators[i][0] == b
)
Q_balance_eq[b] -= Qd
Q_balance_eq[b] += Bs * Vb * Vb
model.add_quadratic_constraint(P_balance_eq[b], poi.Eq, 0.0)
model.add_quadratic_constraint(Q_balance_eq[b], poi.Eq, 0.0)
for k in range(N_branch):
branch = branches[k]
i = branch[0]
j = branch[1]
theta_i = theta[i]
theta_j = theta[j]
angmin = branch[5] / 180 * math.pi
angmax = branch[6] / 180 * math.pi
model.add_linear_constraint(theta_i - theta_j, (angmin, angmax))
Smax = branch[7]
Pij = Pbr_from[k]
Qij = Qbr_from[k]
Pji = Pbr_to[k]
Qji = Qbr_to[k]
model.add_quadratic_constraint(Pij * Pij + Qij * Qij, poi.Leq, Smax * Smax)
model.add_quadratic_constraint(Pji * Pji + Qji * Qji, poi.Leq, Smax * Smax)
```
Finally, we set the objective function:
```{code-cell}
cost = poi.ExprBuilder()
for i in range(N_gen):
a, b, c = generators[i][5], generators[i][6], generators[i][7]
cost += a * P[i] * P[i] + b * P[i] + c
model.set_objective(cost)
```
After optimization, we can retrieve the optimal solution:
```{code-cell}
model.optimize()
```
```{code-cell}
print(model.get_model_attribute(poi.ModelAttribute.TerminationStatus))
P_value = P.map(model.get_value)
print("Optimal active power output of the generators:")
for i in range(N_gen):
print(f"Generator {i}: {P_value[i]}")
```
================================================
FILE: docs/source/expression.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Expression
## Basic expression
PyOptInterface currently supports polynomial expressions with degree up to 2, including
- quadratic expression
- linear expression
- constant expression
The expression can be expressed by arithmetic operations of variables and constants. For example, we can create a quadratic expression by adding two quadratic expressions, multiplying a linear expression with a constant expression, etc.
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import highs
model = highs.Model()
x = model.add_variable()
# create a quadratic expression
expr1 = x * x + 2 * x + 1
# create a linear expression
expr2 = 2 * x + 1
# create a quadratic expression by adding two quadratic expressions
expr3 = x * expr2 + expr1
```
## Efficient expression construction
PyOptInterface provides a special class `ExprBuilder` to construct expressions efficiently. It is especially useful when we need to construct a large expression with many terms.
It supports the following in-place assignment operations:
- `+=`: add a term to the expression
- `-=`: subtract a term from the expression
- `*=`: multiply the expression with a constant or another expression
- `/=`: divide the expression with a constant
For example, we can use `ExprBuilder` to construct the following expression efficiently:
$$
\frac{1}{2} \sum_{i=1}^N x_i^2 - \sum_{i=1}^N x_i
$$
```{code-cell}
N = 1000
x = [model.add_variable() for _ in range(N)]
def fast_expr():
expr = poi.ExprBuilder()
for i in range(N):
expr += 0.5 * x[i] * x[i]
expr -= x[i]
def slow_expr():
expr = 0
for i in range(N):
expr += 0.5 * x[i] * x[i]
expr -= x[i]
```
```{code-cell}
%time fast_expr()
```
```{code-cell}
%time slow_expr()
```
## Pretty print expression
If the names of variables are specified, We can use the `pprint` method to print the expression in a human-readable format:
```{code-cell}
x = model.add_variable(name="x")
y = model.add_variable(name="y")
expr = x * x + 2 * x * y + y * y
model.pprint(expr)
```
## Value of expression
We can use the `get_value` method to get the value of an expression after optimization:
```python
expr = x*y + x*x
expr_value = model.get_value(expr)
```
================================================
FILE: docs/source/faq.md
================================================
# Frequently Asked Questions
## How to suppress the output of the optimizer?
There are two kinds of output that you may want to suppress:
1. The log of optimization process.
2. The default license message printed when initializing the optimizer. For example, when using Gurobi, the message is `Academic license - for non-commercial use only - expires yyyy-mm-dd`.
Normally we only want to suppress the log of optimization process, you can use `model.set_model_attribute(poi.ModelAttribute.Silent, True)` to disable the output. For example:
```python
import pyoptinterface as poi
from pyoptinterface import gurobi
model = gurobi.Model()
model.set_model_attribute(poi.ModelAttribute.Silent, True)
```
Suppressing the default license message is a bit tricky and solver-specific. For Gurobi, you can use the following code:
```python
import pyoptinterface as poi
from pyoptinterface import gurobi
env = gurobi.Env(empty=True)
env.set_raw_parameter("OutputFlag", 0)
env.start()
model = gurobi.Model(env)
```
## How to add linear constraints in matrix form like $Ax \leq b$?
In YALMIP, you can use the matrix form $Ax \leq b$ to add linear constraints, which is quite convenient.
In PyOptInterface, you can use [`model.add_m_linear_constraints`](<project:#model.add_m_linear_constraints>) to add linear constraints in matrix form.
## Will PyOptInterface support new optimizers in the future?
In short, no, there are no plans to support new optimizers. Supporting a new optimizer is not a trivial task, as it requires a lot of work to implement, test and maintain the interface.
Basically, a new optimizer should satisfy the following criteria to be considered for support:
- Actively maintained
- Good performance (open source or commercial)
- Not difficult to acquire an academic license
- Have well-defined C/C++ API
Support for a new optimizer will only happen if one or more of the following conditions are met:
- I am personally interested in the optimizer and plan to use it in my research, so I am willing to invest time in implementing it.
- Someone steps up to implement and maintain the interface for the optimizer in PyOptInterface.
- External funding or sponsorship become available to support the development and maintenance of the optimizer interface.
Finally, we are always open to external contributions. If you have a specific optimizer in mind and plan to implement it, feel free to open an issue on our GitHub repository to discuss it.
================================================
FILE: docs/source/getting_started.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Getting Started
## Installation
PyOptInterface is available on PyPI. You can install it via pip:
```
pip install pyoptinterface
```
After installation, you can import the package in Python console:
```python
import pyoptinterface as poi
```
PyOptInterface has no dependencies other than Python itself. However, to use it with a specific optimizer, you need to install the corresponding optimizer manually. The details can be found on [the configurations of optimizers](https://metab0t.github.io/PyOptInterface/getting-started.html).
In order to provide out-of-the-box support for open source optimizers (currently we support [HiGHS](https://github.com/ERGO-Code/HiGHS)), PyOptInterface can also be installed with pre-built optimizers. You can install them via pip:
```
pip install pyoptinterface[highs]
```
It will install a full-featured binary version of HiGHS optimizer via [highsbox](http://github.com/metab0t/highsbox), which can be used with PyOptInterface.
In order to use nonlinear programming solvers (currently we only support IPOPT), you should install extra dependencies like:
```
pip install pyoptinterface[nlp]
```
It will install the [`llvmlite`](https://github.com/numba/llvmlite) and [`tccbox`](https://github.com/metab0t/tccbox) package as the JIT compilers required by nonlinear programming.
We will introduce how to set up the optimizers to use with PyOptInterface in this page.
## Setup of optimizers
PyOptInterface uses the `Dynamic Loading` technique to load the dynamic library of optimizers at runtime, so the optimizer it uses can be changed manually without recompiling the code.
The set up of optimizers includes two approaches:
1. Automatic detection of the installation directory of the optimizers.
2. Manually specifying the path of the dynamic library of optimizer.
We will introduce the automatic detection and manual configuration in details
## Automatic detection of the installation directory of the optimizers
The automatic detection includes three steps:
1. Environment variable set by the installer of optimizer
2. The official Python binding of the optimizer (if available)
3. Search directly in the system loadable path (e.g. `/usr/lib`, `/usr/local/lib` on Linux or PATH on Windows)
For the 3rd step, we want to explain more for novices.
For example, in order to make the dynamic library of HiGHS `highs.dll`/`libhighs.so`/`libhighs.dylib` loadable, we need to put it in a loadable path recognized by the operating system. The typical loadable path on Linux is `/usr/lib`, `/usr/local/lib`, and the typical loadable path on Windows is `PATH`.
On Linux, we use the `LD_LIBRARY_PATH` environment variable to specify the dynamic library path. On macOS, we use the `DYLD_LIBRARY_PATH` environment variable to specify the dynamic library path.
If the dynamic library is in path `C:\highs\lib`/`/opt/highs/lib`:
- Windows: `set PATH=%PATH%;C:\highs\lib`
- Linux: `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/highs/lib`
- macOS: `export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/highs/lib`
The typical paths where the dynamic library of optimizers are located are as follows:
:::{list-table}
:header-rows: 1
* - Optimizer
- Windows
- Linux
- macOS(ARM)
- macOS(Intel)
* - Gurobi
- `C:\gurobi1101\win64\bin`
- `/opt/gurobi1100/linux64/lib`
- `/opt/gurobi1100/macos_universal2/lib`
- `/opt/gurobi1100/macos_universal2/lib`
* - Xpress
- `C:\xpressmp\bin`
- `/opt/xpressmp/lib`
- `/Applications/FICO Xpress/xpressmp/lib`
- `/Applications/FICO Xpress/xpressmp/lib`
* - COPT
- `C:\Program Files\copt80\bin`
- `/opt/copt80/lib`
- `/opt/copt80/lib`
- `/opt/copt80/lib`
* - Mosek
- `C:\Program Files\Mosek\10.2\tools\platform\win64x86\bin`
- `/opt/mosek/10.2/tools/platform/linux64x86/bin`
- `/opt/mosek/10.2/tools/platform/osxaarch64/bin`
- `/opt/mosek/10.2/tools/platform/osx64x86/bin`
* - HiGHS
- `D:\highs\bin`
- `/opt/highs/lib`
- `/opt/highs/lib`
- `/opt/highs/lib`
* - KNITRO
- `C:\Program Files\Artelys\KNITRO 15.1\lib`
- `/opt/knitro/15.1/lib`
- `/opt/knitro/15.1/lib`
- ``
:::
### Gurobi
The currently supported version is **13.0.0**. Other versions may work but are not tested.
For Gurobi, the automatic detection looks for the following things in order:
1. The environment variable `GUROBI_HOME` set by the installer of Gurobi
2. The installation of `gurobipy`
3. `gurobi130.dll`/`libgurobi130.so`/`libgurobi130.dylib` in the system loadable path
### Xpress
The currently supported version is **9.8**. Other versions may work but are not tested.
For Xpress, the automatic detection looks for the following things in order:
1. The environment variable `XPRESSDIR` set by the installer of Xpress
2. `xprs.dll`/`libxprs.so`/`libxprs.dylib` int the system loadable path
### COPT
The currently supported version is **8.0.x**. Other versions may work but are not tested.
For COPT, the automatic detection looks for the following things in order:
1. The environment variable `COPT_HOME` set by the installer of COPT
2. `copt.dll`/`libcopt.so`/`libcopt.dylib` in the system loadable path
### Mosek
The currently supported version is **10.2.x**. Other versions may work but are not tested.
For Mosek, the automatic detection looks for the following things in order:
1. The environment variable `MOSEK_10_2_BINDIR` set by the installer of Mosek
2. The installation of `mosek` PyPI package
3. `mosek64_10_2.dll`/`libmosek64.so`/`libmosek64.dylib` in the system loadable path
### HiGHS
The currently supported version is **1.12.x**. Other versions may work but are not tested.
For HiGHS, the automatic detection looks for the following things in order:
1. The environment variable `HiGHS_HOME` set by the user
2. The installation of `highsbox` PyPI package (recommended)
3. `highs.dll`/`libhighs.so`/`libhighs.dylib` in the system
For HiGHS, we recommend installing the `highsbox` PyPI package, which provides a full-featured binary version of HiGHS optimizer for you.
### Ipopt
The currently supported version is **3.14.x**. Other versions may work but are not tested.
For Ipopt, the automatic detection looks for the following things in order:
1. `ipopt.dll`/`libipopt.so`/`libipopt.dylib` in the system, we also look for `ipopt-3.dll`/`libipopt.dll`/`libipopt-3.dll` on Windows.
We recommend using the official binary from [GitHub](https://github.com/coin-or/Ipopt/releases) if you work on Windows, since compiling Ipopt on Windows from source is not an easy task.
### KNITRO
The currently supported version is **15.1.x**. Other versions may work but are not tested.
For KNITRO, the automatic detection looks for the following things in order:
1. The environment variable `KNITRODIR` set by the installer of KNITRO
2. `knitro.dll`/`libknitro.so`/`libknitro.dylib` in the system loadable path
3. The installation of `knitro` PyPI package.
KNITRO dropped support for MacOS intel since version 15.0, so using KNITRO on MacOS intel is not supported.
## Manually specifying the path of the dynamic library of optimizer
If the automatic detection fails or you want to use the optimizer in a customized location, you can manually specify the path of the dynamic library of the optimizer.
We take HiGHS as an example. Whether the optimizer has been successfully loaded can be checked via the following code:
```python
from pyoptinterface import highs
print(highs.is_library_loaded())
```
If the optimizer has not been successfully loaded, you can manually specify the path of the dynamic library of the optimizer via the following code:
```python
ret = highs.load_library("path/to/libhighs.so")
print(f"Loading from custom path manually: {ret}")
```
The `load_library` function returns `True` if the library is successfully loaded, otherwise it returns `False`.
If you want to revert to use the automatic detection, you can call the `autoload_library` function:
```python
ret = highs.autoload_library()
print(f"Loading from automatically detected location: {ret}")
```
For other optimizers, just replace `highs` with the corresponding optimizer name like `gurobi`, `xpress`, `copt`, `mosek`.
The typical paths where the dynamic library of optimizers are located are as follows:
:::{list-table}
:header-rows: 1
* - Optimizer
- Windows
- Linux
- macOS(ARM)
- macOS(Intel)
* - Gurobi
- `C:\gurobi1101\win64\bin\gurobi110.dll`
- `/opt/gurobi1100/linux64/lib/libgurobi110.so`
- `/opt/gurobi1100/macos_universal2/lib/libgurobi110.dylib`
- `/opt/gurobi1100/macos_universal2/lib/libgurobi110.dylib`
* - COPT
- `C:\Program Files\copt71\bin\copt.dll`
- `/opt/copt72/lib/libcopt.so`
- `/opt/copt72/lib/libcopt.dylib`
- `/opt/copt72/lib/libcopt.dylib`
* - Xpress
- `C:\xpressmp\bin\xprs.dll`
- `/opt/xpressmp/lib/libxprs.so`
- `/Applications/FICO Xpress/xpressmp/lib/libxprs.dylib`
- `/Applications/FICO Xpress/xpressmp/lib/libxprs.dylib`
* - Mosek
- `C:\Program Files\Mosek\10.2\tools\platform\win64x86\bin\mosek64_10_1.dll`
- `/opt/mosek/10.2/tools/platform/linux64x86/bin/libmosek64.so`
- `/opt/mosek/10.2/tools/platform/osxaarch64/bin/libmosek64.dylib`
- `/opt/mosek/10.2/tools/platform/osx64x86/bin/libmosek64.dylib`
* - HiGHS
- `D:\highs\bin\highs.dll`
- `/opt/highs/lib/libhighs.so`
- `/opt/highs/lib/libhighs.dylib`
- `/opt/highs/lib/libhighs.dylib`
* - KNITRO
- `C:\Program Files\Artelys\KNITRO 15.1\lib\knitro.dll`
- `/opt/knitro/15.1/lib/libknitro.so`
- `/opt/knitro/15.1/lib/libknitro.dylib`
- ``
:::
## Let's build a simple model and solve it
After setting up the optimizers, we can build a simple model and solve it.
As the first step, we will solve the following simple Quadratic Programming (QP) problem:
```{math}
\min \quad & x^{2}_{1} + 2x^{2}_{2} \\
\textrm{s.t.} \quad & x_{1} + x_{2} = 1 \\
\quad & x_{1}, x_{2} \geq 0
```
First, we need to create a model object:
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import highs
# from pyoptinterface import copt, gurobi, xpress, mosek (if you want to use other optimizers)
model = highs.Model()
```
Then, we need to add variables to the model:
```{code-cell}
x1 = model.add_variable(lb=0, name="x1")
x2 = model.add_variable(lb=0, name="x2")
```
The `lb` argument specifies the lower bound of the variable. It is optional and defaults to $-\infty$.
The `name` argument is optional and can be used to specify the name of the variable.
Then, we need to add constraints to the model:
```{code-cell}
con = model.add_linear_constraint(x1+x2, poi.ConstraintSense.Equal, 1, name="con")
```
`model.add_linear_constraint` adds a linear constraint to the model.
- The first argument `x1+x2` is the left-hand side of the constraint.
- The second argument is the sense of the constraint. It can be `poi.ConstraintSense.Equal`, `poi.ConstraintSense.LessEqual` or `poi.ConstraintSense.GreaterEqual` which can also be written as `poi.Eq`, `poi.Leq`, and `poi.Geq`.
- The third argument is the right-hand side of the constraint. It must be a constant.
- The fourth argument is optional and can be used to specify the name of the constraint.
Finally, we need to set the objective function and solve the model:
```{code-cell}
obj = x1*x1 + 2*x2*x2
model.set_objective(obj, poi.ObjectiveSense.Minimize)
```
The model can be solved via:
```{code-cell}
model.optimize()
```
The HiGHS optimizer will be invoked to solve the model and writes the log to the console.
We can query the status of the model via:
```{code-cell}
model.get_model_attribute(poi.ModelAttribute.TerminationStatus)
```
The solution of the model can be queried via:
```{code-cell}
print("x1 = ", model.get_value(x1))
print("x2 = ", model.get_value(x2))
print("obj = ", model.get_value(obj))
```
================================================
FILE: docs/source/gurobi.md
================================================
# Gurobi
## Initial setup
```python
from pyoptinterface import gurobi
model = gurobi.Model()
```
You need to follow the instructions in [Getting Started](getting_started.md#gurobi) to set up the optimizer correctly.
If you want to manage the license of Gurobi manually, you can create a `gurobi.Env` object and pass it to the constructor of the `gurobi.Model` object, otherwise we will initialize an implicit global `gurobi.Env` object automatically and use it.
```python
env = gurobi.Env()
model = gurobi.Model(env)
```
For example, you can set the parameter of the `gurobi.Env` object to choose the licensing behavior.
```python
env = gurobi.Env(empty=True)
env.set_raw_parameter("ComputeServer", "myserver1:32123")
env.set_raw_parameter("ServerPassword", "pass")
env.start()
model = gurobi.Model(env)
```
For users who want to release the license immediately after the optimization, you can call the `close` method of all models created and the `gurobi.Env` object. It applies to other commercial solvers supported as well.
```python
env = gurobi.Env()
model = gurobi.Model(env)
# do something with the model
model.close()
env.close()
```
## The capability of `gurobi.Model`
### Supported constraints
:::{list-table}
:header-rows: 1
* - Constraint
- Supported
* - <project:#model.add_linear_constraint>
- ✅
* - <project:#model.add_quadratic_constraint>
- ✅
* - <project:#model.add_second_order_cone_constraint>
- ✅
* - <project:#model.add_sos_constraint>
- ✅
:::
```{include} attribute/gurobi.md
```
## Solver-specific operations
### Parameter
For [solver-specific parameters](https://docs.gurobi.com/projects/optimizer/en/current/reference/parameters.html), we provide `get_raw_parameter` and `set_raw_parameter` methods to get and set the parameters.
```python
model = gurobi.Model()
# get the value of the parameter
value = model.get_raw_parameter("TimeLimit")
# set the value of the parameter
model.set_raw_parameter("TimeLimit", 10.0)
```
### Attribute
Gurobi supports a lot of [attributes](https://docs.gurobi.com/projects/optimizer/en/current/reference/attributes.html) for the model, variable, and constraint. We provide methods to get or set the value of the attribute.
- Model attribute: `model.get_model_raw_attribute(name: str)` and `model.set_model_raw_attribute(name: str, value: Any)`
- Variable attribute: `model.get_variable_raw_attribute(variable, name: str)` and `model.set_variable_raw_attribute(variable, name: str, value: Any)`
- Constraint attribute: `model.get_constraint_raw_attribute(constraint, name: str)` and `model.set_constraint_raw_attribute(constraint, name: str, value: Any)`
We also provide `gurobi.GRB` to contain all the constants in `gurobipy.GRB`.
For model status:
```python
status = model.get_model_raw_attribute(gurobi.GRB.Attr.Status)
if status == gurobi.GRB.OPTIMAL:
...
elif status == gurobi.GRB.INFEASIBLE:
...
```
For reduced cost of a variable:
```python
rc = model.get_variable_raw_attribute(variable, gurobi.GRB.Attr.RC)
```
For right-hand side value of a constraint:
```python
rhs = model.get_constraint_raw_attribute(constraint, gurobi.GRB.Attr.RHS)
```
================================================
FILE: docs/source/highs.md
================================================
# HiGHS
## Initial setup
```python
from pyoptinterface import highs
model = highs.Model()
```
You need to follow the instructions in [Getting Started](getting_started.md#highs) to set up the optimizer correctly.
## The capability of `highs.Model`
### Supported constraints
:::{list-table}
:header-rows: 1
* - Constraint
- Supported
* - <project:#model.add_linear_constraint>
- ✅
* - <project:#model.add_quadratic_constraint>
- ❌
* - <project:#model.add_second_order_cone_constraint>
- ❌
* - <project:#model.add_sos_constraint>
- ❌
:::
```{include} attribute/highs.md
```
## Solver-specific operations
### Parameter
For [solver-specific parameters](https://ergo-code.github.io/HiGHS/stable/options/definitions/), we provide `get_raw_parameter` and `set_raw_parameter` methods to get and set the parameters.
```python
model = highs.Model()
# get the value of the parameter
value = model.get_raw_parameter("time_limit")
# set the value of the parameter
model.set_raw_parameter("time_limit", 10.0)
```
### Information
HiGHS provides [information](https://ergo-code.github.io/HiGHS/stable/structures/classes/HighsInfo/) for the model. We provide `model.get_raw_information(name: str)` method to access the value of information.
================================================
FILE: docs/source/index.md
================================================
```{include} ../../README.md
```
## Contents
```{toctree}
:maxdepth: 2
:titlesonly:
:caption: User Guide
getting_started.md
benchmark.md
faq.md
model.md
variable.md
expression.md
constraint.md
objective.md
nonlinear.md
container.md
numpy.md
structure.md
common_model_interface.md
infeasibility.md
callback.md
gurobi.md
xpress.md
copt.md
mosek.md
highs.md
ipopt.md
knitro.md
changelog.md
```
```{toctree}
:maxdepth: 2
:titlesonly:
:caption: Examples
examples/economic_dispatch.md
examples/optimal_power_flow.md
examples/optimal_control_rocket.md
```
```{toctree}
:maxdepth: 2
:titlesonly:
:caption: Advanced
develop.md
```
```{toctree}
:maxdepth: 1
:titlesonly:
:caption: API docs
api/pyoptinterface.rst
```
## Indices and tables
- {ref}`genindex`
- {ref}`modindex`
- {ref}`search`
================================================
FILE: docs/source/infeasibility.md
================================================
---
file_format: mystnb
kernelspec:
name: python3
---
# Infeasibility Analysis
The optimization model is not ways feasible, and the optimizer may tell us some information about the infeasibility to diagnose the problem. There are two ways to handle the infeasibilities:
- Find the IIS (Irreducible Infeasible Set) to identify the minimal set of constraints that cause the infeasibility.
- Relax the constraints and solve a weaker problem to find out which constraints are violated and how much.
PyOptInterface currently supports the first method to find the IIS (only with Gurobi, Xpress, and COPT). The following code snippet shows how to find the IIS of an infeasible model:
```{code-cell}
import pyoptinterface as poi
from pyoptinterface import copt
model = copt.Model()
x = model.add_variable(lb=0.0, name="x")
y = model.add_variable(lb=0.0, name="y")
con1 = model.add_linear_constraint(x + y, poi.Geq, 5.0)
con2 = model.add_linear_constraint(x + 2 * y, poi.Leq, 1.0)
model.set_objective(x)
model.computeIIS()
con1_iis = model.get_constraint_attribute(con1, poi.ConstraintAttribute.IIS)
con2_iis = model.get_constraint_attribute(con2, poi.ConstraintAttribute.IIS)
print(f"Constraint 1 IIS: {con1_iis}")
print(f"Constraint 2 IIS: {con2_iis}")
```
This code snippet creates an infeasible model with two constraints and finds the IIS of the model. Obviously, the constraints are contradictory because `x + 2 * y <= 1` and `x + y >= 5` cannot be satisfied at the same time when `x` and `y` are non-negative. The optimizer will detect that the model is infeasible and return the IIS, which is the set of constraints that cause the infeasibility. We can query whether a constraint is in the IIS by calling `get_constraint_attribute` with the `ConstraintAttribute.IIS` attribute.
Sometimes, the bounds of the variables are not consistent with the constraints, and we need to query the IIS of the bounds of variables by calling `get_variable_attribute` with the `VariableAttribute.IISLowerBound` and `VariableAttribute.IISUpperBound` attributes.
The following code snippet shows how to tell if the bounds of a variable are in the IIS:
```{code-cell}
model = copt.Model()
x = model.add_variable(lb=0.0, ub=2.0, name="x")
y = model.add_variable(lb=0.0, ub=3.0, name="y")
con1 = model.add_linear_constraint(x + y, poi.Geq, 6.0)
model.set_objective(x)
model.computeIIS()
con1_iis = model.get_constraint_attribute(con1, poi.ConstraintAttribute.IIS)
x_lb_iis = model.get_variable_attribute(x, poi.VariableAttribute.IISLowerBound)
x_ub_iis = model.get_variable_attribute(x, poi.VariableAttribute.IISUpperBound)
y_lb_iis = model.get_variable_attribute(y, poi.VariableAttribute.IISLowerBound)
y_ub_iis = model.get_variable_attribute(y, poi.VariableAttribute.IISUpperBound)
print(f"Constraint 1 IIS: {con1_iis}")
print(f"Variable x lower bound IIS: {x_lb_iis}")
print(f"Variable x upper bound IIS: {x_ub_iis}")
print(f"Variable y lower bound IIS: {y_lb_iis}")
print(f"Variable y upper bound IIS: {y_ub_iis}")
```
================================================
FILE: docs/source/ipopt.md
================================================
# Ipopt
## Initial setup
`
gitextract_81kqktr_/
├── .clang-format
├── .github/
│ ├── actions/
│ │ ├── setup_optimizers_linux/
│ │ │ └── action.yml
│ │ ├── setup_optimizers_macos/
│ │ │ └── action.yml
│ │ └── setup_optimizers_windows/
│ │ └── action.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── doc-build.yml
│ ├── linux-build.yml
│ ├── macos-build.yml
│ ├── wheel.yml
│ └── windows-build.yml
├── .gitignore
├── .pre-commit-config.yaml
├── CMakeLists.txt
├── GEMINI.md
├── LICENSE.md
├── README.md
├── bench/
│ ├── bench_linopy_cvxpy.py
│ ├── bench_modify.jl
│ ├── bench_modify.mod
│ ├── bench_modify.py
│ ├── bench_modify.run
│ ├── bench_static.jl
│ ├── bench_static.py
│ ├── nqueens/
│ │ ├── .gitignore
│ │ ├── nqueens.jl
│ │ ├── nqueens_gurobipy.py
│ │ ├── nqueens_poi.py
│ │ └── nqueens_pythonmip.py
│ └── test_delete.py
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── requirements.txt
│ └── source/
│ ├── api/
│ │ ├── pyoptinterface.copt.rst
│ │ ├── pyoptinterface.gurobi.rst
│ │ ├── pyoptinterface.highs.rst
│ │ ├── pyoptinterface.knitro.rst
│ │ ├── pyoptinterface.mosek.rst
│ │ ├── pyoptinterface.rst
│ │ └── pyoptinterface.xpress.rst
│ ├── attribute/
│ │ ├── copt.md
│ │ ├── gurobi.md
│ │ ├── highs.md
│ │ ├── ipopt.md
│ │ ├── knitro.md
│ │ ├── mosek.md
│ │ └── xpress.md
│ ├── benchmark.md
│ ├── callback.md
│ ├── changelog.md
│ ├── common_model_interface.md
│ ├── conf.py
│ ├── constraint.md
│ ├── container.md
│ ├── copt.md
│ ├── develop.md
│ ├── examples/
│ │ ├── economic_dispatch.md
│ │ ├── optimal_control_rocket.md
│ │ └── optimal_power_flow.md
│ ├── expression.md
│ ├── faq.md
│ ├── getting_started.md
│ ├── gurobi.md
│ ├── highs.md
│ ├── index.md
│ ├── infeasibility.md
│ ├── ipopt.md
│ ├── knitro.md
│ ├── model.md
│ ├── mosek.md
│ ├── nonlinear.md
│ ├── numpy.md
│ ├── objective.md
│ ├── roadmap.md
│ ├── structure.md
│ ├── variable.md
│ └── xpress.md
├── include/
│ └── pyoptinterface/
│ ├── cache_model.hpp
│ ├── container.hpp
│ ├── copt_model.hpp
│ ├── core.hpp
│ ├── cppad_interface.hpp
│ ├── dylib.hpp
│ ├── gurobi_model.hpp
│ ├── highs_model.hpp
│ ├── ipopt_model.hpp
│ ├── knitro_model.hpp
│ ├── mosek_model.hpp
│ ├── nleval.hpp
│ ├── nlexpr.hpp
│ ├── solver_common.hpp
│ ├── tcc_interface.hpp
│ └── xpress_model.hpp
├── lib/
│ ├── cache_model.cpp
│ ├── copt_model.cpp
│ ├── copt_model_ext.cpp
│ ├── copt_model_ext_constants.cpp
│ ├── core.cpp
│ ├── core_ext.cpp
│ ├── cppad_interface.cpp
│ ├── cppad_interface_ext.cpp
│ ├── gurobi_model.cpp
│ ├── gurobi_model_ext.cpp
│ ├── gurobi_model_ext_constants.cpp
│ ├── highs_model.cpp
│ ├── highs_model_ext.cpp
│ ├── highs_model_ext_constants.cpp
│ ├── ipopt_model.cpp
│ ├── ipopt_model_ext.cpp
│ ├── knitro_model.cpp
│ ├── knitro_model_ext.cpp
│ ├── knitro_model_ext_constants.cpp
│ ├── main.cpp
│ ├── mosek_model.cpp
│ ├── mosek_model_ext.cpp
│ ├── mosek_model_ext_constants.cpp
│ ├── nleval.cpp
│ ├── nleval_ext.cpp
│ ├── nlexpr.cpp
│ ├── nlexpr_ext.cpp
│ ├── tcc_interface.cpp
│ ├── tcc_interface_ext.cpp
│ ├── xpress_model.cpp
│ ├── xpress_model_ext.cpp
│ └── xpress_model_ext_constants.cpp
├── optimizer_version.toml
├── pyproject.toml
├── scripts/
│ ├── generate_attribute_table.py
│ └── generate_solver_constants.py
├── skills/
│ └── pyoptinterface-expert/
│ ├── SKILL.md
│ └── references/
│ ├── api.md
│ └── examples.md
├── src/
│ └── pyoptinterface/
│ ├── __init__.py
│ ├── _src/
│ │ ├── __init__.py
│ │ ├── aml.py
│ │ ├── attributes.py
│ │ ├── codegen_c.py
│ │ ├── codegen_llvm.py
│ │ ├── comparison_constraint.py
│ │ ├── constraint_bridge.py
│ │ ├── copt.py
│ │ ├── cpp_graph_iter.py
│ │ ├── dylib.py
│ │ ├── gurobi.py
│ │ ├── highs.py
│ │ ├── ipopt.py
│ │ ├── jit_c.py
│ │ ├── jit_llvm.py
│ │ ├── knitro.py
│ │ ├── matrix.py
│ │ ├── monkeypatch.py
│ │ ├── mosek.py
│ │ ├── nlfunc.py
│ │ ├── solver_common.py
│ │ ├── tupledict.py
│ │ └── xpress.py
│ ├── copt.py
│ ├── gurobi.py
│ ├── highs.py
│ ├── ipopt.py
│ ├── knitro.py
│ ├── mosek.py
│ ├── nl.py
│ └── xpress.py
├── tests/
│ ├── conftest.py
│ ├── simple_cb.py
│ ├── test_basic.py
│ ├── test_close.py
│ ├── test_compare_constraint.py
│ ├── test_exp_cone.py
│ ├── test_iis.py
│ ├── test_in_constraint.py
│ ├── test_ipopt.py
│ ├── test_knitro.py
│ ├── test_lukvle10.py
│ ├── test_matrix_api.py
│ ├── test_nlp.py
│ ├── test_nlp_bilinear.py
│ ├── test_nlp_clnlbeam.py
│ ├── test_nlp_expression.py
│ ├── test_nlp_hs071.py
│ ├── test_nlp_multiple_run.py
│ ├── test_nlp_opf.py
│ ├── test_nlp_rocket.py
│ ├── test_operator.py
│ ├── test_preopt.py
│ ├── test_qp.py
│ ├── test_reducedcost.py
│ ├── test_simple_opt.py
│ ├── test_soc.py
│ ├── test_sos.py
│ ├── test_tupledict.py
│ ├── test_update.py
│ ├── tsp_cb.py
│ └── tsp_xpress.py
└── thirdparty/
├── ankerl/
│ ├── stl.h
│ └── unordered_dense.h
├── cppad/
│ ├── CMakeLists.txt
│ ├── include/
│ │ └── cppad/
│ │ ├── base_require.hpp
│ │ ├── configure.hpp
│ │ ├── core/
│ │ │ ├── abort_recording.hpp
│ │ │ ├── abs.hpp
│ │ │ ├── abs_normal_fun.hpp
│ │ │ ├── ad.hpp
│ │ │ ├── ad_assign.hpp
│ │ │ ├── ad_binary.hpp
│ │ │ ├── ad_ctor.hpp
│ │ │ ├── ad_fun.hpp
│ │ │ ├── ad_io.hpp
│ │ │ ├── ad_to_string.hpp
│ │ │ ├── ad_type.hpp
│ │ │ ├── ad_valued.hpp
│ │ │ ├── add.hpp
│ │ │ ├── add_eq.hpp
│ │ │ ├── arithmetic.hpp
│ │ │ ├── atan2.hpp
│ │ │ ├── atomic/
│ │ │ │ ├── four/
│ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ ├── call.hpp
│ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ ├── devel/
│ │ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ │ └── jac_sparsity.hpp
│ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ ├── forward.hpp
│ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ └── reverse.hpp
│ │ │ │ ├── one/
│ │ │ │ │ └── atomic.hpp
│ │ │ │ ├── three/
│ │ │ │ │ ├── afun.hpp
│ │ │ │ │ ├── atomic.hpp
│ │ │ │ │ ├── ctor.hpp
│ │ │ │ │ ├── for_type.hpp
│ │ │ │ │ ├── forward.hpp
│ │ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ │ ├── rev_depend.hpp
│ │ │ │ │ └── reverse.hpp
│ │ │ │ └── two/
│ │ │ │ ├── afun.hpp
│ │ │ │ ├── atomic.hpp
│ │ │ │ ├── clear.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── for_sparse_hes.hpp
│ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── option.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── azmul.hpp
│ │ │ ├── base2ad.hpp
│ │ │ ├── base_complex.hpp
│ │ │ ├── base_cond_exp.hpp
│ │ │ ├── base_double.hpp
│ │ │ ├── base_float.hpp
│ │ │ ├── base_hash.hpp
│ │ │ ├── base_limits.hpp
│ │ │ ├── base_std_math.hpp
│ │ │ ├── base_to_string.hpp
│ │ │ ├── bender_quad.hpp
│ │ │ ├── bool_fun.hpp
│ │ │ ├── bool_valued.hpp
│ │ │ ├── capacity_order.hpp
│ │ │ ├── check_for_nan.hpp
│ │ │ ├── chkpoint_one/
│ │ │ │ ├── chkpoint_one.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── for_sparse_jac.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── rev_sparse_hes.hpp
│ │ │ │ ├── rev_sparse_jac.hpp
│ │ │ │ ├── reverse.hpp
│ │ │ │ ├── set_hes_sparse_bool.hpp
│ │ │ │ ├── set_hes_sparse_set.hpp
│ │ │ │ ├── set_jac_sparse_bool.hpp
│ │ │ │ └── set_jac_sparse_set.hpp
│ │ │ ├── chkpoint_two/
│ │ │ │ ├── chkpoint_two.hpp
│ │ │ │ ├── ctor.hpp
│ │ │ │ ├── dynamic.hpp
│ │ │ │ ├── for_type.hpp
│ │ │ │ ├── forward.hpp
│ │ │ │ ├── hes_sparsity.hpp
│ │ │ │ ├── jac_sparsity.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── compare.hpp
│ │ │ ├── compound_assign.hpp
│ │ │ ├── con_dyn_var.hpp
│ │ │ ├── cond_exp.hpp
│ │ │ ├── convert.hpp
│ │ │ ├── cppad_assert.hpp
│ │ │ ├── dependent.hpp
│ │ │ ├── discrete/
│ │ │ │ └── discrete.hpp
│ │ │ ├── div.hpp
│ │ │ ├── div_eq.hpp
│ │ │ ├── drivers.hpp
│ │ │ ├── epsilon.hpp
│ │ │ ├── equal_op_seq.hpp
│ │ │ ├── for_hes_sparsity.hpp
│ │ │ ├── for_jac_sparsity.hpp
│ │ │ ├── for_one.hpp
│ │ │ ├── for_sparse_hes.hpp
│ │ │ ├── for_sparse_jac.hpp
│ │ │ ├── for_two.hpp
│ │ │ ├── forward/
│ │ │ │ └── forward.hpp
│ │ │ ├── fun_check.hpp
│ │ │ ├── fun_construct.hpp
│ │ │ ├── fun_eval.hpp
│ │ │ ├── graph/
│ │ │ │ ├── cpp_graph.hpp
│ │ │ │ ├── from_graph.hpp
│ │ │ │ ├── from_json.hpp
│ │ │ │ ├── graph_op_enum.hpp
│ │ │ │ ├── to_graph.hpp
│ │ │ │ └── to_json.hpp
│ │ │ ├── hash_code.hpp
│ │ │ ├── hessian.hpp
│ │ │ ├── identical.hpp
│ │ │ ├── independent/
│ │ │ │ └── independent.hpp
│ │ │ ├── integer.hpp
│ │ │ ├── jacobian.hpp
│ │ │ ├── lu_ratio.hpp
│ │ │ ├── mul.hpp
│ │ │ ├── mul_eq.hpp
│ │ │ ├── near_equal_ext.hpp
│ │ │ ├── new_dynamic.hpp
│ │ │ ├── num_skip.hpp
│ │ │ ├── numeric_limits.hpp
│ │ │ ├── omp_max_thread.hpp
│ │ │ ├── opt_val_hes.hpp
│ │ │ ├── optimize.hpp
│ │ │ ├── ordered.hpp
│ │ │ ├── parallel_ad.hpp
│ │ │ ├── pow.hpp
│ │ │ ├── print_for.hpp
│ │ │ ├── rev_hes_sparsity.hpp
│ │ │ ├── rev_jac_sparsity.hpp
│ │ │ ├── rev_one.hpp
│ │ │ ├── rev_sparse_hes.hpp
│ │ │ ├── rev_sparse_jac.hpp
│ │ │ ├── rev_two.hpp
│ │ │ ├── reverse.hpp
│ │ │ ├── sign.hpp
│ │ │ ├── sparse.hpp
│ │ │ ├── sparse_hes.hpp
│ │ │ ├── sparse_hessian.hpp
│ │ │ ├── sparse_jac.hpp
│ │ │ ├── sparse_jacobian.hpp
│ │ │ ├── standard_math.hpp
│ │ │ ├── std_math_11.hpp
│ │ │ ├── sub.hpp
│ │ │ ├── sub_eq.hpp
│ │ │ ├── subgraph_jac_rev.hpp
│ │ │ ├── subgraph_reverse.hpp
│ │ │ ├── subgraph_sparsity.hpp
│ │ │ ├── tape_link.hpp
│ │ │ ├── testvector.hpp
│ │ │ ├── to_csrc.hpp
│ │ │ ├── unary_minus.hpp
│ │ │ ├── unary_plus.hpp
│ │ │ ├── undef.hpp
│ │ │ ├── user_ad.hpp
│ │ │ ├── value.hpp
│ │ │ ├── var2par.hpp
│ │ │ ├── vec_ad/
│ │ │ │ └── vec_ad.hpp
│ │ │ └── zdouble.hpp
│ │ ├── cppad.hpp
│ │ ├── local/
│ │ │ ├── ad_tape.hpp
│ │ │ ├── atom_state.hpp
│ │ │ ├── atomic_index.hpp
│ │ │ ├── color_general.hpp
│ │ │ ├── color_symmetric.hpp
│ │ │ ├── cppad_colpack.hpp
│ │ │ ├── declare_ad.hpp
│ │ │ ├── define.hpp
│ │ │ ├── graph/
│ │ │ │ ├── cpp_graph_itr.hpp
│ │ │ │ ├── cpp_graph_op.hpp
│ │ │ │ ├── csrc_writer.hpp
│ │ │ │ ├── json_lexer.hpp
│ │ │ │ ├── json_parser.hpp
│ │ │ │ └── json_writer.hpp
│ │ │ ├── hash_code.hpp
│ │ │ ├── independent.hpp
│ │ │ ├── is_pod.hpp
│ │ │ ├── is_pod.hpp.in
│ │ │ ├── op_code_dyn.hpp
│ │ │ ├── op_code_var.hpp
│ │ │ ├── optimize/
│ │ │ │ ├── cexp_info.hpp
│ │ │ │ ├── csum_op_info.hpp
│ │ │ │ ├── csum_stacks.hpp
│ │ │ │ ├── extract_option.hpp
│ │ │ │ ├── get_cexp_info.hpp
│ │ │ │ ├── get_dyn_previous.hpp
│ │ │ │ ├── get_op_previous.hpp
│ │ │ │ ├── get_op_usage.hpp
│ │ │ │ ├── get_par_usage.hpp
│ │ │ │ ├── hash_code.hpp
│ │ │ │ ├── match_op.hpp
│ │ │ │ ├── optimize_run.hpp
│ │ │ │ ├── record_csum.hpp
│ │ │ │ ├── record_pv.hpp
│ │ │ │ ├── record_vp.hpp
│ │ │ │ ├── record_vv.hpp
│ │ │ │ ├── size_pair.hpp
│ │ │ │ └── usage.hpp
│ │ │ ├── play/
│ │ │ │ ├── addr_enum.hpp
│ │ │ │ ├── atom_op_info.hpp
│ │ │ │ ├── dyn_player.hpp
│ │ │ │ ├── player.hpp
│ │ │ │ ├── random_iterator.hpp
│ │ │ │ ├── random_setup.hpp
│ │ │ │ ├── sequential_iterator.hpp
│ │ │ │ └── subgraph_iterator.hpp
│ │ │ ├── pod_vector.hpp
│ │ │ ├── record/
│ │ │ │ ├── comp_op.hpp
│ │ │ │ ├── cond_exp.hpp
│ │ │ │ ├── dyn_recorder.hpp
│ │ │ │ ├── put_dyn_atomic.hpp
│ │ │ │ ├── put_var_atomic.hpp
│ │ │ │ ├── put_var_vecad.hpp
│ │ │ │ └── recorder.hpp
│ │ │ ├── set_get_in_parallel.hpp
│ │ │ ├── sparse/
│ │ │ │ ├── binary_op.hpp
│ │ │ │ ├── internal.hpp
│ │ │ │ ├── list_setvec.hpp
│ │ │ │ ├── pack_setvec.hpp
│ │ │ │ ├── size_setvec.hpp
│ │ │ │ ├── svec_setvec.hpp
│ │ │ │ └── unary_op.hpp
│ │ │ ├── std_set.hpp
│ │ │ ├── subgraph/
│ │ │ │ ├── arg_variable.hpp
│ │ │ │ ├── entire_call.hpp
│ │ │ │ ├── get_rev.hpp
│ │ │ │ ├── info.hpp
│ │ │ │ ├── init_rev.hpp
│ │ │ │ └── sparsity.hpp
│ │ │ ├── sweep/
│ │ │ │ ├── call_atomic.hpp
│ │ │ │ ├── dynamic.hpp
│ │ │ │ ├── for_hes.hpp
│ │ │ │ ├── for_jac.hpp
│ │ │ │ ├── forward0.hpp
│ │ │ │ ├── forward1.hpp
│ │ │ │ ├── forward2.hpp
│ │ │ │ ├── forward_0.hpp
│ │ │ │ ├── forward_any.hpp
│ │ │ │ ├── forward_dir.hpp
│ │ │ │ ├── rev_hes.hpp
│ │ │ │ ├── rev_jac.hpp
│ │ │ │ └── reverse.hpp
│ │ │ ├── temp_file.hpp
│ │ │ ├── utility/
│ │ │ │ ├── cppad_vector_itr.hpp
│ │ │ │ └── vector_bool.hpp
│ │ │ ├── val_graph/
│ │ │ │ ├── base_op.hpp
│ │ │ │ ├── binary_op.hpp
│ │ │ │ ├── call_atomic.hpp
│ │ │ │ ├── call_op.hpp
│ │ │ │ ├── cexp_op.hpp
│ │ │ │ ├── comp_op.hpp
│ │ │ │ ├── compress.hpp
│ │ │ │ ├── con_op.hpp
│ │ │ │ ├── csum_op.hpp
│ │ │ │ ├── cumulative.hpp
│ │ │ │ ├── dead_code.hpp
│ │ │ │ ├── dis_op.hpp
│ │ │ │ ├── dyn_type.hpp
│ │ │ │ ├── enable_parallel.hpp
│ │ │ │ ├── fold_con.hpp
│ │ │ │ ├── fun2val.hpp
│ │ │ │ ├── op2arg_index.hpp
│ │ │ │ ├── op_enum2class.hpp
│ │ │ │ ├── op_hash_table.hpp
│ │ │ │ ├── op_iterator.hpp
│ │ │ │ ├── option.hpp
│ │ │ │ ├── pri_op.hpp
│ │ │ │ ├── print_op.hpp
│ │ │ │ ├── record.hpp
│ │ │ │ ├── record_new.hpp
│ │ │ │ ├── renumber.hpp
│ │ │ │ ├── rev_depend.hpp
│ │ │ │ ├── summation.hpp
│ │ │ │ ├── tape.hpp
│ │ │ │ ├── unary_op.hpp
│ │ │ │ ├── val2fun.hpp
│ │ │ │ ├── val_optimize.hpp
│ │ │ │ ├── val_type.hpp
│ │ │ │ ├── var_type.hpp
│ │ │ │ └── vector_op.hpp
│ │ │ └── var_op/
│ │ │ ├── abs_op.hpp
│ │ │ ├── acos_op.hpp
│ │ │ ├── acosh_op.hpp
│ │ │ ├── add_op.hpp
│ │ │ ├── asin_op.hpp
│ │ │ ├── asinh_op.hpp
│ │ │ ├── atan_op.hpp
│ │ │ ├── atanh_op.hpp
│ │ │ ├── atomic_op.hpp
│ │ │ ├── cexp_op.hpp
│ │ │ ├── compare.hpp
│ │ │ ├── compare_op.hpp
│ │ │ ├── cond_op.hpp
│ │ │ ├── cos_op.hpp
│ │ │ ├── cosh_op.hpp
│ │ │ ├── cskip_op.hpp
│ │ │ ├── csum_op.hpp
│ │ │ ├── dis_op.hpp
│ │ │ ├── discrete_op.hpp
│ │ │ ├── div_op.hpp
│ │ │ ├── erf_op.hpp
│ │ │ ├── exp_op.hpp
│ │ │ ├── expm1_op.hpp
│ │ │ ├── load_op.hpp
│ │ │ ├── log1p_op.hpp
│ │ │ ├── log_op.hpp
│ │ │ ├── mul_op.hpp
│ │ │ ├── neg_op.hpp
│ │ │ ├── one_var.hpp
│ │ │ ├── par_op.hpp
│ │ │ ├── parameter_op.hpp
│ │ │ ├── pow_op.hpp
│ │ │ ├── pri_op.hpp
│ │ │ ├── print_op.hpp
│ │ │ ├── prototype_op.hpp
│ │ │ ├── sign_op.hpp
│ │ │ ├── sin_op.hpp
│ │ │ ├── sinh_op.hpp
│ │ │ ├── sqrt_op.hpp
│ │ │ ├── store_op.hpp
│ │ │ ├── sub_op.hpp
│ │ │ ├── tan_op.hpp
│ │ │ ├── tanh_op.hpp
│ │ │ ├── two_var.hpp
│ │ │ ├── var_op.hpp
│ │ │ └── zmul_op.hpp
│ │ ├── utility/
│ │ │ ├── check_numeric_type.hpp
│ │ │ ├── check_simple_vector.hpp
│ │ │ ├── create_dll_lib.hpp
│ │ │ ├── elapsed_seconds.hpp
│ │ │ ├── error_handler.hpp
│ │ │ ├── index_sort.hpp
│ │ │ ├── link_dll_lib.hpp
│ │ │ ├── lu_factor.hpp
│ │ │ ├── lu_invert.hpp
│ │ │ ├── lu_solve.hpp
│ │ │ ├── memory_leak.hpp
│ │ │ ├── nan.hpp
│ │ │ ├── near_equal.hpp
│ │ │ ├── ode_err_control.hpp
│ │ │ ├── ode_gear.hpp
│ │ │ ├── ode_gear_control.hpp
│ │ │ ├── omp_alloc.hpp
│ │ │ ├── poly.hpp
│ │ │ ├── pow_int.hpp
│ │ │ ├── romberg_mul.hpp
│ │ │ ├── romberg_one.hpp
│ │ │ ├── rosen_34.hpp
│ │ │ ├── runge_45.hpp
│ │ │ ├── set_union.hpp
│ │ │ ├── sparse2eigen.hpp
│ │ │ ├── sparse_rc.hpp
│ │ │ ├── sparse_rcv.hpp
│ │ │ ├── speed_test.hpp
│ │ │ ├── test_boolofvoid.hpp
│ │ │ ├── thread_alloc.hpp
│ │ │ ├── time_test.hpp
│ │ │ ├── to_string.hpp
│ │ │ ├── track_new_del.hpp
│ │ │ ├── vector.hpp
│ │ │ └── vector_bool.hpp
│ │ ├── utility.hpp
│ │ └── wno_conversion.hpp
│ └── src/
│ ├── cpp_graph_op.cpp
│ └── temp_file.cpp
├── fmt/
│ ├── CMakeLists.txt
│ ├── include/
│ │ └── fmt/
│ │ ├── args.h
│ │ ├── base.h
│ │ ├── chrono.h
│ │ ├── color.h
│ │ ├── compile.h
│ │ ├── core.h
│ │ ├── format-inl.h
│ │ ├── format.h
│ │ ├── os.h
│ │ ├── ostream.h
│ │ ├── printf.h
│ │ ├── ranges.h
│ │ ├── std.h
│ │ └── xchar.h
│ └── src/
│ ├── fmt.cc
│ ├── format.cc
│ └── os.cc
├── notes.md
├── solvers/
│ ├── copt/
│ │ └── copt.h
│ ├── gurobi/
│ │ └── gurobi_c.h
│ ├── highs/
│ │ ├── HConfig.h
│ │ ├── Highs.h
│ │ ├── filereaderlp/
│ │ │ ├── builder.hpp
│ │ │ ├── def.hpp
│ │ │ ├── model.hpp
│ │ │ └── reader.hpp
│ │ ├── interfaces/
│ │ │ └── highs_c_api.h
│ │ ├── io/
│ │ │ ├── Filereader.h
│ │ │ ├── FilereaderEms.h
│ │ │ ├── FilereaderLp.h
│ │ │ ├── FilereaderMps.h
│ │ │ ├── HMPSIO.h
│ │ │ ├── HMpsFF.h
│ │ │ ├── HighsIO.h
│ │ │ └── LoadOptions.h
│ │ ├── ipm/
│ │ │ ├── IpxSolution.h
│ │ │ ├── IpxWrapper.h
│ │ │ ├── basiclu/
│ │ │ │ ├── basiclu.h
│ │ │ │ ├── basiclu_factorize.h
│ │ │ │ ├── basiclu_get_factors.h
│ │ │ │ ├── basiclu_initialize.h
│ │ │ │ ├── basiclu_obj_factorize.h
│ │ │ │ ├── basiclu_obj_free.h
│ │ │ │ ├── basiclu_obj_get_factors.h
│ │ │ │ ├── basiclu_obj_initialize.h
│ │ │ │ ├── basiclu_obj_solve_dense.h
│ │ │ │ ├── basiclu_obj_solve_for_update.h
│ │ │ │ ├── basiclu_obj_solve_sparse.h
│ │ │ │ ├── basiclu_obj_update.h
│ │ │ │ ├── basiclu_object.h
│ │ │ │ ├── basiclu_solve_dense.h
│ │ │ │ ├── basiclu_solve_for_update.h
│ │ │ │ ├── basiclu_solve_sparse.h
│ │ │ │ ├── basiclu_update.h
│ │ │ │ ├── lu_def.h
│ │ │ │ ├── lu_file.h
│ │ │ │ ├── lu_internal.h
│ │ │ │ └── lu_list.h
│ │ │ └── ipx/
│ │ │ ├── basiclu_kernel.h
│ │ │ ├── basiclu_wrapper.h
│ │ │ ├── basis.h
│ │ │ ├── conjugate_residuals.h
│ │ │ ├── control.h
│ │ │ ├── crossover.h
│ │ │ ├── diagonal_precond.h
│ │ │ ├── forrest_tomlin.h
│ │ │ ├── guess_basis.h
│ │ │ ├── indexed_vector.h
│ │ │ ├── info.h
│ │ │ ├── ipm.h
│ │ │ ├── ipx_c.h
│ │ │ ├── ipx_config.h
│ │ │ ├── ipx_info.h
│ │ │ ├── ipx_internal.h
│ │ │ ├── ipx_parameters.h
│ │ │ ├── ipx_status.h
│ │ │ ├── iterate.h
│ │ │ ├── kkt_solver.h
│ │ │ ├── kkt_solver_basis.h
│ │ │ ├── kkt_solver_diag.h
│ │ │ ├── linear_operator.h
│ │ │ ├── lp_solver.h
│ │ │ ├── lu_factorization.h
│ │ │ ├── lu_update.h
│ │ │ ├── maxvolume.h
│ │ │ ├── model.h
│ │ │ ├── multistream.h
│ │ │ ├── normal_matrix.h
│ │ │ ├── power_method.h
│ │ │ ├── sparse_matrix.h
│ │ │ ├── sparse_utils.h
│ │ │ ├── splitted_normal_matrix.h
│ │ │ ├── starting_basis.h
│ │ │ ├── symbolic_invert.h
│ │ │ ├── timer.h
│ │ │ └── utils.h
│ │ ├── lp_data/
│ │ │ ├── HConst.h
│ │ │ ├── HStruct.h
│ │ │ ├── HighsAnalysis.h
│ │ │ ├── HighsCallback.h
│ │ │ ├── HighsCallbackStruct.h
│ │ │ ├── HighsDebug.h
│ │ │ ├── HighsIis.h
│ │ │ ├── HighsInfo.h
│ │ │ ├── HighsInfoDebug.h
│ │ │ ├── HighsLp.h
│ │ │ ├── HighsLpSolverObject.h
│ │ │ ├── HighsLpUtils.h
│ │ │ ├── HighsModelUtils.h
│ │ │ ├── HighsOptions.h
│ │ │ ├── HighsRanging.h
│ │ │ ├── HighsSolution.h
│ │ │ ├── HighsSolutionDebug.h
│ │ │ ├── HighsSolve.h
│ │ │ └── HighsStatus.h
│ │ ├── mip/
│ │ │ ├── HighsCliqueTable.h
│ │ │ ├── HighsConflictPool.h
│ │ │ ├── HighsCutGeneration.h
│ │ │ ├── HighsCutPool.h
│ │ │ ├── HighsDebugSol.h
│ │ │ ├── HighsDomain.h
│ │ │ ├── HighsDomainChange.h
│ │ │ ├── HighsDynamicRowMatrix.h
│ │ │ ├── HighsGFkSolve.h
│ │ │ ├── HighsImplications.h
│ │ │ ├── HighsLpAggregator.h
│ │ │ ├── HighsLpRelaxation.h
│ │ │ ├── HighsMipAnalysis.h
│ │ │ ├── HighsMipSolver.h
│ │ │ ├── HighsMipSolverData.h
│ │ │ ├── HighsModkSeparator.h
│ │ │ ├── HighsNodeQueue.h
│ │ │ ├── HighsObjectiveFunction.h
│ │ │ ├── HighsPathSeparator.h
│ │ │ ├── HighsPrimalHeuristics.h
│ │ │ ├── HighsPseudocost.h
│ │ │ ├── HighsRedcostFixing.h
│ │ │ ├── HighsSearch.h
│ │ │ ├── HighsSeparation.h
│ │ │ ├── HighsSeparator.h
│ │ │ ├── HighsTableauSeparator.h
│ │ │ ├── HighsTransformedLp.h
│ │ │ ├── MipTimer.h
│ │ │ └── feasibilityjump.hh
│ │ ├── model/
│ │ │ ├── HighsHessian.h
│ │ │ ├── HighsHessianUtils.h
│ │ │ └── HighsModel.h
│ │ ├── parallel/
│ │ │ ├── HighsBinarySemaphore.h
│ │ │ ├── HighsCacheAlign.h
│ │ │ ├── HighsCombinable.h
│ │ │ ├── HighsMutex.h
│ │ │ ├── HighsParallel.h
│ │ │ ├── HighsRaceTimer.h
│ │ │ ├── HighsSchedulerConstants.h
│ │ │ ├── HighsSpinMutex.h
│ │ │ ├── HighsSplitDeque.h
│ │ │ ├── HighsTask.h
│ │ │ └── HighsTaskExecutor.h
│ │ ├── pdlp/
│ │ │ ├── CupdlpWrapper.h
│ │ │ └── cupdlp/
│ │ │ ├── cupdlp_cs.h
│ │ │ ├── cupdlp_defs.h
│ │ │ ├── cupdlp_linalg.h
│ │ │ ├── cupdlp_proj.h
│ │ │ ├── cupdlp_restart.h
│ │ │ ├── cupdlp_scaling.h
│ │ │ ├── cupdlp_solver.h
│ │ │ ├── cupdlp_step.h
│ │ │ └── cupdlp_utils.c
│ │ ├── pdqsort/
│ │ │ └── pdqsort.h
│ │ ├── presolve/
│ │ │ ├── HPresolve.h
│ │ │ ├── HPresolveAnalysis.h
│ │ │ ├── HighsPostsolveStack.h
│ │ │ ├── HighsSymmetry.h
│ │ │ ├── ICrash.h
│ │ │ ├── ICrashUtil.h
│ │ │ ├── ICrashX.h
│ │ │ └── PresolveComponent.h
│ │ ├── qpsolver/
│ │ │ ├── a_asm.hpp
│ │ │ ├── a_quass.hpp
│ │ │ ├── basis.hpp
│ │ │ ├── crashsolution.hpp
│ │ │ ├── dantzigpricing.hpp
│ │ │ ├── devexpricing.hpp
│ │ │ ├── eventhandler.hpp
│ │ │ ├── factor.hpp
│ │ │ ├── feasibility_bounded.hpp
│ │ │ ├── feasibility_highs.hpp
│ │ │ ├── gradient.hpp
│ │ │ ├── instance.hpp
│ │ │ ├── matrix.hpp
│ │ │ ├── perturbation.hpp
│ │ │ ├── pricing.hpp
│ │ │ ├── qpconst.hpp
│ │ │ ├── qpvector.hpp
│ │ │ ├── quass.hpp
│ │ │ ├── ratiotest.hpp
│ │ │ ├── runtime.hpp
│ │ │ ├── scaling.hpp
│ │ │ ├── settings.hpp
│ │ │ ├── snippets.hpp
│ │ │ ├── statistics.hpp
│ │ │ └── steepestedgepricing.hpp
│ │ ├── simplex/
│ │ │ ├── HApp.h
│ │ │ ├── HEkk.h
│ │ │ ├── HEkkDual.h
│ │ │ ├── HEkkDualRHS.h
│ │ │ ├── HEkkDualRow.h
│ │ │ ├── HEkkPrimal.h
│ │ │ ├── HSimplex.h
│ │ │ ├── HSimplexDebug.h
│ │ │ ├── HSimplexNla.h
│ │ │ ├── HSimplexReport.h
│ │ │ ├── HighsSimplexAnalysis.h
│ │ │ ├── SimplexConst.h
│ │ │ ├── SimplexStruct.h
│ │ │ └── SimplexTimer.h
│ │ ├── test_kkt/
│ │ │ ├── DevKkt.h
│ │ │ └── KktCh2.h
│ │ ├── util/
│ │ │ ├── FactorTimer.h
│ │ │ ├── HFactor.h
│ │ │ ├── HFactorConst.h
│ │ │ ├── HFactorDebug.h
│ │ │ ├── HSet.h
│ │ │ ├── HVector.h
│ │ │ ├── HVectorBase.h
│ │ │ ├── HighsCDouble.h
│ │ │ ├── HighsComponent.h
│ │ │ ├── HighsDataStack.h
│ │ │ ├── HighsDisjointSets.h
│ │ │ ├── HighsHash.h
│ │ │ ├── HighsHashTree.h
│ │ │ ├── HighsInt.h
│ │ │ ├── HighsIntegers.h
│ │ │ ├── HighsLinearSumBounds.h
│ │ │ ├── HighsMatrixPic.h
│ │ │ ├── HighsMatrixSlice.h
│ │ │ ├── HighsMatrixUtils.h
│ │ │ ├── HighsMemoryAllocation.h
│ │ │ ├── HighsRandom.h
│ │ │ ├── HighsRbTree.h
│ │ │ ├── HighsSort.h
│ │ │ ├── HighsSparseMatrix.h
│ │ │ ├── HighsSparseVectorSum.h
│ │ │ ├── HighsSplay.h
│ │ │ ├── HighsTimer.h
│ │ │ ├── HighsUtils.h
│ │ │ └── stringutil.h
│ │ └── zstr/
│ │ ├── strict_fstream.hpp
│ │ └── zstr.hpp
│ ├── ipopt/
│ │ ├── IpReturnCodes.h
│ │ ├── IpReturnCodes.inc
│ │ ├── IpReturnCodes_inc.h
│ │ ├── IpStdCInterface.h
│ │ ├── IpTypes.h
│ │ └── IpoptConfig.h
│ ├── knitro/
│ │ └── knitro.h
│ ├── mosek/
│ │ ├── mosek_linux.h
│ │ └── mosek_win.h
│ └── xpress/
│ ├── function_list.txt
│ └── xpress_forward_decls.h
└── tcc/
└── libtcc.h
Showing preview only (456K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4950 symbols across 667 files)
FILE: bench/bench_linopy_cvxpy.py
function create_linopy_model (line 14) | def create_linopy_model(N):
function create_cvxpy_model (line 24) | def create_cvxpy_model(N):
function create_poi_model (line 35) | def create_poi_model(Model, N):
function bench (line 50) | def bench(N, solver_name):
function main (line 83) | def main(solver_name="gurobi"):
FILE: bench/bench_modify.py
function bench_poi_base (line 11) | def bench_poi_base(model, N, M):
function bench_poi_gurobi (line 35) | def bench_poi_gurobi(N, M):
function bench_poi_copt (line 40) | def bench_poi_copt(N, M):
function bench_gp (line 45) | def bench_gp(N, M):
function bench_cp (line 68) | def bench_cp(N, M):
function main (line 92) | def main(N, M):
FILE: bench/bench_static.py
function bench_poi_base (line 14) | def bench_poi_base(model, M, N):
function bench_poi_gurobi (line 35) | def bench_poi_gurobi(M, N):
function bench_poi_copt (line 40) | def bench_poi_copt(M, N):
function bench_poi_mosek (line 45) | def bench_poi_mosek(M, N):
function bench_pyomo_base (line 50) | def bench_pyomo_base(solver, M, N):
function bench_pyomo_gurobi (line 68) | def bench_pyomo_gurobi(M, N):
function bench_pyomo_mosek (line 75) | def bench_pyomo_mosek(M, N):
function bench_linopy_gurobi (line 82) | def bench_linopy_gurobi(M, N):
function bench_gp (line 95) | def bench_gp(M, N):
function bench_cp (line 115) | def bench_cp(M, N):
function streamprinter (line 136) | def streamprinter(text):
function bench_msk (line 140) | def bench_msk(M, N):
FILE: bench/nqueens/nqueens_gurobipy.py
function solve_nqueens (line 7) | def solve_nqueens(N):
function main (line 32) | def main(Ns=range(800, 2001, 400)):
FILE: bench/nqueens/nqueens_poi.py
function solve_nqueens (line 8) | def solve_nqueens(N):
function main (line 33) | def main(Ns=range(800, 2001, 400)):
FILE: bench/nqueens/nqueens_pythonmip.py
function solve_nqueens (line 8) | def solve_nqueens(N):
function main (line 34) | def main(Ns=range(800, 2001, 400)):
FILE: bench/test_delete.py
function bench_poi_base (line 7) | def bench_poi_base(N):
function gp_delete (line 28) | def gp_delete(N):
function cp_delete (line 48) | def cp_delete(N):
FILE: include/pyoptinterface/cache_model.hpp
type LinearExpressionCache (line 11) | struct LinearExpressionCache
method add_row (line 18) | void add_row(std::span<const IT> row_variables, std::span<const FT> ro...
type QuadraticExpressionCache (line 28) | struct QuadraticExpressionCache
method add_row (line 40) | void add_row(std::span<const IT> row_variable_1s, std::span<const IT> ...
FILE: include/pyoptinterface/container.hpp
class MonotoneVector (line 14) | class MonotoneVector
method MonotoneVector (line 24) | MonotoneVector() = default;
method MonotoneVector (line 25) | MonotoneVector(T start) : m_start(start), m_update_start(start)
method IndexT (line 29) | IndexT add_index()
method delete_index (line 36) | void delete_index(const IndexT &index)
method has_index (line 50) | bool has_index(const IndexT &index)
method T (line 54) | T get_index(const IndexT &index)
method num_active_indices (line 66) | std::size_t num_active_indices() const
method get_active_indices (line 70) | std::vector<IndexT> get_active_indices() const
method update_to (line 83) | void update_to(IndexT index)
method clear (line 148) | void clear()
class ChunkedBitVector (line 158) | class ChunkedBitVector
method ChunkedBitVector (line 161) | ChunkedBitVector(ResultT start = 0) : m_start(start)
method IndexT (line 166) | IndexT add_index()
method IndexT (line 191) | IndexT add_indices(int N)
method delete_index (line 252) | void delete_index(const IndexT &index)
method has_index (line 280) | bool has_index(const IndexT &index) const
method ResultT (line 289) | ResultT get_index(const IndexT &index)
method update_to (line 315) | void update_to(std::size_t chunk_index)
method locate_index (line 332) | void locate_index(IndexT index, std::size_t &chunk_index, std::uint8_t...
method clear (line 338) | void clear()
type std::uint8_t (line 348) | enum : std::uint8_t
class SimpleMonotoneVector (line 364) | class SimpleMonotoneVector
method SimpleMonotoneVector (line 371) | SimpleMonotoneVector() = default;
method SimpleMonotoneVector (line 372) | SimpleMonotoneVector(T start) : m_start(start)
method IndexT (line 376) | IndexT add_index()
method delete_index (line 382) | void delete_index(const IndexT &index)
method has_index (line 394) | bool has_index(const IndexT &index)
method T (line 398) | T get_index(const IndexT &index)
method clear (line 406) | void clear()
FILE: include/pyoptinterface/copt_model.hpp
type copt (line 104) | namespace copt
class COPTEnvConfig (line 115) | class COPTEnvConfig
class COPTEnv (line 129) | class COPTEnv
type COPTfreemodelT (line 144) | struct COPTfreemodelT
class COPTModel (line 152) | class COPTModel
method COPTModel (line 190) | COPTModel() = default;
type COPTCallbackUserdata (line 155) | struct COPTCallbackUserdata
type COPTLoggingCallbackUserdata (line 176) | struct COPTLoggingCallbackUserdata
class COPTModel (line 181) | class COPTModel : public OnesideLinearConstraintMixin<COPTModel>,
method COPTModel (line 190) | COPTModel() = default;
FILE: include/pyoptinterface/core.hpp
type VariableIndex (line 22) | struct VariableIndex
method VariableIndex (line 39) | VariableIndex() = default;
type ScalarAffineFunction (line 23) | struct ScalarAffineFunction
method ScalarAffineFunction (line 49) | ScalarAffineFunction() = default;
type ScalarQuadraticFunction (line 24) | struct ScalarQuadraticFunction
method ScalarQuadraticFunction (line 77) | ScalarQuadraticFunction() = default;
type ExprBuilder (line 25) | struct ExprBuilder
method ExprBuilder (line 125) | ExprBuilder() = default;
type VariableDomain (line 27) | enum class VariableDomain
type VariableIndex (line 35) | struct VariableIndex
method VariableIndex (line 39) | VariableIndex() = default;
type ScalarAffineFunction (line 43) | struct ScalarAffineFunction
method ScalarAffineFunction (line 49) | ScalarAffineFunction() = default;
type ScalarQuadraticFunction (line 70) | struct ScalarQuadraticFunction
method ScalarQuadraticFunction (line 77) | ScalarQuadraticFunction() = default;
type VariablePair (line 93) | struct VariablePair
method VariablePair (line 101) | VariablePair() = default;
method VariablePair (line 102) | VariablePair(IndexT v1, IndexT v2) : var_1(v1), var_2(v2)
type ankerl::unordered_dense::hash<VariablePair> (line 108) | struct ankerl::unordered_dense::hash<VariablePair>
type ExprBuilder (line 119) | struct ExprBuilder
method ExprBuilder (line 125) | ExprBuilder() = default;
type ConstraintType (line 267) | enum class ConstraintType
type SOSType (line 278) | enum class SOSType
type ConstraintSense (line 284) | enum class ConstraintSense
type ConstraintIndex (line 291) | struct ConstraintIndex
method ConstraintIndex (line 296) | ConstraintIndex() = default;
method ConstraintIndex (line 297) | ConstraintIndex(ConstraintType t, IndexT i) : type(t), index(i)
type ObjectiveSense (line 322) | enum class ObjectiveSense
FILE: include/pyoptinterface/cppad_interface.hpp
type JacobianHessianSparsityPattern (line 13) | struct JacobianHessianSparsityPattern
type CppADAutodiffGraph (line 42) | struct CppADAutodiffGraph
FILE: include/pyoptinterface/dylib.hpp
class DynamicLibrary (line 11) | class DynamicLibrary
method DynamicLibrary (line 14) | DynamicLibrary() : handle(nullptr)
method try_load (line 30) | bool try_load(const char *library)
method LibraryIsLoaded (line 48) | bool LibraryIsLoaded() const
FILE: include/pyoptinterface/gurobi_model.hpp
type gurobi (line 80) | namespace gurobi
class GurobiEnv (line 91) | class GurobiEnv
type GRBfreemodelT (line 111) | struct GRBfreemodelT
class GurobiModel (line 119) | class GurobiModel
method GurobiModel (line 154) | GurobiModel() = default;
type std::uint64_t (line 356) | enum : std::uint64_t
type GurobiCallbackUserdata (line 122) | struct GurobiCallbackUserdata
type GurobiLoggingCallbackUserdata (line 141) | struct GurobiLoggingCallbackUserdata
class GurobiModel (line 146) | class GurobiModel : public OnesideLinearConstraintMixin<GurobiModel>,
method GurobiModel (line 154) | GurobiModel() = default;
type std::uint64_t (line 356) | enum : std::uint64_t
FILE: include/pyoptinterface/highs_model.hpp
type highs (line 70) | namespace highs
type HighsfreemodelT (line 81) | struct HighsfreemodelT
type HighsSolutionStatus (line 89) | enum class HighsSolutionStatus
type POIHighsSolution (line 96) | struct POIHighsSolution
class POIHighsModel (line 114) | class POIHighsModel : public OnesideLinearConstraintMixin<POIHighsModel>,
FILE: include/pyoptinterface/ipopt_model.hpp
type ipopt (line 19) | namespace ipopt
type IpoptfreeproblemT (line 30) | struct IpoptfreeproblemT
type IpoptResult (line 38) | struct IpoptResult
type IpoptModel (line 46) | struct IpoptModel : public OnesideLinearConstraintMixin<IpoptModel>,
type GraphInstancesInfo (line 106) | struct GraphInstancesInfo
type GraphInstancesGroupInfo (line 117) | struct GraphInstancesGroupInfo
type ConstraintGraphMembership (line 197) | struct ConstraintGraphMembership
type ApplicationReturnStatus (line 244) | enum ApplicationReturnStatus
FILE: include/pyoptinterface/knitro_model.hpp
type knitro (line 82) | namespace knitro
type KNITROFreeProblemT (line 95) | struct KNITROFreeProblemT
type KNITROFreeLicenseT (line 106) | struct KNITROFreeLicenseT
type ObjectiveFlags (line 117) | enum ObjectiveFlags
type ConstraintSenseFlags (line 125) | enum ConstraintSenseFlags
type CallbackPattern (line 132) | struct CallbackPattern
type CallbackEvaluator (line 145) | struct CallbackEvaluator
method setup (line 170) | void setup()
method is_objective (line 222) | bool is_objective() const
method eval_fun (line 227) | void eval_fun(const V *req_x, V *res_y)
method eval_jac (line 235) | void eval_jac(const V *req_x, V *res_jac)
method eval_hess (line 242) | void eval_hess(const V *req_x, const V *req_w, V *res_hess)
method get_callback_pattern (line 251) | CallbackPattern<I> get_callback_pattern() const
method copy (line 290) | static void copy(const size_t n, const V *src, const I *idx, V *dst, i...
function is_name_empty (line 331) | inline bool is_name_empty(const char *name)
function knitro_var_type (line 336) | inline int knitro_var_type(VariableDomain domain)
function VariableDomain (line 351) | inline VariableDomain knitro_variable_domain(int var_type)
function knitro_obj_goal (line 366) | inline int knitro_obj_goal(ObjectiveSense sense)
function ObjectiveSense (line 379) | inline ObjectiveSense knitro_obj_sense(int goal)
function knitro_throw (line 392) | inline void knitro_throw(int error)
class KNITROEnv (line 400) | class KNITROEnv
method KNITROEnv (line 405) | KNITROEnv(const KNITROEnv &) = delete;
method KNITROEnv (line 406) | KNITROEnv &operator=(const KNITROEnv &) = delete;
method KNITROEnv (line 408) | KNITROEnv(KNITROEnv &&) = default;
method KNITROEnv (line 409) | KNITROEnv &operator=(KNITROEnv &&) = default;
class KNITROModel (line 421) | class KNITROModel : public OnesideLinearConstraintMixin<KNITROModel>,
method KNITROModel (line 435) | KNITROModel(const KNITROModel &) = delete;
method KNITROModel (line 436) | KNITROModel &operator=(const KNITROModel &) = delete;
method KNITROModel (line 438) | KNITROModel(KNITROModel &&) = default;
method KNITROModel (line 439) | KNITROModel &operator=(KNITROModel &&) = default;
method set_raw_parameter (line 529) | void set_raw_parameter(const std::string &name, T value)
method set_raw_parameter (line 536) | void set_raw_parameter(int param_id, T value)
method T (line 566) | T get_raw_parameter(const std::string &name)
method T (line 573) | T get_raw_parameter(int param_id)
type Outputs (line 612) | struct Outputs
method ConstraintIndex (line 655) | ConstraintIndex _add_constraint_impl(ConstraintType type,
method ConstraintIndex (line 700) | ConstraintIndex _add_constraint_with_sense(const S &function, Constrai...
method _set_objective_impl (line 710) | void _set_objective_impl(ObjectiveSense sense, const F &setter)
method V (line 724) | V _get_value(Getter<V> get) const
method _set_value (line 733) | void _set_value(Setter<V> set, V value)
method V (line 745) | V _get_value(GetterMap<K, V> get, K key) const
method _set_value (line 754) | void _set_value(SetterMap<K, V> set, K key, V value)
method _get_name (line 761) | std::string _get_name(F get, K key, const char *prefix) const
method KNINT (line 779) | KNINT _get_index(const I &index) const
FILE: include/pyoptinterface/mosek_model.hpp
type mosek (line 90) | namespace mosek
class MOSEKEnv (line 103) | class MOSEKEnv
type MOSEKfreemodelT (line 118) | struct MOSEKfreemodelT
type MOSEKLoggingCallbackUserdata (line 128) | struct MOSEKLoggingCallbackUserdata
class MOSEKModel (line 133) | class MOSEKModel : public OnesideLinearConstraintMixin<MOSEKModel>,
method MOSEKModel (line 142) | MOSEKModel() = default;
FILE: include/pyoptinterface/nleval.hpp
type HessianSparsityType (line 9) | enum class HessianSparsityType
type AutodiffSymbolicStructure (line 15) | struct AutodiffSymbolicStructure
type ConstraintAutodiffEvaluator (line 46) | struct ConstraintAutodiffEvaluator
method ConstraintAutodiffEvaluator (line 61) | ConstraintAutodiffEvaluator() = default;
type ObjectiveAutodiffEvaluator (line 66) | struct ObjectiveAutodiffEvaluator
method ObjectiveAutodiffEvaluator (line 81) | ObjectiveAutodiffEvaluator() = default;
type LinearEvaluator (line 88) | struct LinearEvaluator
type QuadraticEvaluator (line 109) | struct QuadraticEvaluator
type NonlinearEvaluator (line 163) | struct NonlinearEvaluator
type GraphInput (line 168) | struct GraphInput
type GraphHash (line 175) | struct GraphHash
type GraphHashes (line 182) | struct GraphHashes
type GraphGroupMembership (line 190) | struct GraphGroupMembership
type ConstraintGraphGroup (line 202) | struct ConstraintGraphGroup
type ObjectiveGraphGroup (line 215) | struct ObjectiveGraphGroup
FILE: include/pyoptinterface/nlexpr.hpp
type ArrayType (line 16) | enum class ArrayType
type UnaryOperator (line 27) | enum class UnaryOperator
type BinaryOperator (line 43) | enum class BinaryOperator
type TernaryOperator (line 64) | enum class TernaryOperator
type NaryOperator (line 69) | enum class NaryOperator
type ExpressionHandle (line 80) | struct ExpressionHandle
method ExpressionHandle (line 87) | ExpressionHandle() = default;
method ExpressionHandle (line 88) | ExpressionHandle(ArrayType array, NodeId id) : array(array), id(id)
type ankerl::unordered_dense::hash<ExpressionHandle> (line 96) | struct ankerl::unordered_dense::hash<ExpressionHandle>
type UnaryNode (line 107) | struct UnaryNode
method UnaryNode (line 112) | UnaryNode(UnaryOperator op, ExpressionHandle operand) : op(op), operan...
type BinaryNode (line 117) | struct BinaryNode
method BinaryNode (line 123) | BinaryNode(BinaryOperator op, ExpressionHandle left, ExpressionHandle ...
type TernaryNode (line 129) | struct TernaryNode
method TernaryNode (line 136) | TernaryNode(TernaryOperator op, ExpressionHandle left, ExpressionHandl...
type NaryNode (line 143) | struct NaryNode
method NaryNode (line 148) | NaryNode(NaryOperator op, const std::vector<ExpressionHandle> &operands)
type ExpressionGraph (line 154) | struct ExpressionGraph
method ExpressionGraph (line 168) | ExpressionGraph() = default;
FILE: include/pyoptinterface/solver_common.hpp
class OnesideLinearConstraintMixin (line 20) | class OnesideLinearConstraintMixin
method T (line 23) | T *get_base()
method ConstraintIndex (line 30) | ConstraintIndex add_linear_constraint_from_var(const VariableIndex &va...
method ConstraintIndex (line 37) | ConstraintIndex add_linear_constraint_from_expr(const ExprBuilder &fun...
class TwosideLinearConstraintMixin (line 59) | class TwosideLinearConstraintMixin
method T (line 62) | T *get_base()
method ConstraintIndex (line 69) | ConstraintIndex add_linear_interval_constraint_from_var(
method ConstraintIndex (line 76) | ConstraintIndex add_linear_interval_constraint_from_expr(
class OnesideQuadraticConstraintMixin (line 93) | class OnesideQuadraticConstraintMixin
method T (line 96) | T *get_base()
method ConstraintIndex (line 103) | ConstraintIndex add_quadratic_constraint_from_var(const VariableIndex ...
method ConstraintIndex (line 110) | ConstraintIndex add_quadratic_constraint_from_saf(const ScalarAffineFu...
method ConstraintIndex (line 117) | ConstraintIndex add_quadratic_constraint_from_expr(const ExprBuilder &...
class TwosideQuadraticConstraintMixin (line 134) | class TwosideQuadraticConstraintMixin
method T (line 137) | T *get_base()
method ConstraintIndex (line 144) | ConstraintIndex add_quadratic_interval_constraint_from_var(
method ConstraintIndex (line 151) | ConstraintIndex add_quadratic_interval_constraint_from_expr(
class TwosideNLConstraintMixin (line 173) | class TwosideNLConstraintMixin
method T (line 176) | T *get_base()
method ConstraintIndex (line 183) | ConstraintIndex add_single_nl_constraint_sense_rhs(ExpressionGraph &gr...
method ConstraintIndex (line 211) | ConstraintIndex add_single_nl_constraint_from_comparison(ExpressionGra...
class GetValueMixin (line 230) | class GetValueMixin
method T (line 233) | T *get_base()
method get_expression_value (line 240) | double get_expression_value(const ScalarAffineFunction &function)
method get_expression_value (line 252) | double get_expression_value(const ScalarQuadraticFunction &function)
method get_expression_value (line 280) | double get_expression_value(const ExprBuilder &function)
class PPrintMixin (line 315) | class PPrintMixin
method T (line 318) | T *get_base()
method pprint_expression (line 325) | std::string pprint_expression(const ScalarAffineFunction &function, in...
method pprint_expression (line 352) | std::string pprint_expression(const ScalarQuadraticFunction &function,...
method pprint_expression (line 389) | std::string pprint_expression(const ExprBuilder &function, int precisi...
class LinearObjectiveMixin (line 437) | class LinearObjectiveMixin
method T (line 440) | T *get_base()
method set_objective_as_constant (line 447) | void set_objective_as_constant(CoeffT c, ObjectiveSense sense)
method set_objective_as_variable (line 452) | void set_objective_as_variable(const VariableIndex &variable, Objectiv...
type AffineFunctionPtrForm (line 469) | struct AffineFunctionPtrForm
method make (line 478) | void make(T *model, const ScalarAffineFunction &function)
type QuadraticFunctionPtrForm (line 504) | struct QuadraticFunctionPtrForm
method make (line 515) | void make(T *model, const ScalarQuadraticFunction &function)
type HessianTriangular (line 550) | enum class HessianTriangular
type CSCMatrix (line 557) | struct CSCMatrix
method make (line 566) | void make(T *model, const ScalarQuadraticFunction &function, int i_num...
FILE: include/pyoptinterface/tcc_interface.hpp
type tcc (line 26) | namespace tcc
type TCCFreeT (line 37) | struct TCCFreeT
type TCCInstance (line 45) | struct TCCInstance
method TCCInstance (line 47) | TCCInstance() = default;
FILE: include/pyoptinterface/xpress_model.hpp
type xpress (line 216) | namespace xpress
type Env (line 232) | struct Env
type CATypes (line 245) | enum class CATypes : int
type SOLSTATUS (line 254) | enum class SOLSTATUS : int
type SOLVESTATUS (line 263) | enum class SOLVESTATUS : int
type LPSTATUS (line 271) | enum class LPSTATUS : int
type MIPSTATUS (line 284) | enum class MIPSTATUS : int
type NLPSTATUS (line 296) | enum class NLPSTATUS : int
type IISSOLSTATUS (line 310) | enum class IISSOLSTATUS : int
type SOLAVAILABLE (line 318) | enum class SOLAVAILABLE : int
type OPTIMIZETYPE (line 325) | enum class OPTIMIZETYPE : int
type CB_CONTEXT (line 341) | enum class CB_CONTEXT : unsigned long long
class Model (line 349) | class Model
method Model (line 481) | Model() = default;
method Model (line 485) | Model(const Model &) = delete;
method Model (line 486) | Model &operator=(const Model &) = delete;
method Model (line 489) | Model(Model &&) noexcept = default;
method Model (line 490) | Model &operator=(Model &&) noexcept = default;
type CbWrap (line 685) | struct CbWrap
type ProbDeleter (line 688) | struct ProbDeleter
type XPRESS_MODEL_MODE (line 366) | enum class XPRESS_MODEL_MODE
type ReturnValue (line 374) | struct ReturnValue
method T (line 377) | T get_return_value() const
type ReturnValue<void> (line 384) | struct ReturnValue<void>
type StructFieldType (line 394) | struct StructFieldType
type StructFieldType<XPRSbranchobject> (line 407) | struct StructFieldType<XPRSbranchobject>
type StructFieldType<XPRSbranchobject *> (line 413) | struct StructFieldType<XPRSbranchobject *>
type Tvp (line 462) | struct Tvp
class Model (line 471) | class Model : public OnesideLinearConstraintMixin<Model>,
method Model (line 481) | Model() = default;
method Model (line 485) | Model(const Model &) = delete;
method Model (line 486) | Model &operator=(const Model &) = delete;
method Model (line 489) | Model(Model &&) noexcept = default;
method Model (line 490) | Model &operator=(Model &&) noexcept = default;
type CbWrap (line 685) | struct CbWrap
type ProbDeleter (line 688) | struct ProbDeleter
FILE: lib/copt_model.cpp
type copt (line 6) | namespace copt
function is_library_loaded (line 15) | bool is_library_loaded()
function load_library (line 20) | bool load_library(const std::string &path)
function check_error (line 49) | static void check_error(int error)
function copt_con_sense (line 60) | static char copt_con_sense(ConstraintSense sense)
function copt_obj_sense (line 75) | static int copt_obj_sense(ObjectiveSense sense)
function copt_vtype (line 88) | static char copt_vtype(VariableDomain domain)
function VariableDomain (line 103) | static VariableDomain copt_vtype_to_domain(char vtype)
function copt_sostype (line 118) | static int copt_sostype(SOSType type)
function VariableIndex (line 200) | VariableIndex COPTModel::add_variable(VariableDomain domain, double lb, ...
function ConstraintIndex (line 282) | ConstraintIndex COPTModel::add_linear_constraint(const ScalarAffineFunct...
function ConstraintIndex (line 308) | ConstraintIndex COPTModel::add_linear_constraint(const ScalarAffineFunct...
function ConstraintIndex (line 343) | ConstraintIndex COPTModel::add_quadratic_constraint(const ScalarQuadrati...
function ConstraintIndex (line 388) | ConstraintIndex COPTModel::add_sos_constraint(const Vector<VariableIndex...
function ConstraintIndex (line 395) | ConstraintIndex COPTModel::add_sos_constraint(const Vector<VariableIndex...
function ConstraintIndex (line 419) | ConstraintIndex COPTModel::add_second_order_cone_constraint(const Vector...
function ConstraintIndex (line 451) | ConstraintIndex COPTModel::add_exp_cone_constraint(const Vector<Variable...
function unary_opcode (line 488) | int unary_opcode(const UnaryOperator &op)
function binary_opcode (line 524) | int binary_opcode(const BinaryOperator &op)
function nary_opcode (line 544) | int nary_opcode(const NaryOperator &op)
function ConstraintIndex (line 681) | ConstraintIndex COPTModel::add_single_nl_constraint(ExpressionGraph &graph,
function VariableDomain (line 994) | VariableDomain COPTModel::get_variable_type(const VariableIndex &variable)
function RealLoggingCallbackFunction (line 1394) | static void RealLoggingCallbackFunction(char *msg, void *logdata)
function RealCOPTCallbackFunction (line 1410) | static int RealCOPTCallbackFunction(copt_prob *prob, void *cbdata, int c...
FILE: lib/copt_model_ext.cpp
function NB_MODULE (line 13) | NB_MODULE(copt_model_ext, m)
FILE: lib/copt_model_ext_constants.cpp
function bind_copt_constants (line 5) | void bind_copt_constants(nb::module_ &m)
FILE: lib/core.cpp
function ExprBuilder (line 390) | ExprBuilder &ExprBuilder::operator+=(CoeffT c)
function ExprBuilder (line 395) | ExprBuilder &ExprBuilder::operator+=(const VariableIndex &v)
function ExprBuilder (line 400) | ExprBuilder &ExprBuilder::operator+=(const ScalarAffineFunction &a)
function ExprBuilder (line 414) | ExprBuilder &ExprBuilder::operator+=(const ScalarQuadraticFunction &q)
function ExprBuilder (line 428) | ExprBuilder &ExprBuilder::operator+=(const ExprBuilder &t)
function ExprBuilder (line 463) | ExprBuilder &ExprBuilder::operator-=(CoeffT c)
function ExprBuilder (line 468) | ExprBuilder &ExprBuilder::operator-=(const VariableIndex &v)
function ExprBuilder (line 473) | ExprBuilder &ExprBuilder::operator-=(const ScalarAffineFunction &a)
function ExprBuilder (line 487) | ExprBuilder &ExprBuilder::operator-=(const ScalarQuadraticFunction &q)
function ExprBuilder (line 501) | ExprBuilder &ExprBuilder::operator-=(const ExprBuilder &t)
function ExprBuilder (line 527) | ExprBuilder &ExprBuilder::operator*=(CoeffT c)
function ExprBuilder (line 543) | ExprBuilder &ExprBuilder::operator*=(const VariableIndex &v)
function ExprBuilder (line 570) | ExprBuilder &ExprBuilder::operator*=(const ScalarAffineFunction &a)
function ExprBuilder (line 626) | ExprBuilder &ExprBuilder::operator*=(const ScalarQuadraticFunction &q)
function ExprBuilder (line 672) | ExprBuilder &ExprBuilder::operator*=(const ExprBuilder &t)
function ExprBuilder (line 832) | ExprBuilder &ExprBuilder::operator/=(CoeffT c)
FILE: lib/core_ext.cpp
function NB_MODULE (line 18) | NB_MODULE(core_ext, m)
FILE: lib/cppad_interface.cpp
function ADFunDouble (line 7) | ADFunDouble dense_jacobian(const ADFunDouble &f)
function JacobianHessianSparsityPattern (line 34) | JacobianHessianSparsityPattern jacobian_hessian_sparsity(ADFunDouble &f,
function ADFunDouble (line 108) | ADFunDouble sparse_jacobian(const ADFunDouble &f, const sparsity_pattern...
function ADFunDouble (line 152) | ADFunDouble sparse_hessian(const ADFunDouble &f, const sparsity_pattern_...
function cppad_build_unary_expression (line 205) | CppAD::AD<double> cppad_build_unary_expression(UnaryOperator op, const C...
function cppad_build_binary_expression (line 252) | CppAD::AD<double> cppad_build_binary_expression(BinaryOperator op, const...
function cppad_build_ternary_expression (line 282) | CppAD::AD<double> cppad_build_ternary_expression(BinaryOperator compare_op,
function cppad_build_nary_expression (line 315) | CppAD::AD<double> cppad_build_nary_expression(NaryOperator op,
function cppad_trace_expression (line 346) | CppAD::AD<double> cppad_trace_expression(
function ADFunDouble (line 430) | ADFunDouble cppad_trace_graph_constraints(const ExpressionGraph &graph,
function ADFunDouble (line 489) | ADFunDouble cppad_trace_graph_objective(const ExpressionGraph &graph,
function cppad_autodiff (line 558) | void cppad_autodiff(ADFunDouble &f, AutodiffSymbolicStructure &structure...
FILE: lib/cppad_interface_ext.cpp
type cpp_graph_cursor (line 13) | struct cpp_graph_cursor
function graph_op_enum (line 19) | graph_op_enum cursor_op(CppAD::cpp_graph &graph, cpp_graph_cursor &cursor)
function cursor_n_arg (line 24) | size_t cursor_n_arg(CppAD::cpp_graph &graph, cpp_graph_cursor &cursor)
function advance_graph_cursor (line 86) | void advance_graph_cursor(CppAD::cpp_graph &graph, cpp_graph_cursor &cur...
function NB_MODULE (line 93) | NB_MODULE(cppad_interface_ext, m)
FILE: lib/gurobi_model.cpp
type gurobi (line 15) | namespace gurobi
function is_library_loaded (line 28) | bool is_library_loaded()
function load_library (line 33) | bool load_library(const std::string &path)
function GRBloadenv_1200 (line 98) | int GRBloadenv_1200(GRBenv **envP, const char *logfile)
function GRBemptyenv_1200 (line 103) | int GRBemptyenv_1200(GRBenv **envP)
function gurobi_con_sense (line 108) | static char gurobi_con_sense(ConstraintSense sense)
function gurobi_obj_sense (line 123) | static int gurobi_obj_sense(ObjectiveSense sense)
function gurobi_vtype (line 136) | static char gurobi_vtype(VariableDomain domain)
function gurobi_sostype (line 153) | static int gurobi_sostype(SOSType type)
function VariableIndex (line 207) | VariableIndex GurobiModel::add_variable(VariableDomain domain, double lb...
function ConstraintIndex (line 321) | ConstraintIndex GurobiModel::add_linear_constraint(const ScalarAffineFun...
function ConstraintIndex (line 352) | ConstraintIndex GurobiModel::add_quadratic_constraint(const ScalarQuadra...
function ConstraintIndex (line 401) | ConstraintIndex GurobiModel::add_sos_constraint(const Vector<VariableInd...
function ConstraintIndex (line 408) | ConstraintIndex GurobiModel::add_sos_constraint(const Vector<VariableInd...
function unary_opcode (line 435) | int unary_opcode(const UnaryOperator &op)
function binary_opcode (line 463) | int binary_opcode(const BinaryOperator &op)
function nary_opcode (line 481) | int nary_opcode(const NaryOperator &op)
function ConstraintIndex (line 603) | ConstraintIndex GurobiModel::add_single_nl_constraint(const ExpressionGr...
function RealLoggingCallbackFunction (line 1408) | static int RealLoggingCallbackFunction(char *msg, void *logdata)
function RealGurobiCallbackFunction (line 1425) | static int RealGurobiCallbackFunction(GRBmodel *, void *cbdata, int wher...
FILE: lib/gurobi_model_ext.cpp
function NB_MODULE (line 13) | NB_MODULE(gurobi_model_ext, m)
FILE: lib/gurobi_model_ext_constants.cpp
function bind_gurobi_constants (line 5) | void bind_gurobi_constants(nb::module_ &m)
FILE: lib/highs_model.cpp
type highs (line 4) | namespace highs
function is_library_loaded (line 13) | bool is_library_loaded()
function load_library (line 18) | bool load_library(const std::string &path)
function check_error (line 47) | static void check_error(HighsInt error)
function HighsInt (line 58) | static HighsInt highs_vtype(VariableDomain domain)
function VariableDomain (line 74) | static VariableDomain highs_vtype_to_domain(HighsInt vtype)
function HighsInt (line 89) | static HighsInt highs_obj_sense(ObjectiveSense sense)
function VariableIndex (line 144) | VariableIndex POIHighsModel::add_variable(VariableDomain domain, double ...
function ConstraintIndex (line 257) | ConstraintIndex POIHighsModel::add_linear_constraint(const ScalarAffineF...
function ConstraintIndex (line 281) | ConstraintIndex POIHighsModel::add_linear_constraint(const ScalarAffineF...
function ConstraintIndex (line 323) | ConstraintIndex POIHighsModel::add_quadratic_constraint(const ScalarQuad...
function VariableDomain (line 663) | VariableDomain POIHighsModel::get_variable_type(const VariableIndex &var...
function ObjectiveSense (line 791) | ObjectiveSense POIHighsModel::get_obj_sense()
function HighsInt (line 813) | HighsInt POIHighsModel::_variable_index(const VariableIndex &variable)
function HighsInt (line 818) | HighsInt POIHighsModel::_checked_variable_index(const VariableIndex &var...
function HighsInt (line 828) | HighsInt POIHighsModel::_constraint_index(const ConstraintIndex &constra...
function HighsInt (line 839) | HighsInt POIHighsModel::_checked_constraint_index(const ConstraintIndex ...
FILE: lib/highs_model_ext.cpp
function NB_MODULE (line 12) | NB_MODULE(highs_model_ext, m)
FILE: lib/highs_model_ext_constants.cpp
function bind_highs_constants (line 6) | void bind_highs_constants(nb::module_ &m)
FILE: lib/ipopt_model.cpp
function is_name_empty (line 9) | static bool is_name_empty(const char *name)
type ipopt (line 14) | namespace ipopt
function is_library_loaded (line 23) | bool is_library_loaded()
function load_library (line 28) | bool load_library(const std::string &path)
function VariableIndex (line 70) | VariableIndex IpoptModel::add_variable(double lb, double ub, double star...
function ConstraintIndex (line 208) | ConstraintIndex IpoptModel::add_linear_constraint(const ScalarAffineFunc...
function ConstraintIndex (line 230) | ConstraintIndex IpoptModel::add_linear_constraint(const ScalarAffineFunc...
function ConstraintIndex (line 247) | ConstraintIndex IpoptModel::add_quadratic_constraint(const ScalarQuadrat...
function ConstraintIndex (line 273) | ConstraintIndex IpoptModel::add_quadratic_constraint(const ScalarQuadrat...
function ConstraintIndex (line 389) | ConstraintIndex IpoptModel::add_single_nl_constraint(size_t graph_index,
function eval_f (line 406) | static bool eval_f(ipindex n, ipnumber *x, bool new_x, ipnumber *obj_val...
function eval_grad_f (line 429) | static bool eval_grad_f(ipindex n, ipnumber *x, bool new_x, ipnumber *gr...
function eval_g (line 468) | static bool eval_g(ipindex n, ipnumber *x, bool new_x, ipindex m, ipnumb...
function eval_jac_g (line 495) | static bool eval_jac_g(ipindex n, ipnumber *x, bool new_x, ipindex m, ip...
function eval_h (line 539) | static bool eval_h(ipindex n, ipnumber *x, bool new_x, ipnumber obj_fact...
FILE: lib/ipopt_model_ext.cpp
function NB_MODULE (line 10) | NB_MODULE(ipopt_model_ext, m)
FILE: lib/knitro_model.cpp
type knitro (line 10) | namespace knitro
function is_library_loaded (line 19) | bool is_library_loaded()
function load_library (line 24) | bool load_library(const std::string &path)
function has_valid_license (line 52) | bool has_valid_license()
function ensure_library_loaded (line 73) | void ensure_library_loaded()
function VariableIndex (line 180) | VariableIndex KNITROModel::add_variable(VariableDomain domain, double lb...
function VariableDomain (line 293) | VariableDomain KNITROModel::get_variable_domain(const VariableIndex &var...
function ConstraintIndex (line 324) | ConstraintIndex KNITROModel::add_linear_constraint(const ScalarAffineFun...
function ConstraintIndex (line 333) | ConstraintIndex KNITROModel::add_linear_constraint(const ScalarAffineFun...
function ConstraintIndex (line 343) | ConstraintIndex KNITROModel::add_quadratic_constraint(const ScalarQuadra...
function ConstraintIndex (line 352) | ConstraintIndex KNITROModel::add_quadratic_constraint(const ScalarQuadra...
function ConstraintIndex (line 362) | ConstraintIndex KNITROModel::add_second_order_cone_constraint(
function ConstraintIndex (line 384) | ConstraintIndex KNITROModel::add_single_nl_constraint(ExpressionGraph &g...
function ConstraintIndex (line 400) | ConstraintIndex KNITROModel::add_single_nl_constraint_sense_rhs(Expressi...
function ObjectiveSense (line 741) | ObjectiveSense KNITROModel::get_obj_sense() const
function KNINT (line 1107) | KNINT KNITROModel::_variable_index(const VariableIndex &variable) const
function KNINT (line 1112) | KNINT KNITROModel::_constraint_index(const ConstraintIndex &constraint) ...
FILE: lib/knitro_model_ext.cpp
function NB_MODULE (line 13) | NB_MODULE(knitro_model_ext, m)
FILE: lib/knitro_model_ext_constants.cpp
function bind_knitro_constants (line 6) | void bind_knitro_constants(nb::module_ &m)
FILE: lib/main.cpp
function test_linear_eval (line 4) | void test_linear_eval()
function test_quadratic_eval (line 35) | void test_quadratic_eval()
function test_cppad_pow_var_par (line 67) | void test_cppad_pow_var_par()
function main (line 105) | auto main() -> int
FILE: lib/mosek_model.cpp
type mosek (line 4) | namespace mosek
function is_library_loaded (line 13) | bool is_library_loaded()
function load_library (line 18) | bool load_library(const std::string &path)
function check_error (line 93) | static void check_error(MSKrescodee error)
function MSKboundkeye (line 107) | static MSKboundkeye mosek_con_sense(ConstraintSense sense)
function MSKobjsensee (line 122) | static MSKobjsensee mosek_obj_sense(ObjectiveSense sense)
function MSKvariabletypee (line 135) | static MSKvariabletypee mosek_vtype(VariableDomain domain)
function VariableDomain (line 149) | static VariableDomain mosek_vtype_to_domain(MSKvariabletypee vtype)
function VariableIndex (line 212) | VariableIndex MOSEKModel::add_variable(VariableDomain domain, double lb,...
function ConstraintIndex (line 408) | ConstraintIndex MOSEKModel::add_linear_constraint(const ScalarAffineFunc...
function ConstraintIndex (line 452) | ConstraintIndex MOSEKModel::add_linear_constraint(const ScalarAffineFunc...
function ConstraintIndex (line 501) | ConstraintIndex MOSEKModel::add_quadratic_constraint(const ScalarQuadrat...
function ConstraintIndex (line 599) | ConstraintIndex MOSEKModel::add_variables_in_cone_constraint(const Vecto...
function ConstraintIndex (line 633) | ConstraintIndex MOSEKModel::add_second_order_cone_constraint(const Vecto...
function ConstraintIndex (line 658) | ConstraintIndex MOSEKModel::add_exp_cone_constraint(const Vector<Variabl...
function MSKint32t (line 926) | MSKint32t MOSEKModel::getnumvar()
function MSKint32t (line 934) | MSKint32t MOSEKModel::getnumcon()
function VariableDomain (line 997) | VariableDomain MOSEKModel::get_variable_type(const VariableIndex &variable)
function ObjectiveSense (line 1255) | ObjectiveSense MOSEKModel::get_obj_sense()
function MSKint32t (line 1408) | MSKint32t MOSEKModel::_variable_index(const VariableIndex &variable)
function MSKint32t (line 1413) | MSKint32t MOSEKModel::_checked_variable_index(const VariableIndex &varia...
function MSKint32t (line 1423) | MSKint32t MOSEKModel::_constraint_index(const ConstraintIndex &constraint)
function MSKint32t (line 1440) | MSKint32t MOSEKModel::_checked_constraint_index(const ConstraintIndex &c...
function RealLoggingCallbackFunction (line 1451) | static void RealLoggingCallbackFunction(void *handle, const char *msg)
function MSKsoltypee (line 1480) | MSKsoltypee MOSEKModel::get_current_solution()
FILE: lib/mosek_model_ext.cpp
function NB_MODULE (line 13) | NB_MODULE(mosek_model_ext, m)
FILE: lib/mosek_model_ext_constants.cpp
function bind_mosek_constants (line 10) | void bind_mosek_constants(nb::module_ &m)
FILE: lib/nleval_ext.cpp
function NB_MODULE (line 8) | NB_MODULE(nleval_ext, m)
FILE: lib/nlexpr.cpp
function ExpressionHandle (line 123) | ExpressionHandle ExpressionGraph::add_variable(EntityId id)
function ExpressionHandle (line 139) | ExpressionHandle ExpressionGraph::add_constant(double value)
function ExpressionHandle (line 145) | ExpressionHandle ExpressionGraph::add_parameter(EntityId id)
function ExpressionHandle (line 151) | ExpressionHandle ExpressionGraph::add_unary(UnaryOperator op, Expression...
function ExpressionHandle (line 207) | ExpressionHandle ExpressionGraph::add_binary(BinaryOperator op, Expressi...
function ExpressionHandle (line 243) | ExpressionHandle ExpressionGraph::add_ternary(TernaryOperator op, Expres...
function ExpressionHandle (line 250) | ExpressionHandle ExpressionGraph::add_nary(NaryOperator op,
function ExpressionHandle (line 294) | ExpressionHandle ExpressionGraph::add_repeat_nary(NaryOperator op, Expre...
function NaryOperator (line 307) | NaryOperator ExpressionGraph::get_nary_operator(const ExpressionHandle &...
function ExpressionHandle (line 333) | ExpressionHandle ExpressionGraph::merge_variableindex(const VariableInde...
function ExpressionHandle (line 338) | ExpressionHandle ExpressionGraph::merge_scalaraffinefunction(const Scala...
function ExpressionHandle (line 377) | ExpressionHandle ExpressionGraph::merge_scalarquadraticfunction(const Sc...
function ExpressionHandle (line 429) | ExpressionHandle ExpressionGraph::merge_exprbuilder(const ExprBuilder &e...
function is_binary_compare_op (line 497) | bool is_binary_compare_op(BinaryOperator op)
function unary_operator_to_string (line 513) | std::string unary_operator_to_string(UnaryOperator op)
function binary_operator_to_string (line 546) | std::string binary_operator_to_string(BinaryOperator op)
function ternary_operator_to_string (line 577) | std::string ternary_operator_to_string(TernaryOperator op)
function nary_operator_to_string (line 588) | std::string nary_operator_to_string(NaryOperator op)
function hash_combine (line 601) | inline static void hash_combine(uint64_t &hash, const uint64_t subhash)
function to_i64 (line 606) | inline static uint64_t to_i64(const ExpressionHandle &expr)
function unpack_comparison_expression (line 667) | void unpack_comparison_expression(ExpressionGraph &graph, const Expressi...
FILE: lib/nlexpr_ext.cpp
function NB_MODULE (line 10) | NB_MODULE(nlexpr_ext, m)
FILE: lib/tcc_interface.cpp
type tcc (line 6) | namespace tcc
function is_library_loaded (line 15) | bool is_library_loaded()
function load_library (line 20) | bool load_library(const std::string &path)
FILE: lib/tcc_interface_ext.cpp
function NB_MODULE (line 8) | NB_MODULE(tcc_interface_ext, m)
FILE: lib/xpress_model.cpp
type xpress (line 15) | namespace xpress
type Defer (line 21) | struct Defer : LmdT
method Defer (line 23) | Defer(LmdT l) : LmdT(l) {}
function is_library_loaded (line 38) | bool is_library_loaded()
function load_library (line 43) | bool load_library(const std::string &path)
function check_license (line 78) | static void check_license(int error)
function license (line 143) | std::pair<int, std::string> license(int p_i, const char *p_c)
function beginlicensing (line 152) | bool beginlicensing()
function endlicensing (line 159) | void endlicensing()
function poi_to_xprs_cons_sense (line 164) | static char poi_to_xprs_cons_sense(ConstraintSense sense)
function ConstraintSense (line 179) | static ConstraintSense xprs_to_poi_cons_sense(int ctype)
function poi_to_xprs_obj_sense (line 195) | static int poi_to_xprs_obj_sense(ObjectiveSense sense)
function poi_to_xprs_var_type (line 208) | static char poi_to_xprs_var_type(VariableDomain domain)
function VariableDomain (line 225) | static VariableDomain xprs_to_poi_var_type(char vtype)
function poi_to_xprs_sos_type (line 242) | static char poi_to_xprs_sos_type(SOSType type)
function default_print (line 306) | static void default_print(XPRSprob prob, void *, char const *msg, int ...
function XPRSprob (line 357) | XPRSprob Model::_toggle_model_mode(XPRSprob model)
function VariableIndex (line 480) | VariableIndex Model::add_variable(VariableDomain domain, double lb, do...
function ConstraintIndex (line 682) | ConstraintIndex Model::add_linear_constraint(const ScalarAffineFunctio...
function ConstraintIndex (line 754) | ConstraintIndex Model::add_linear_constraint(const ScalarAffineFunctio...
function poi_to_xprs_quad_formula (line 790) | static QuadraticFunctionPtrForm<int, int, double> poi_to_xprs_quad_for...
function ConstraintIndex (line 842) | ConstraintIndex Model::add_quadratic_constraint(const ScalarQuadraticF...
function ConstraintIndex (line 868) | ConstraintIndex Model::add_second_order_cone_constraint(const Vector<V...
type NlpArrays (line 898) | struct NlpArrays
function ConstraintIndex (line 905) | ConstraintIndex Model::add_exp_cone_constraint(const Vector<VariableIn...
function ConstraintIndex (line 974) | ConstraintIndex Model::_add_sos_constraint(const Vector<VariableIndex>...
function ConstraintIndex (line 992) | ConstraintIndex Model::add_sos_constraint(const Vector<VariableIndex> ...
function ConstraintIndex (line 1003) | ConstraintIndex Model::add_sos_constraint(const Vector<VariableIndex> ...
function Tvp (line 1027) | Tvp to_xprs_opcode(UnaryOperator opcode_enum)
function Tvp (line 1063) | Tvp to_xprs_opcode(BinaryOperator opcode_enum)
function Tvp (line 1084) | Tvp to_xprs_opcode(TernaryOperator opcode_enum)
function Tvp (line 1091) | Tvp to_xprs_opcode(NaryOperator opcode_enum)
function BinaryOperator (line 1106) | BinaryOperator nary_to_binary_op(NaryOperator opcode_enum)
function Tvp (line 1122) | Tvp Model::_decode_expr(const ExpressionGraph &graph, const Expression...
function ExpressionHandle (line 1150) | ExpressionHandle nary_to_binary(ExpressionGraph &graph, const Expressi...
function ConstraintIndex (line 1233) | ConstraintIndex Model::add_single_nl_constraint(ExpressionGraph &graph,
function VariableDomain (line 1642) | VariableDomain Model::get_variable_type(VariableIndex variable)
function ConstraintSense (line 1700) | ConstraintSense Model::get_constraint_sense(ConstraintIndex constraint)
function CoeffT (line 1715) | CoeffT Model::get_constraint_rhs(ConstraintIndex constraint)
type OverloadSet (line 1975) | struct OverloadSet : public Ts...
function XPRSint64 (line 2010) | XPRSint64 Model::get_raw_control_int(const char *control)
function XPRSint64 (line 2028) | XPRSint64 Model::get_raw_attribute_int(const char *attrib)
function XPRSint64 (line 2068) | XPRSint64 Model::get_raw_control_int_by_id(int control)
function XPRSint64 (line 2098) | XPRSint64 Model::get_raw_attribute_int_by_id(int attrib)
function LPSTATUS (line 2126) | LPSTATUS Model::get_lp_status()
function MIPSTATUS (line 2131) | MIPSTATUS Model::get_mip_status()
function NLPSTATUS (line 2136) | NLPSTATUS Model::get_nlp_status()
function SOLVESTATUS (line 2141) | SOLVESTATUS Model::get_solve_status()
function SOLSTATUS (line 2146) | SOLSTATUS Model::get_sol_status()
function IISSOLSTATUS (line 2151) | IISSOLSTATUS Model::get_iis_sol_status()
function OPTIMIZETYPE (line 2156) | OPTIMIZETYPE Model::get_optimize_type()
function xpress_cbs_data (line 2192) | xpress_cbs_data Model::cb_get_arguments()
type Model::CbWrap (line 2413) | struct Model::CbWrap
method RetT (line 2415) | static RetT cb(XPRSprob cb_prob, void *user_data, ArgsT... args) noe...
function as_flag (line 2465) | static constexpr unsigned long long as_flag(int ID)
function test_ctx (line 2471) | static constexpr bool test_ctx(CB_CONTEXT dest_ctx, unsigned long long...
FILE: lib/xpress_model_ext.cpp
function NB_MODULE (line 19) | NB_MODULE(xpress_model_ext, m)
FILE: lib/xpress_model_ext_constants.cpp
function bind_xpress_constants (line 8) | void bind_xpress_constants(nb::module_ &m)
FILE: scripts/generate_attribute_table.py
function attribute_support_table (line 9) | def attribute_support_table(f, attribute_enum):
function print_table (line 21) | def print_table(io: IO[str], results):
FILE: scripts/generate_solver_constants.py
function value_to_str (line 13) | def value_to_str(value):
function extract_gurobi_constants (line 19) | def extract_gurobi_constants():
function export_gurobi_constants (line 50) | def export_gurobi_constants(io: IO[str], gurobi_constants):
function extract_copt_constants (line 82) | def extract_copt_constants():
function export_copt_constants (line 122) | def export_copt_constants(io: IO[str], copt_constants):
FILE: src/pyoptinterface/_src/aml.py
function make_variable_ndarray (line 8) | def make_variable_ndarray(
function make_variable_tupledict (line 43) | def make_variable_tupledict(
function quicksum_ (line 111) | def quicksum_(expr: ExprBuilder, terms, f=None):
function quicksum (line 126) | def quicksum(terms, f=None):
FILE: src/pyoptinterface/_src/attributes.py
class VariableAttribute (line 5) | class VariableAttribute(Enum):
class ModelAttribute (line 30) | class ModelAttribute(Enum):
class ResultStatusCode (line 58) | class ResultStatusCode(Enum):
class TerminationStatusCode (line 71) | class TerminationStatusCode(Enum):
class ConstraintAttribute (line 122) | class ConstraintAttribute(Enum):
FILE: src/pyoptinterface/_src/codegen_c.py
function generate_csrc_prelude (line 38) | def generate_csrc_prelude(io: IO[str]):
function generate_csrc_from_graph (line 82) | def generate_csrc_from_graph(
FILE: src/pyoptinterface/_src/codegen_llvm.py
function create_azmul (line 13) | def create_azmul(module: ir.Module):
function create_sign (line 38) | def create_sign(module: ir.Module):
function create_direct_load_store (line 68) | def create_direct_load_store(module: ir.Module):
function create_indirect_load_store (line 130) | def create_indirect_load_store(module: ir.Module):
function create_llvmir_basic_functions (line 232) | def create_llvmir_basic_functions(module: ir.Module):
function generate_llvmir_from_graph (line 250) | def generate_llvmir_from_graph(
FILE: src/pyoptinterface/_src/comparison_constraint.py
class ComparisonConstraint (line 8) | class ComparisonConstraint:
FILE: src/pyoptinterface/_src/constraint_bridge.py
function bridge_soc_quadratic_constraint (line 4) | def bridge_soc_quadratic_constraint(model, cone_variables, name="", rota...
FILE: src/pyoptinterface/_src/copt.py
function detected_libraries (line 37) | def detected_libraries():
function autoload_library (line 65) | def autoload_library():
function init_default_env (line 80) | def init_default_env():
function set_variable_start (line 109) | def set_variable_start(model, v, val):
function get_objsense (line 141) | def get_objsense(model):
function get_objval (line 151) | def get_objval(model):
function get_primalstatus (line 160) | def get_primalstatus(model):
function get_dualstatus (line 172) | def get_dualstatus(model):
function get_terminationstatus (line 263) | def get_terminationstatus(model):
function get_rawstatusstring (line 275) | def get_rawstatusstring(model):
function get_silent (line 287) | def get_silent(model):
function set_silent (line 325) | def set_silent(model, value: bool):
class Model (line 378) | class Model(RawModel):
method __init__ (line 379) | def __init__(self, env=None):
method add_variables (line 394) | def add_variables(self, *args, **kwargs):
method supports_variable_attribute (line 398) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 405) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 412) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 418) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 431) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method number_of_constraints (line 444) | def number_of_constraints(self, type: ConstraintType):
method number_of_variables (line 450) | def number_of_variables(self):
method _is_mip (line 453) | def _is_mip(self):
method _has_nl (line 457) | def _has_nl(self):
method get_model_attribute (line 462) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 474) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 486) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 499) | def set_constraint_attribute(
method get_raw_parameter (line 514) | def get_raw_parameter(self, param_name: str):
method set_raw_parameter (line 525) | def set_raw_parameter(self, param_name: str, value):
method get_raw_attribute (line 536) | def get_raw_attribute(self, param_name: str):
method optimize (line 547) | def optimize(self):
method cb_get_info (line 565) | def cb_get_info(self, what):
method add_linear_constraint (line 577) | def add_linear_constraint(
method add_linear_constraint (line 586) | def add_linear_constraint(
method add_linear_constraint (line 594) | def add_linear_constraint(
method add_linear_constraint (line 600) | def add_linear_constraint(self, arg, *args, **kwargs):
method add_quadratic_constraint (line 609) | def add_quadratic_constraint(
method add_quadratic_constraint (line 618) | def add_quadratic_constraint(
method add_quadratic_constraint (line 624) | def add_quadratic_constraint(self, arg, *args, **kwargs):
method add_nl_constraint (line 633) | def add_nl_constraint(
method add_nl_constraint (line 643) | def add_nl_constraint(
method add_nl_constraint (line 652) | def add_nl_constraint(
method add_nl_constraint (line 659) | def add_nl_constraint(self, expr, *args, **kwargs):
method add_nl_objective (line 671) | def add_nl_objective(self, expr):
FILE: src/pyoptinterface/_src/cpp_graph_iter.py
class cpp_graph_iterator (line 7) | class cpp_graph_iterator:
method __init__ (line 8) | def __init__(self, graph):
method __iter__ (line 14) | def __iter__(self):
method __next__ (line 17) | def __next__(self):
FILE: src/pyoptinterface/_src/dylib.py
function dylib_suffix (line 4) | def dylib_suffix():
FILE: src/pyoptinterface/_src/gurobi.py
function detected_libraries (line 43) | def detected_libraries():
function autoload_library (line 109) | def autoload_library():
function init_default_env (line 124) | def init_default_env():
function get_terminationstatus (line 287) | def get_terminationstatus(model):
function get_primalstatus (line 293) | def get_primalstatus(model):
function get_dualstatus (line 311) | def get_dualstatus(model):
function get_rawstatusstring (line 339) | def get_rawstatusstring(model):
function get_silent (line 345) | def get_silent(model):
function set_silent (line 408) | def set_silent(model, value: bool):
function get_constraint_name (line 437) | def get_constraint_name(model, constraint):
function get_constraint_primal (line 449) | def get_constraint_primal(model, constraint):
function get_constraint_dual (line 465) | def get_constraint_dual(model, constraint):
function get_constraint_IIS (line 477) | def get_constraint_IIS(model, constraint):
class Env (line 549) | class Env(RawEnv):
method set_raw_parameter (line 550) | def set_raw_parameter(self, param_name: str, value):
class Model (line 561) | class Model(RawModel):
method __init__ (line 562) | def __init__(self, env=None):
method supports_variable_attribute (line 577) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 584) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 591) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 597) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 611) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method number_of_constraints (line 625) | def number_of_constraints(self, type: ConstraintType):
method number_of_variables (line 631) | def number_of_variables(self):
method get_model_attribute (line 634) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 647) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 660) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 673) | def set_constraint_attribute(
method get_raw_parameter (line 688) | def get_raw_parameter(self, param_name: str):
method set_raw_parameter (line 698) | def set_raw_parameter(self, param_name: str, value):
method get_model_raw_attribute (line 708) | def get_model_raw_attribute(self, name: str):
method set_model_raw_attribute (line 718) | def set_model_raw_attribute(self, name: str, value):
method get_variable_raw_attribute (line 728) | def get_variable_raw_attribute(self, variable, name: str):
method set_variable_raw_attribute (line 739) | def set_variable_raw_attribute(self, variable, name: str, value):
method get_constraint_raw_attribute (line 750) | def get_constraint_raw_attribute(self, constraint, name: str):
method set_constraint_raw_attribute (line 761) | def set_constraint_raw_attribute(self, constraint, name: str, value):
method cb_get_info (line 772) | def cb_get_info(self, what):
method add_linear_constraint (line 784) | def add_linear_constraint(
method add_linear_constraint (line 793) | def add_linear_constraint(
method add_linear_constraint (line 799) | def add_linear_constraint(self, arg, *args, **kwargs):
method add_quadratic_constraint (line 808) | def add_quadratic_constraint(
method add_quadratic_constraint (line 817) | def add_quadratic_constraint(
method add_quadratic_constraint (line 823) | def add_quadratic_constraint(self, arg, *args, **kwargs):
method add_nl_constraint (line 832) | def add_nl_constraint(
method add_nl_constraint (line 842) | def add_nl_constraint(
method add_nl_constraint (line 851) | def add_nl_constraint(
method add_nl_constraint (line 858) | def add_nl_constraint(self, expr, *args, **kwargs):
method add_nl_objective (line 870) | def add_nl_objective(self, expr):
FILE: src/pyoptinterface/_src/highs.py
function detected_libraries (line 38) | def detected_libraries():
function autoload_library (line 79) | def autoload_library():
function get_dualstatus (line 117) | def get_dualstatus(model):
function get_primalstatus (line 129) | def get_primalstatus(model):
function get_rawstatusstring (line 140) | def get_rawstatusstring(model):
function get_terminationstatus (line 182) | def get_terminationstatus(model):
class Model (line 295) | class Model(RawModel):
method __init__ (line 296) | def __init__(self):
method supports_variable_attribute (line 302) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 309) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 316) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 322) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 335) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method number_of_constraints (line 348) | def number_of_constraints(self, type: ConstraintType):
method number_of_variables (line 353) | def number_of_variables(self):
method get_model_attribute (line 356) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 368) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 380) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 393) | def set_constraint_attribute(
method get_raw_parameter (line 408) | def get_raw_parameter(self, param_name: str):
method set_raw_parameter (line 419) | def set_raw_parameter(self, param_name: str, value):
method get_raw_information (line 430) | def get_raw_information(self, param_name: str):
method optimize (line 440) | def optimize(self):
method add_linear_constraint (line 450) | def add_linear_constraint(
method add_linear_constraint (line 459) | def add_linear_constraint(
method add_linear_constraint (line 465) | def add_linear_constraint(self, arg, *args, **kwargs):
FILE: src/pyoptinterface/_src/ipopt.py
function detected_libraries (line 57) | def detected_libraries():
function autoload_library (line 71) | def autoload_library():
function get_dualstatus (line 101) | def get_dualstatus(model):
function get_primalstatus (line 113) | def get_primalstatus(model):
function get_rawstatusstring (line 127) | def get_rawstatusstring(model):
function get_terminationstatus (line 132) | def get_terminationstatus(model):
function get_constraint_primal (line 198) | def get_constraint_primal(model, constraint):
function get_constraint_dual (line 202) | def get_constraint_dual(model, constraint):
class Model (line 214) | class Model(RawModel):
method __init__ (line 215) | def __init__(self, jit: str = "LLVM"):
method supports_variable_attribute (line 248) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 255) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 262) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 268) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 281) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method get_model_attribute (line 294) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 306) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 318) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 331) | def set_constraint_attribute(
method set_raw_parameter (line 346) | def set_raw_parameter(self, param_name: str, value):
method add_linear_constraint (line 358) | def add_linear_constraint(
method add_linear_constraint (line 367) | def add_linear_constraint(
method add_linear_constraint (line 375) | def add_linear_constraint(
method add_linear_constraint (line 381) | def add_linear_constraint(self, arg, *args, **kwargs):
method add_quadratic_constraint (line 390) | def add_quadratic_constraint(
method add_quadratic_constraint (line 399) | def add_quadratic_constraint(
method add_quadratic_constraint (line 407) | def add_quadratic_constraint(
method add_quadratic_constraint (line 413) | def add_quadratic_constraint(self, arg, *args, **kwargs):
method add_nl_constraint (line 422) | def add_nl_constraint(
method add_nl_constraint (line 432) | def add_nl_constraint(
method add_nl_constraint (line 441) | def add_nl_constraint(
method add_nl_constraint (line 448) | def add_nl_constraint(self, expr, *args, **kwargs):
method add_nl_objective (line 501) | def add_nl_objective(self, expr):
method optimize (line 519) | def optimize(self):
method _find_similar_graphs (line 531) | def _find_similar_graphs(self):
method _compile_evaluators (line 561) | def _compile_evaluators(self):
method _codegen_c (line 645) | def _codegen_c(self):
method _codegen_llvm (line 786) | def _codegen_llvm(self):
FILE: src/pyoptinterface/_src/jit_c.py
class TCCJITCompiler (line 54) | class TCCJITCompiler:
method __init__ (line 55) | def __init__(self):
method create_instance (line 59) | def create_instance(self):
method compile_string (line 76) | def compile_string(self, inst, c_code: str):
FILE: src/pyoptinterface/_src/jit_llvm.py
class LLJITCompiler (line 16) | class LLJITCompiler:
method __init__ (line 17) | def __init__(self):
method compile_module (line 25) | def compile_module(self, module: ir.Module, export_functions: List[str...
FILE: src/pyoptinterface/_src/knitro.py
function detected_libraries (line 37) | def detected_libraries():
function autoload_library (line 89) | def autoload_library():
function _termination_status_knitro (line 168) | def _termination_status_knitro(model: "Model"):
function _result_status_knitro (line 179) | def _result_status_knitro(model: "Model"):
class Env (line 263) | class Env(RawEnv):
method is_empty (line 269) | def is_empty(self):
class Model (line 273) | class Model(RawModel):
method __init__ (line 278) | def __init__(self, env: Env = None) -> None:
method _reset_graph_map (line 285) | def _reset_graph_map(self) -> None:
method _add_graph_expr (line 288) | def _add_graph_expr(
method init (line 299) | def init(self, env: Env = None) -> None:
method close (line 306) | def close(self) -> None:
method supports_variable_attribute (line 311) | def supports_variable_attribute(
method supports_constraint_attribute (line 320) | def supports_constraint_attribute(
method supports_model_attribute (line 329) | def supports_model_attribute(
method add_linear_constraint (line 338) | def add_linear_constraint(
method add_linear_constraint (line 347) | def add_linear_constraint(
method add_linear_constraint (line 355) | def add_linear_constraint(
method add_linear_constraint (line 361) | def add_linear_constraint(self, arg, *args, **kwargs) -> ConstraintIndex:
method add_quadratic_constraint (line 370) | def add_quadratic_constraint(
method add_quadratic_constraint (line 379) | def add_quadratic_constraint(
method add_quadratic_constraint (line 385) | def add_quadratic_constraint(self, arg, *args, **kwargs) -> Constraint...
method add_nl_constraint (line 394) | def add_nl_constraint(
method add_nl_constraint (line 404) | def add_nl_constraint(
method add_nl_constraint (line 413) | def add_nl_constraint(
method add_nl_constraint (line 420) | def add_nl_constraint(self, expr, *args, **kwargs) -> ConstraintIndex:
method add_nl_objective (line 424) | def add_nl_objective(self, expr) -> None:
method get_model_attribute (line 428) | def get_model_attribute(self, attr: ModelAttribute):
method set_model_attribute (line 434) | def set_model_attribute(self, attr: ModelAttribute, value):
method get_variable_attribute (line 440) | def get_variable_attribute(self, variable: VariableIndex, attr: Variab...
method set_variable_attribute (line 453) | def set_variable_attribute(
method get_constraint_attribute (line 469) | def get_constraint_attribute(
method set_constraint_attribute (line 484) | def set_constraint_attribute(
method is_dirty (line 501) | def is_dirty(self) -> bool:
method is_empty (line 505) | def is_empty(self) -> bool:
method solve_status (line 509) | def solve_status(self) -> int:
FILE: src/pyoptinterface/_src/matrix.py
function iterate_sparse_matrix_rows (line 5) | def iterate_sparse_matrix_rows(A):
function add_matrix_constraints (line 25) | def add_matrix_constraints(model, A, x, sense, b):
FILE: src/pyoptinterface/_src/monkeypatch.py
function patch_core_compararison_operator (line 19) | def patch_core_compararison_operator(cls):
function patch_more_compararison_operator (line 50) | def patch_more_compararison_operator(cls):
function patch_quadratic_mul (line 78) | def patch_quadratic_mul(cls):
function patch_div (line 133) | def patch_div(cls):
function pow_int (line 182) | def pow_int(graph, expr, N):
function patch_expressionhandle (line 201) | def patch_expressionhandle(cls):
function patch_pow (line 308) | def patch_pow(cls):
function _monkeypatch_all (line 356) | def _monkeypatch_all():
FILE: src/pyoptinterface/_src/mosek.py
function detected_libraries (line 35) | def detected_libraries():
function autoload_library (line 106) | def autoload_library():
function init_default_env (line 121) | def init_default_env():
function get_primalstatus (line 152) | def get_primalstatus(model):
function get_dualstatus (line 180) | def get_dualstatus(model):
function get_rawstatusstring (line 239) | def get_rawstatusstring(model):
function get_terminationstatus (line 252) | def get_terminationstatus(model):
function set_silent (line 325) | def set_silent(model, value: bool):
function tell_enum_type (line 366) | def tell_enum_type(name: str):
class Model (line 377) | class Model(RawModel):
method __init__ (line 378) | def __init__(self, env=None):
method supports_variable_attribute (line 390) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 397) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 404) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 410) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 423) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method number_of_constraints (line 436) | def number_of_constraints(self, type: ConstraintType):
method number_of_variables (line 441) | def number_of_variables(self):
method get_model_attribute (line 444) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 456) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 468) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 481) | def set_constraint_attribute(
method get_raw_parameter (line 496) | def get_raw_parameter(self, param_name: str):
method set_raw_parameter (line 506) | def set_raw_parameter(self, param_name: str, value):
method get_raw_information (line 516) | def get_raw_information(self, param_name: str):
method optimize (line 525) | def optimize(self):
method add_linear_constraint (line 530) | def add_linear_constraint(
method add_linear_constraint (line 539) | def add_linear_constraint(
method add_linear_constraint (line 545) | def add_linear_constraint(self, arg, *args, **kwargs):
method add_quadratic_constraint (line 554) | def add_quadratic_constraint(
method add_quadratic_constraint (line 563) | def add_quadratic_constraint(
method add_quadratic_constraint (line 569) | def add_quadratic_constraint(self, arg, *args, **kwargs):
FILE: src/pyoptinterface/_src/nlfunc.py
class ExpressionGraphContext (line 21) | class ExpressionGraphContext:
method __enter__ (line 24) | def __enter__(self):
method __exit__ (line 33) | def __exit__(self, exc_type, exc_val, exc_tb):
method current_graph_no_exception (line 37) | def current_graph_no_exception(cls):
method current_graph (line 47) | def current_graph(cls):
function convert_to_expressionhandle (line 64) | def convert_to_expressionhandle(graph, expr):
function to_nlexpr (line 90) | def to_nlexpr(expr):
function unary_mathematical_function (line 109) | def unary_mathematical_function(math_function, op: UnaryOperator):
function binary_mathematical_function (line 139) | def binary_mathematical_function(math_function, op: BinaryOperator):
function ifelse (line 164) | def ifelse(condition, true_expr, false_expr):
FILE: src/pyoptinterface/_src/solver_common.py
function _get_model_attribute (line 4) | def _get_model_attribute(
function _direct_get_model_attribute (line 17) | def _direct_get_model_attribute(model, attribute, get_func_map, error_ca...
function _set_model_attribute (line 25) | def _set_model_attribute(
function _direct_set_model_attribute (line 42) | def _direct_set_model_attribute(
function _get_entity_attribute (line 55) | def _get_entity_attribute(
function _direct_get_entity_attribute (line 68) | def _direct_get_entity_attribute(
function _set_entity_attribute (line 78) | def _set_entity_attribute(
function _direct_set_entity_attribute (line 96) | def _direct_set_entity_attribute(
FILE: src/pyoptinterface/_src/tupledict.py
class tupledict (line 7) | class tupledict(dict):
method __init__ (line 8) | def __init__(self, *args, **kwargs):
method __setitem__ (line 13) | def __setitem__(self, key, value):
method __delitem__ (line 17) | def __delitem__(self, key):
method __check_key_length (line 21) | def __check_key_length(self):
method select (line 39) | def select(self, *keys, with_key=False):
method clean (line 103) | def clean(self):
method map (line 106) | def map(self, func):
function flatten_tuple (line 110) | def flatten_tuple(t):
function make_tupledict (line 120) | def make_tupledict(*coords: Iterable, rule):
FILE: src/pyoptinterface/_src/xpress.py
function detected_libraries (line 41) | def detected_libraries():
function autoload_library (line 69) | def autoload_library():
function get_terminationstatus (line 195) | def get_terminationstatus(model):
function get_primalstatus (line 213) | def get_primalstatus(model):
function get_dualstatus (line 239) | def get_dualstatus(model):
function get_rawstatusstring (line 250) | def get_rawstatusstring(model):
function init_default_env (line 393) | def init_default_env():
class Model (line 399) | class Model(RawModel):
method __init__ (line 400) | def __init__(self, env=None):
method optimize (line 412) | def optimize(self):
method supports_variable_attribute (line 423) | def supports_variable_attribute(attribute: VariableAttribute, settable...
method supports_model_attribute (line 430) | def supports_model_attribute(attribute: ModelAttribute, settable=False):
method supports_constraint_attribute (line 437) | def supports_constraint_attribute(attribute: ConstraintAttribute, sett...
method get_variable_attribute (line 443) | def get_variable_attribute(self, variable, attribute: VariableAttribute):
method set_variable_attribute (line 456) | def set_variable_attribute(self, variable, attribute: VariableAttribut...
method number_of_constraints (line 469) | def number_of_constraints(self, type: ConstraintType):
method number_of_variables (line 476) | def number_of_variables(self):
method get_model_attribute (line 479) | def get_model_attribute(self, attribute: ModelAttribute):
method set_model_attribute (line 492) | def set_model_attribute(self, attribute: ModelAttribute, value):
method get_constraint_attribute (line 505) | def get_constraint_attribute(self, constraint, attribute: ConstraintAt...
method set_constraint_attribute (line 518) | def set_constraint_attribute(
method add_linear_constraint (line 534) | def add_linear_constraint(
method add_linear_constraint (line 543) | def add_linear_constraint(
method add_linear_constraint (line 551) | def add_linear_constraint(
method add_linear_constraint (line 557) | def add_linear_constraint(self, arg, *args, **kwargs):
method add_quadratic_constraint (line 566) | def add_quadratic_constraint(
method add_quadratic_constraint (line 575) | def add_quadratic_constraint(
method add_quadratic_constraint (line 581) | def add_quadratic_constraint(self, arg, *args, **kwargs):
method add_nl_constraint (line 590) | def add_nl_constraint(
method add_nl_constraint (line 600) | def add_nl_constraint(
method add_nl_constraint (line 609) | def add_nl_constraint(
method add_nl_constraint (line 616) | def add_nl_constraint(self, expr, *args, **kwargs):
method add_nl_objective (line 625) | def add_nl_objective(self, expr):
method set_callback (line 632) | def set_callback(self, cb, where):
FILE: tests/conftest.py
function llvm (line 10) | def llvm():
function c (line 13) | def c():
function nlp_model_ctor (line 31) | def nlp_model_ctor(request):
function model_interface (line 54) | def model_interface(request):
function model_interface_oneshot (line 66) | def model_interface_oneshot(request):
FILE: tests/simple_cb.py
function simple_cb (line 8) | def simple_cb(f):
FILE: tests/test_basic.py
function test_basic (line 8) | def test_basic():
function test_affineexpr_from_numpy (line 72) | def test_affineexpr_from_numpy():
function test_monotoneindexer (line 92) | def test_monotoneindexer():
FILE: tests/test_close.py
function test_close (line 19) | def test_close():
FILE: tests/test_compare_constraint.py
function test_compare_constraint (line 6) | def test_compare_constraint(model_interface):
FILE: tests/test_exp_cone.py
function test_exp_cone (line 7) | def test_exp_cone(model_interface):
FILE: tests/test_iis.py
function test_constraint_iis (line 5) | def test_constraint_iis(model_interface):
function test_variable_iis (line 28) | def test_variable_iis(model_interface):
FILE: tests/test_in_constraint.py
function test_linear_in_constraint (line 7) | def test_linear_in_constraint(model_interface_oneshot):
function test_nl_in_constraint (line 31) | def test_nl_in_constraint(nlp_model_ctor):
FILE: tests/test_ipopt.py
function _build_simple_model (line 12) | def _build_simple_model():
class TestUnoptimizedModelRaises (line 21) | class TestUnoptimizedModelRaises:
method test_get_variable_value_before_optimize (line 24) | def test_get_variable_value_before_optimize(self):
method test_get_objective_value_before_optimize (line 29) | def test_get_objective_value_before_optimize(self):
method test_get_constraint_primal_before_optimize (line 34) | def test_get_constraint_primal_before_optimize(self):
method test_get_constraint_dual_before_optimize (line 39) | def test_get_constraint_dual_before_optimize(self):
class TestDirtyAfterModificationRaises (line 45) | class TestDirtyAfterModificationRaises:
method test_dirty_after_add_variable (line 49) | def test_dirty_after_add_variable(self):
method test_dirty_after_add_linear_constraint (line 68) | def test_dirty_after_add_linear_constraint(self):
method test_dirty_after_add_quadratic_constraint (line 81) | def test_dirty_after_add_quadratic_constraint(self):
method test_dirty_after_add_nl_constraint (line 94) | def test_dirty_after_add_nl_constraint(self):
method test_reoptimize_clears_dirty (line 108) | def test_reoptimize_clears_dirty(self):
FILE: tests/test_knitro.py
function test_new_model_without_env (line 13) | def test_new_model_without_env():
function test_new_model_with_env (line 33) | def test_new_model_with_env():
function test_multiple_models_single_env (line 54) | def test_multiple_models_single_env():
function test_multiple_models_multiple_envs (line 75) | def test_multiple_models_multiple_envs():
function test_env_lifetime (line 97) | def test_env_lifetime():
function test_env_close (line 117) | def test_env_close():
function test_init_with_env (line 135) | def test_init_with_env():
function test_model_with_empty_env (line 152) | def test_model_with_empty_env():
function test_model_init_with_empty_env_after_start (line 161) | def test_model_init_with_empty_env_after_start():
function test_model_dirty (line 170) | def test_model_dirty():
function test_model_is_dirty (line 189) | def test_model_is_dirty():
function test_model_empty (line 208) | def test_model_empty():
function test_model_is_empty_property (line 216) | def test_model_is_empty_property():
function test_number_of_variables (line 224) | def test_number_of_variables():
function test_number_of_constraints (line 238) | def test_number_of_constraints():
function test_supports_attribute_methods (line 257) | def test_supports_attribute_methods():
function test_model_attribute_solver_info (line 319) | def test_model_attribute_solver_info():
function test_model_attribute_after_solve (line 331) | def test_model_attribute_after_solve():
function test_set_model_attribute_objective_sense (line 366) | def test_set_model_attribute_objective_sense():
function test_set_model_attribute_silent (line 388) | def test_set_model_attribute_silent():
function test_set_model_attribute_threads (line 401) | def test_set_model_attribute_threads():
function test_set_model_attribute_time_limit (line 410) | def test_set_model_attribute_time_limit():
function test_variable_attribute_bounds (line 417) | def test_variable_attribute_bounds():
function test_variable_attribute_name (line 436) | def test_variable_attribute_name():
function test_variable_attribute_value (line 449) | def test_variable_attribute_value():
function test_variable_attribute_primal_start (line 462) | def test_variable_attribute_primal_start():
function test_variable_attribute_domain (line 476) | def test_variable_attribute_domain():
function test_constraint_attribute_name (line 504) | def test_constraint_attribute_name():
function test_constraint_attribute_primal_dual (line 521) | def test_constraint_attribute_primal_dual():
FILE: tests/test_lukvle10.py
function test_nlp_lukvle10 (line 7) | def test_nlp_lukvle10(nlp_model_ctor):
FILE: tests/test_matrix_api.py
function test_matrix_api (line 7) | def test_matrix_api(model_interface_oneshot):
function test_quicksum_ndarray (line 32) | def test_quicksum_ndarray(model_interface_oneshot):
FILE: tests/test_nlp.py
function test_easy_nlp (line 8) | def test_easy_nlp(nlp_model_ctor):
function test_nlfunc_ifelse (line 82) | def test_nlfunc_ifelse(nlp_model_ctor):
function test_ipopt_optimizer_not_called (line 105) | def test_ipopt_optimizer_not_called():
function c (line 154) | def c():
function llvm (line 160) | def llvm():
FILE: tests/test_nlp_bilinear.py
function test_bilinear (line 6) | def test_bilinear(nlp_model_ctor):
FILE: tests/test_nlp_clnlbeam.py
function test_clnlbeam (line 9) | def test_clnlbeam(nlp_model_ctor):
FILE: tests/test_nlp_expression.py
function test_nlp_expressiontree (line 8) | def test_nlp_expressiontree(model_interface):
function test_nlp_expressiontree_obj (line 38) | def test_nlp_expressiontree_obj(model_interface):
FILE: tests/test_nlp_hs071.py
function test_hs071 (line 6) | def test_hs071(nlp_model_ctor):
FILE: tests/test_nlp_multiple_run.py
function test_nlp_reopt (line 6) | def test_nlp_reopt(nlp_model_ctor):
function c (line 44) | def c():
function llvm (line 49) | def llvm():
FILE: tests/test_nlp_opf.py
function test_acopf (line 8) | def test_acopf(nlp_model_ctor):
FILE: tests/test_nlp_rocket.py
function rocket_model (line 7) | def rocket_model(model, nh: int):
function test_rocket (line 62) | def test_rocket(nlp_model_ctor):
function c (line 76) | def c():
function llvm (line 81) | def llvm():
FILE: tests/test_operator.py
function evaluate (line 14) | def evaluate(expr, var_value_map=None):
function degree (line 50) | def degree(expr):
function test_evaluate (line 65) | def test_evaluate():
function test_operator (line 90) | def test_operator():
function test_quicksum (line 144) | def test_quicksum():
FILE: tests/test_preopt.py
function test_model_attribute_termination_before_solve (line 4) | def test_model_attribute_termination_before_solve(model_interface_oneshot):
FILE: tests/test_qp.py
function test_simple_qp (line 7) | def test_simple_qp(model_interface_oneshot):
function test_shuffle_qp_objective (line 32) | def test_shuffle_qp_objective(model_interface_oneshot):
function test_duplicated_quadratic_terms (line 74) | def test_duplicated_quadratic_terms(model_interface_oneshot):
FILE: tests/test_reducedcost.py
function test_simple_redcost (line 6) | def test_simple_redcost(model_interface):
FILE: tests/test_simple_opt.py
function test_simple_opt (line 6) | def test_simple_opt(model_interface):
function test_constant_objective (line 97) | def test_constant_objective(model_interface_oneshot):
function test_constraint_primal_dual (line 117) | def test_constraint_primal_dual(model_interface_oneshot):
function test_add_quadratic_expr_as_linear_throws_error (line 146) | def test_add_quadratic_expr_as_linear_throws_error(model_interface_onesh...
function test_exprbuilder_self_operation (line 156) | def test_exprbuilder_self_operation(model_interface_oneshot):
FILE: tests/test_soc.py
function test_soc (line 6) | def test_soc(model_interface):
function test_rotated_soc (line 50) | def test_rotated_soc(model_interface):
FILE: tests/test_sos.py
function test_sos (line 7) | def test_sos(model_interface):
FILE: tests/test_tupledict.py
function test_flatten_tuple (line 9) | def test_flatten_tuple():
function test_make_tupledict (line 15) | def test_make_tupledict():
function test_tupledict_select (line 32) | def test_tupledict_select():
function test_tupledict_map (line 61) | def test_tupledict_map():
FILE: tests/test_update.py
function test_update (line 5) | def test_update(model_interface):
FILE: tests/tsp_cb.py
function shortest_subtour (line 48) | def shortest_subtour(edges: List[Tuple[int, int]]) -> List[int]:
class GurobiTSPCallback (line 75) | class GurobiTSPCallback:
method __init__ (line 76) | def __init__(self, nodes, x):
method __call__ (line 80) | def __call__(self, model, where):
method eliminate_subtours_gurobipy (line 84) | def eliminate_subtours_gurobipy(self, model):
function solve_tsp_gurobipy (line 95) | def solve_tsp_gurobipy(nodes, distances):
class COPTTSPCallback (line 129) | class COPTTSPCallback(cp.CallbackBase):
method __init__ (line 130) | def __init__(self, nodes, x):
method callback (line 135) | def callback(self):
method eliminate_subtours_coptpy (line 139) | def eliminate_subtours_coptpy(self):
function solve_tsp_coptpy (line 150) | def solve_tsp_coptpy(nodes, distances):
class XpressTSPCallback (line 178) | class XpressTSPCallback:
method __init__ (line 179) | def __init__(self, nodes, x):
method __call__ (line 183) | def __call__(self, prob, data, soltype, cutoff):
function solve_tsp_xpress (line 221) | def solve_tsp_xpress(nodes, distances):
class POITSPCallback (line 245) | class POITSPCallback:
method __init__ (line 246) | def __init__(self, nodes, x):
method run_gurobi (line 250) | def run_gurobi(self, model, where):
method run_copt (line 254) | def run_copt(self, model, where):
method run_xpress (line 258) | def run_xpress(self, model, where):
method eliminate_subtours_poi (line 262) | def eliminate_subtours_poi(self, model):
function solve_tsp_poi (line 278) | def solve_tsp_poi(f, nodes, distances):
function create_map (line 312) | def create_map(npoints, seed):
function test_gurobi (line 327) | def test_gurobi(npoints_series, seed):
function test_copt (line 348) | def test_copt(npoints_series, seed):
function test_xpress (line 369) | def test_xpress(npoints_series, seed):
FILE: tests/tsp_xpress.py
function cb_preintsol (line 21) | def cb_preintsol(prob, data, soltype, cutoff):
function print_sol (line 108) | def print_sol(p, n):
function create_initial_tour (line 123) | def create_initial_tour(n):
function solve_xpress (line 132) | def solve_xpress(nodes, distances):
function shortest_subtour (line 185) | def shortest_subtour(edges: List[Tuple[int, int]]) -> List[int]:
function solve_poi (line 209) | def solve_poi(f, nodes, distances):
function create_map (line 398) | def create_map(npoints, seed):
function test_xpress (line 413) | def test_xpress(npoints_series, seed):
FILE: thirdparty/ankerl/unordered_dense.h
function namespace (line 116) | namespace ankerl::unordered_dense {
function std (line 266) | [[nodiscard]] inline auto hash(std::uint64_t x) -> std::uint64_t {
function std (line 274) | const noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::dec...
function std (line 283) | const noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::dec...
function noexcept (line 292) | const noexcept -> std::uint64_t {
function noexcept (line 300) | const noexcept -> std::uint64_t {
function noexcept (line 308) | const noexcept -> std::uint64_t {
function noexcept (line 317) | const noexcept -> std::uint64_t {
function noexcept (line 326) | const noexcept -> std::uint64_t {
function noexcept (line 335) | const noexcept -> std::uint64_t {
function std (line 346) | [[nodiscard]] constexpr static auto to64(Arg const& arg) -> std::uint64_t {
function noexcept (line 374) | const noexcept -> std::uint64_t {
function noexcept (line 382) | const noexcept -> std::uint64_t {
function namespace (line 427) | namespace bucket_type {
function namespace (line 447) | namespace detail {
function ptr_t (line 556) | ptr_t m_data{}
function operator (line 588) | constexpr auto operator++() noexcept -> iter_t& {
function operator (line 599) | constexpr auto operator--() noexcept -> iter_t& {
function operator (line 610) | [[nodiscard]] constexpr auto operator+(difference_type diff) const noexc...
function operator (line 614) | constexpr auto operator+=(difference_type diff) noexcept -> iter_t& {
function operator (line 619) | [[nodiscard]] constexpr auto operator-(difference_type diff) const noexc...
function operator (line 623) | constexpr auto operator-=(difference_type diff) noexcept -> iter_t& {
function noexcept (line 629) | const noexcept -> difference_type {
function operator (line 633) | constexpr auto operator*() const noexcept -> reference {
function operator (line 637) | constexpr auto operator->() const noexcept -> pointer {
function increase_capacity (line 673) | void increase_capacity() {
function append_everything_from (line 680) | void append_everything_from(segmented_vector&& other) { // NOLINT(cppcor...
function operator (line 776) | [[nodiscard]] constexpr auto operator[](std::size_t i) const noexcept ->...
function operator (line 780) | [[nodiscard]] constexpr auto operator[](std::size_t i) noexcept -> T& {
function pop_back (line 804) | [[nodiscard]] constexpr auto back() -> reference {
function reserve (line 820) | void reserve(std::size_t new_capacity) {
function resize (line 827) | void resize(std::size_t const count) {
function resize (line 839) | void resize(std::size_t const count, value_type const& value) {
function clear (line 866) | void clear() {
function shrink_to_fit (line 875) | void shrink_to_fit() {
function namespace (line 886) | namespace detail {
function std (line 1045) | [[nodiscard]] static constexpr auto calc_num_buckets(std::uint8_t shifts...
function copy_buckets (line 1058) | void copy_buckets(table const& other) {
function deallocate_buckets (line 1084) | void deallocate_buckets() {
function allocate_buckets_from_shift (line 1090) | void allocate_buckets_from_shift() {
function clear_buckets (line 1110) | void clear_buckets() {
function clear_and_fill_buckets_from_values (line 1120) | void clear_and_fill_buckets_from_values() {
function increase_size (line 1132) | void increase_size() {
function iterator (line 1244) | do_find(K const& key) -> iterator {
function const_iterator (line 1285) | do_find(K const& key) const -> const_iterator {
function Q (line 1290) | do_at(K const& key) -> Q& {
function Q (line 1299) | do_at(K const& key) const -> Q const& {
function table (line 1351) | table(table const& other)
function clear (line 1482) | [[nodiscard]] static constexpr auto max_size() noexcept -> std::size_t {
function iterator (line 1510) | auto insert(const_iterator /*hint*/, value_type const& value) -> iterator {
function iterator (line 1514) | auto insert(const_iterator /*hint*/, value_type&& value) -> iterator {
function insert (line 1531) | void insert(std::initializer_list<value_type> ilist) {
function value_idx (line 1559) | auto value_idx = value_idx_type{}
function iterator (line 1796) | auto erase(iterator it) -> iterator {
function value_type (line 1810) | auto extract(iterator it) -> value_type {
function std (line 1860) | auto erase(Key const& key) -> std::size_t {
function tmp (line 1881) | auto tmp = std::optional<value_type>{}
function swap (line 1888) | void swap(table& other) noexcept(noexcept(std::is_nothrow_swappable_v<va...
function Q (line 1897) | at(key_type const& key) -> Q& {
function Q (line 1906) | at(K const& key) -> Q& {
function Q (line 1911) | at(key_type const& key) const -> Q const& {
function Q (line 1920) | at(K const& key) const -> Q const& {
function std (line 1943) | auto count(Key const& key) const -> std::size_t {
function std (line 1948) | count(K const& key) const -> std::size_t {
function iterator (line 1952) | auto find(Key const& key) -> iterator {
function const_iterator (line 1956) | auto find(Key const& key) const -> const_iterator {
function iterator (line 1961) | find(K const& key) -> iterator {
function const_iterator (line 1966) | find(K const& key) const -> const_iterator {
function max_load_factor (line 2021) | void max_load_factor(float ml) {
function rehash (line 2028) | void rehash(std::size_t count) {
function reserve (line 2040) | void reserve(std::size_t capa) {
FILE: thirdparty/cppad/include/cppad/core/abort_recording.hpp
type CppAD (line 42) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/abs.hpp
type CppAD (line 72) | namespace CppAD {
function abs (line 117) | AD<Base> abs(const AD<Base> &x)
function abs (line 121) | AD<Base> abs(const VecAD_reference<Base> &x)
FILE: thirdparty/cppad/include/cppad/core/abs_normal_fun.hpp
type CppAD (line 320) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/ad.hpp
type CppAD (line 20) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class AD (line 30) | class AD {
type CompareOp (line 118) | enum CompareOp
method make_variable (line 275) | void make_variable(tape_id_t id, addr_t taddr)
method make_dynamic (line 285) | void make_dynamic(tape_id_t id, addr_t taddr)
FILE: thirdparty/cppad/include/cppad/core/ad_assign.hpp
type CppAD (line 56) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/ad_ctor.hpp
type CppAD (line 72) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/ad_fun.hpp
type CppAD (line 38) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class ADFun (line 54) | class ADFun {
method ADFun (line 281) | ADFun(const ADFun& g) = delete;
method exceed_collision_limit (line 570) | bool exceed_collision_limit(void) const
method size_forward_bool (line 574) | size_t size_forward_bool(void) const
method size_forward_bool (line 578) | void size_forward_bool(size_t zero)
method size_forward_set (line 587) | size_t size_forward_set(void) const
method size_forward_set (line 591) | void size_forward_set(size_t zero)
method size_op (line 600) | size_t size_op(void) const
method size_op_arg (line 604) | size_t size_op_arg(void) const
method size_op_seq (line 608) | size_t size_op_seq(void) const
method size_random (line 613) | size_t size_random(void) const
method size_par (line 617) | size_t size_par(void) const
method size_dyn_ind (line 621) | size_t size_dyn_ind(void) const
method size_dyn_par (line 625) | size_t size_dyn_par(void) const
method size_dyn_arg (line 629) | size_t size_dyn_arg(void) const
method size_order (line 633) | size_t size_order(void) const
method size_direction (line 637) | size_t size_direction(void) const
method size_text (line 641) | size_t size_text(void) const
method size_var (line 645) | size_t size_var(void) const
method size_VecAD (line 649) | size_t size_VecAD(void) const
method Domain (line 662) | size_t Domain(void) const
method Range (line 666) | size_t Range(void) const
method function_name_set (line 670) | void function_name_set(const std::string& function_name)
method function_name_get (line 672) | std::string function_name_get(void)
method Parameter (line 676) | bool Parameter(size_t i)
method CompareChange (line 686) | size_t CompareChange(void) const
method compare_change_count (line 690) | void compare_change_count(size_t count)
method compare_change_number (line 697) | size_t compare_change_number(void) const
method compare_change_op_index (line 701) | size_t compare_change_op_index(void) const
method Size (line 811) | size_t Size(void) const
method Order (line 816) | size_t Order(void) const
method Memory (line 821) | size_t Memory(void) const
method taylor_size (line 834) | size_t taylor_size(void) const
method use_VecAD (line 839) | bool use_VecAD(void) const
method size_taylor (line 844) | size_t size_taylor(void) const
FILE: thirdparty/cppad/include/cppad/core/ad_io.hpp
type CppAD (line 153) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 174) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 196) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 214) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/ad_to_string.hpp
type CppAD (line 52) | namespace CppAD {
type to_string_struct< CppAD::AD<Base> > (line 57) | struct to_string_struct< CppAD::AD<Base> >
FILE: thirdparty/cppad/include/cppad/core/ad_type.hpp
type CppAD (line 34) | namespace CppAD {
type local (line 46) | namespace local {
FILE: thirdparty/cppad/include/cppad/core/add.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/add_eq.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/atan2.hpp
type CppAD (line 72) | namespace CppAD { // BEGIN CppAD namespace
function atan2 (line 74) | inline float atan2(float x, float y)
function atan2 (line 77) | inline double atan2(double x, double y)
function atan2 (line 83) | AD<Base> atan2 (const AD<Base> &y, const AD<Base> &x)
function atan2 (line 128) | AD<Base> atan2 (const VecAD_reference<Base> &y, const AD<Base> &x)
function atan2 (line 132) | AD<Base> atan2 (const AD<Base> &y, const VecAD_reference<Base> &x)
function atan2 (line 136) | AD<Base> atan2
FILE: thirdparty/cppad/include/cppad/core/atomic/four/atomic.hpp
type CppAD (line 139) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class atomic_four (line 146) | class atomic_four {
type work_struct (line 160) | struct work_struct {
method atomic_index (line 182) | size_t atomic_index(void) const
method atomic_name (line 340) | const std::string atomic_name(void) const
method allocate_work (line 365) | void allocate_work(size_t thread)
method free_work (line 379) | void free_work(size_t thread)
method atomic_four (line 393) | static atomic_four* class_object(size_t index)
method class_name (line 403) | static const std::string class_name(size_t index)
method set_old (line 419) | virtual void set_old(size_t id)
FILE: thirdparty/cppad/include/cppad/core/atomic/four/call.hpp
type CppAD (line 99) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/ctor.hpp
type CppAD (line 100) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/devel/hes_sparsity.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/devel/jac_sparsity.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/for_type.hpp
type CppAD (line 123) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/forward.hpp
type CppAD (line 266) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/hes_sparsity.hpp
type CppAD (line 133) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/jac_sparsity.hpp
type CppAD (line 150) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/rev_depend.hpp
type CppAD (line 120) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/four/reverse.hpp
type CppAD (line 319) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/one/atomic.hpp
type CppAD (line 770) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class user_atomic (line 846) | class user_atomic : public atomic_base<Base> {
class atomic_one (line 856) | class atomic_one : public atomic_base<Base> {
method clear (line 859) | static void clear(void)
method atomic_one (line 960) | atomic_one(const char* afun, F f, R r, FJS fjs, RJS rjs, RHS rhs) :
method set_old (line 999) | virtual void set_old(size_t id)
method forward (line 1006) | virtual bool forward(
method reverse (line 1047) | virtual bool reverse(
method for_sparse_jac (line 1065) | virtual bool for_sparse_jac(
method rev_sparse_jac (line 1081) | virtual bool rev_sparse_jac(
method rev_sparse_hes (line 1096) | virtual bool rev_sparse_hes(
FILE: thirdparty/cppad/include/cppad/core/atomic/three/afun.hpp
type CppAD (line 78) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/atomic.hpp
type CppAD (line 213) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class atomic_three (line 220) | class atomic_three {
type work_struct (line 234) | struct work_struct {
method atomic_index (line 254) | size_t atomic_index(void) const
method atomic_name (line 391) | const std::string atomic_name(void) const
method allocate_work (line 416) | void allocate_work(size_t thread)
method free_work (line 430) | void free_work(size_t thread)
method atomic_three (line 444) | static atomic_three* class_object(size_t index)
method class_name (line 454) | static const std::string class_name(size_t index)
method set_old (line 470) | virtual void set_old(size_t id)
FILE: thirdparty/cppad/include/cppad/core/atomic/three/ctor.hpp
type CppAD (line 104) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/for_type.hpp
type CppAD (line 84) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/forward.hpp
type CppAD (line 296) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/hes_sparsity.hpp
type CppAD (line 106) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/jac_sparsity.hpp
type CppAD (line 120) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/rev_depend.hpp
type CppAD (line 97) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/three/reverse.hpp
type CppAD (line 305) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/afun.hpp
type CppAD (line 65) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/atomic.hpp
type CppAD (line 152) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class atomic_base (line 159) | class atomic_base {
type option_enum (line 162) | enum option_enum {
method atomic_index (line 169) | size_t atomic_index(void) const
type work_struct (line 188) | struct work_struct {
type option_enum (line 233) | enum option_enum
method option_enum (line 519) | option_enum sparsity(void) const
method atomic_name (line 523) | const std::string atomic_name(void) const
method allocate_work (line 548) | void allocate_work(size_t thread)
method free_work (line 562) | void free_work(size_t thread)
method atomic_base (line 576) | static atomic_base* class_object(size_t index)
method class_name (line 586) | static const std::string class_name(size_t index)
method set_old (line 602) | virtual void set_old(size_t id)
FILE: thirdparty/cppad/include/cppad/core/atomic/two/clear.hpp
type CppAD (line 46) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/ctor.hpp
type CppAD (line 104) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/for_sparse_hes.hpp
type CppAD (line 116) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/for_sparse_jac.hpp
type CppAD (line 109) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/forward.hpp
type CppAD (line 253) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/option.hpp
type CppAD (line 76) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
type option_enum (line 89) | enum option_enum
FILE: thirdparty/cppad/include/cppad/core/atomic/two/rev_depend.hpp
type CppAD (line 7) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/rev_sparse_hes.hpp
type CppAD (line 196) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/rev_sparse_jac.hpp
type CppAD (line 116) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/atomic/two/reverse.hpp
type CppAD (line 269) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/azmul.hpp
type CppAD (line 84) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function azmul (line 88) | AD<Base>
function azmul (line 227) | AD<Base>
function azmul (line 231) | AD<Base>
function azmul (line 235) | AD<Base>
function azmul (line 241) | AD<Base>
function azmul (line 245) | AD<Base>
function azmul (line 249) | AD<Base>
function azmul (line 253) | AD<Base>
FILE: thirdparty/cppad/include/cppad/core/base2ad.hpp
type CppAD (line 67) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/base_complex.hpp
type CppAD (line 63) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 92) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 108) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 124) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 153) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 173) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 184) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 203) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 218) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 247) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 271) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 286) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 298) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
type CppAD (line 326) | namespace CppAD {
function EqualOpSeq (line 109) | inline bool EqualOpSeq(
function IdenticalCon (line 125) | inline bool IdenticalCon(const std::complex<double> &x)
function IdenticalZero (line 127) | inline bool IdenticalZero(const std::complex<double> &x)
function IdenticalOne (line 129) | inline bool IdenticalOne(const std::complex<double> &x)
function IdenticalEqualCon (line 131) | inline bool IdenticalEqualCon(
function abs_geq (line 158) | inline bool abs_geq(
function Integer (line 174) | inline int Integer(const std::complex<double> &x)
function isnan (line 204) | inline bool isnan(const std::complex<double>& z)
function pow (line 272) | inline std::complex<double> pow(
function CondExpOp (line 328) | inline std::complex<float> CondExpOp(
function EqualOpSeq (line 344) | inline bool EqualOpSeq(
function IdenticalCon (line 350) | inline bool IdenticalCon(const std::complex<float> &x)
function IdenticalZero (line 352) | inline bool IdenticalZero(const std::complex<float> &x)
function IdenticalOne (line 354) | inline bool IdenticalOne(const std::complex<float> &x)
function IdenticalEqualCon (line 356) | inline bool IdenticalEqualCon(
function abs_geq (line 364) | inline bool abs_geq(
function Integer (line 369) | inline int Integer(const std::complex<float> &x)
function isnan (line 372) | inline bool isnan(const std::complex<float>& z)
function pow (line 390) | inline std::complex<float> pow(
FILE: thirdparty/cppad/include/cppad/core/base_cond_exp.hpp
type CppAD (line 144) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function ResultType (line 225) | ResultType CondExpTemplate(
FILE: thirdparty/cppad/include/cppad/core/base_double.hpp
type CppAD (line 28) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 46) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 61) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 73) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 90) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 101) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 112) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 137) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 166) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 179) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 200) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
type CppAD (line 212) | namespace CppAD {
function CondExpOp (line 29) | inline double CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const double& x, const double& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const double& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const double& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const double& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const double& x, const double& y)
function Integer (line 91) | inline int Integer(const double& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const double& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const double& x)
function LessThanZero (line 117) | inline bool LessThanZero(const double& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const double& x)
function abs_geq (line 121) | inline bool abs_geq(const double& x, const double& y)
function abs (line 167) | inline double abs(const double& x)
function sign (line 180) | inline double sign(const double& x)
FILE: thirdparty/cppad/include/cppad/core/base_float.hpp
type CppAD (line 28) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 46) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 61) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 73) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 90) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 101) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 112) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 137) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 167) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 180) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 200) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
type CppAD (line 212) | namespace CppAD {
function CondExpOp (line 29) | inline float CondExpOp(
function EqualOpSeq (line 62) | inline bool EqualOpSeq(const float& x, const float& y)
function IdenticalCon (line 74) | inline bool IdenticalCon(const float& x)
function IdenticalZero (line 76) | inline bool IdenticalZero(const float& x)
function IdenticalOne (line 78) | inline bool IdenticalOne(const float& x)
function IdenticalEqualCon (line 80) | inline bool IdenticalEqualCon(const float& x, const float& y)
function Integer (line 91) | inline int Integer(const float& x)
function GreaterThanZero (line 113) | inline bool GreaterThanZero(const float& x)
function GreaterThanOrZero (line 115) | inline bool GreaterThanOrZero(const float& x)
function LessThanZero (line 117) | inline bool LessThanZero(const float& x)
function LessThanOrZero (line 119) | inline bool LessThanOrZero(const float& x)
function abs_geq (line 121) | inline bool abs_geq(const float& x, const float& y)
function abs (line 168) | inline float abs(const float& x)
function sign (line 181) | inline float sign(const float& x)
FILE: thirdparty/cppad/include/cppad/core/base_std_math.hpp
type CppAD (line 135) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/bender_quad.hpp
type CppAD (line 309) | namespace CppAD { // BEGIN CppAD namespace
function BenderQuad (line 312) | void BenderQuad(
FILE: thirdparty/cppad/include/cppad/core/bool_fun.hpp
type CppAD (line 142) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/capacity_order.hpp
type CppAD (line 112) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/check_for_nan.hpp
type CppAD (line 136) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function put_check_for_nan (line 168) | void put_check_for_nan(const CppAD::vector<Base>& vec, std::string& fi...
function get_check_for_nan (line 196) | void get_check_for_nan(CppAD::vector<Base>& vec, const std::string& fi...
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/chkpoint_one.hpp
type CppAD (line 10) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class checkpoint (line 255) | class checkpoint : public atomic_base<Base> {
type member_struct (line 265) | struct member_struct {
method allocate_member (line 287) | void allocate_member(size_t thread)
method free_member (line 298) | void free_member(size_t thread)
method option_enum (line 306) | option_enum sparsity(void)
method size_var (line 415) | size_t size_var(void)
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/ctor.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/for_sparse_jac.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/forward.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/rev_sparse_hes.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/rev_sparse_jac.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/reverse.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/set_hes_sparse_bool.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/set_hes_sparse_set.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/set_jac_sparse_bool.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_one/set_jac_sparse_set.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/chkpoint_two.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class chkpoint_two (line 107) | class chkpoint_two : public atomic_three<Base> {
type member_struct (line 142) | struct member_struct {
method allocate_member (line 157) | void allocate_member(size_t thread)
method free_member (line 178) | void free_member(size_t thread)
method chkpoint_two (line 284) | chkpoint_two(const chkpoint_two& other)
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/ctor.hpp
type CppAD (line 86) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/dynamic.hpp
type CppAD (line 64) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function else (line 93) | else if( thread_alloc::in_parallel() )
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/for_type.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/forward.hpp
type CppAD (line 7) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function else (line 54) | else if( thread_alloc::in_parallel() )
function else (line 110) | else if( thread_alloc::in_parallel() )
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/hes_sparsity.hpp
type CppAD (line 7) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/jac_sparsity.hpp
type CppAD (line 7) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/rev_depend.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/chkpoint_two/reverse.hpp
type CppAD (line 7) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function else (line 55) | else if( thread_alloc::in_parallel() )
FILE: thirdparty/cppad/include/cppad/core/compare.hpp
type CppAD (line 112) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 115) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 211) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 403) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 499) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/con_dyn_var.hpp
type CppAD (line 89) | namespace CppAD {
function Constant (line 93) | bool Constant(const AD<Base> &x)
function Constant (line 103) | bool Constant(const VecAD<Base> &x)
function Dynamic (line 114) | bool Dynamic(const AD<Base> &x)
function Dynamic (line 124) | bool Dynamic(const VecAD<Base> &x)
function Parameter (line 135) | bool Parameter(const AD<Base> &x)
function Parameter (line 145) | bool Parameter(const VecAD<Base> &x)
function Variable (line 156) | bool Variable(const AD<Base> &x)
function Variable (line 166) | bool Variable(const VecAD<Base> &x)
FILE: thirdparty/cppad/include/cppad/core/cond_exp.hpp
type CppAD (line 161) | namespace CppAD {
function CondExpOp (line 164) | AD<Base> CondExpOp(
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 218) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/dependent.hpp
type CppAD (line 131) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/discrete/discrete.hpp
type CppAD (line 14) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class discrete (line 95) | class discrete {
method list_size (line 169) | static size_t list_size(void)
method discrete (line 217) | discrete(const std::string& name, Fun f) :
method ad (line 250) | AD<Base> ad(const AD<Base> &ax) const
method index (line 325) | static size_t index(const std::string& name)
method Base (line 399) | static Base eval(size_t index, const Base& x)
method ad_eval (line 437) | static AD<Base> ad_eval(size_t index, const AD<Base>& ax)
FILE: thirdparty/cppad/include/cppad/core/div.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/div_eq.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/epsilon.hpp
type CppAD (line 47) | namespace CppAD {
function Type (line 50) | inline Type epsilon(void)
FILE: thirdparty/cppad/include/cppad/core/equal_op_seq.hpp
type CppAD (line 86) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 88) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/for_hes_sparsity.hpp
type CppAD (line 124) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/for_jac_sparsity.hpp
type CppAD (line 172) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/for_one.hpp
type CppAD (line 115) | namespace CppAD {
function Vector (line 119) | Vector ADFun<Base,RecBase>::ForOne(const Vector &x, size_t j)
FILE: thirdparty/cppad/include/cppad/core/for_sparse_hes.hpp
type CppAD (line 147) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function SetVector (line 433) | SetVector ADFun<Base,RecBase>::ForSparseHes(
FILE: thirdparty/cppad/include/cppad/core/for_sparse_jac.hpp
type CppAD (line 223) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function SetVector (line 574) | SetVector ADFun<Base,RecBase>::ForSparseJac(
FILE: thirdparty/cppad/include/cppad/core/for_two.hpp
type CppAD (line 140) | namespace CppAD {
function BaseVector (line 144) | BaseVector ADFun<Base,RecBase>::ForTwo(
FILE: thirdparty/cppad/include/cppad/core/forward/forward.hpp
type CppAD (line 13) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function BaseVector (line 97) | BaseVector ADFun<Base,RecBase>::Forward(
function BaseVector (line 407) | BaseVector ADFun<Base,RecBase>::Forward(
FILE: thirdparty/cppad/include/cppad/core/fun_check.hpp
type CppAD (line 194) | namespace CppAD {
function FunCheck (line 196) | bool FunCheck(
FILE: thirdparty/cppad/include/cppad/core/fun_construct.hpp
type CppAD (line 221) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/graph/cpp_graph.hpp
type CppAD (line 13) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class cpp_graph (line 15) | class cpp_graph { // BEGIN_CPP_GRAPH_CLASS
method const_iterator (line 33) | const_iterator begin(void) const
method const_iterator (line 37) | const_iterator end(void)
method initialize (line 91) | void initialize(void)
method cpp_graph (line 104) | cpp_graph(void)
method function_name_set (line 166) | void function_name_set(const std::string& function_name)
method n_dynamic_ind_set (line 172) | void n_dynamic_ind_set(const size_t n_dynamic_ind)
method n_variable_ind_set (line 178) | void n_variable_ind_set(const size_t n_variable_ind)
method discrete_name_vec_size (line 322) | size_t discrete_name_vec_size(void) const
method discrete_name_vec_push_back (line 324) | void discrete_name_vec_push_back(const std::string& discrete_name)
method discrete_name_vec_find (line 326) | size_t discrete_name_vec_find(const std::string& discrete_name) const
method atomic_name_vec_size (line 336) | size_t atomic_name_vec_size(void) const
method atomic_name_vec_push_back (line 338) | void atomic_name_vec_push_back(const std::string& atomic_name)
method atomic_name_vec_find (line 340) | size_t atomic_name_vec_find(const std::string& atomic_name) const
method print_text_vec_size (line 350) | size_t print_text_vec_size(void) const
method print_text_vec_push_back (line 352) | void print_text_vec_push_back(const std::string& atomic_name)
method print_text_vec_find (line 354) | size_t print_text_vec_find(const std::string& print_text) const
method constant_vec_size (line 364) | size_t constant_vec_size(void) const
method constant_vec_push_back (line 366) | void constant_vec_push_back(const double& constant)
method graph_op_enum (line 370) | const graph_op_enum& operator_vec_get(size_t index) const
method operator_vec_size (line 372) | size_t operator_vec_size(void) const
method operator_vec_push_back (line 374) | void operator_vec_push_back(const graph_op_enum op_enum)
method operator_arg_size (line 380) | size_t operator_arg_size(void) const
method operator_arg_push_back (line 382) | void operator_arg_push_back(const size_t argument)
method dependent_vec_size (line 388) | size_t dependent_vec_size(void) const
method dependent_vec_push_back (line 390) | void dependent_vec_push_back(const size_t node_index)
method print (line 428) | void print(std::ostream& os) const
FILE: thirdparty/cppad/include/cppad/core/graph/from_graph.hpp
type CppAD (line 12) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/graph/graph_op_enum.hpp
type CppAD (line 180) | namespace CppAD { namespace graph {
type graph (line 180) | namespace graph {
type graph_op_enum (line 181) | enum graph_op_enum {
FILE: thirdparty/cppad/include/cppad/core/hash_code.hpp
type CppAD (line 13) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function hash_code (line 37) | unsigned short hash_code(const Value& value)
function hash_code (line 53) | unsigned short hash_code(const AD<Base>& u)
FILE: thirdparty/cppad/include/cppad/core/hessian.hpp
type CppAD (line 134) | namespace CppAD {
function Vector (line 138) | Vector ADFun<Base,RecBase>::Hessian(const Vector &x, size_t l)
function Vector (line 156) | Vector ADFun<Base,RecBase>::Hessian(const Vector &x, const Vector &w)
FILE: thirdparty/cppad/include/cppad/core/identical.hpp
type CppAD (line 10) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function IdenticalCon (line 36) | bool IdenticalCon(const AD<Base> &x)
function IdenticalZero (line 51) | bool IdenticalZero(const AD<Base> &x)
function IdenticalOne (line 66) | bool IdenticalOne(const AD<Base> &x)
function IdenticalEqualCon (line 84) | bool IdenticalEqualCon
FILE: thirdparty/cppad/include/cppad/core/independent/independent.hpp
type CppAD (line 9) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function Independent (line 61) | void Independent(
function Independent (line 130) | void Independent(ADVector &x, size_t abort_op_index, bool record_compare)
function Independent (line 179) | void Independent(ADVector &x, size_t abort_op_index)
function Independent (line 228) | void Independent(ADVector& x, ADVector& dynamic)
function Independent (line 273) | void Independent(ADVector &x)
FILE: thirdparty/cppad/include/cppad/core/integer.hpp
type CppAD (line 89) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 92) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 97) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/jacobian.hpp
type CppAD (line 105) | namespace CppAD {
function JacobianFor (line 108) | void JacobianFor(ADFun<Base, RecBase> &f, const Vector &x, Vector &jac)
function JacobianRev (line 146) | void JacobianRev(ADFun<Base, RecBase> &f, const Vector &x, Vector &jac)
function Vector (line 191) | Vector ADFun<Base,RecBase>::Jacobian(const Vector &x)
FILE: thirdparty/cppad/include/cppad/core/lu_ratio.hpp
type CppAD (line 208) | namespace CppAD { // BEGIN CppAD namespace
function LuRatio (line 212) | int LuRatio(SizeVector &ip, SizeVector &jp, ADvector &LU, AD<Base> &ra...
FILE: thirdparty/cppad/include/cppad/core/mul.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/mul_eq.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/near_equal_ext.hpp
type CppAD (line 120) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 125) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 132) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 139) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 147) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 154) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 160) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 166) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 172) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/new_dynamic.hpp
type CppAD (line 81) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/num_skip.hpp
type CppAD (line 60) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/numeric_limits.hpp
type CppAD (line 172) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class numeric_limits (line 180) | class numeric_limits {
method Float (line 183) | static Float epsilon(void)
method Float (line 191) | static Float min(void)
method Float (line 199) | static Float max(void)
method Float (line 207) | static Float quiet_NaN(void)
method Float (line 215) | static Float infinity(void)
class numeric_limits< AD<Base> > (line 228) | class numeric_limits< AD<Base> > {
method epsilon (line 231) | static AD<Base> epsilon(void)
method min (line 234) | static AD<Base> min(void)
method max (line 237) | static AD<Base> max(void)
method quiet_NaN (line 240) | static AD<Base> quiet_NaN(void)
method infinity (line 243) | static AD<Base> infinity(void)
FILE: thirdparty/cppad/include/cppad/core/omp_max_thread.hpp
type CppAD (line 67) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/opt_val_hes.hpp
type CppAD (line 238) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function opt_val_hes (line 366) | int opt_val_hes(
FILE: thirdparty/cppad/include/cppad/core/optimize.hpp
type CppAD (line 244) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/ordered.hpp
type CppAD (line 10) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 28) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 42) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 56) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 70) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 88) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/parallel_ad.hpp
type CppAD (line 101) | namespace CppAD {
function parallel_ad (line 109) | void parallel_ad(void)
FILE: thirdparty/cppad/include/cppad/core/pow.hpp
type CppAD (line 104) | namespace CppAD {
function pow (line 107) | AD<Base>
function pow (line 233) | AD<Base>
function pow (line 237) | AD<Base>
function pow (line 241) | AD<Base>
function pow (line 247) | AD<Base>
function pow (line 251) | AD<Base>
function pow (line 255) | AD<Base>
function pow (line 259) | AD<Base>
function pow (line 265) | AD<Base>
function pow (line 269) | AD<Base>
function pow (line 273) | AD<Base>
function pow (line 277) | AD<Base>
function pow (line 283) | inline AD<double>
function pow (line 287) | inline AD<double>
function pow (line 291) | inline AD<double>
function pow (line 295) | inline AD<double>
function pow (line 303) | AD<Base> pow
function pow (line 307) | AD<Base> pow
FILE: thirdparty/cppad/include/cppad/core/print_for.hpp
type CppAD (line 132) | namespace CppAD {
function PrintFor (line 134) | void PrintFor(
function PrintFor (line 191) | void PrintFor(const char* before, const AD<Base>& value)
function PrintFor (line 195) | void PrintFor(const char* before, const VecAD_reference<Base>& value)
function PrintFor (line 199) | void PrintFor(
function PrintFor (line 207) | void PrintFor(
function PrintFor (line 215) | void PrintFor(
FILE: thirdparty/cppad/include/cppad/core/rev_hes_sparsity.hpp
type CppAD (line 128) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/rev_jac_sparsity.hpp
type CppAD (line 122) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/rev_one.hpp
type CppAD (line 118) | namespace CppAD {
function Vector (line 122) | Vector ADFun<Base,RecBase>::RevOne(const Vector &x, size_t i)
FILE: thirdparty/cppad/include/cppad/core/rev_sparse_hes.hpp
type CppAD (line 191) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function SetVector (line 503) | SetVector ADFun<Base,RecBase>::RevSparseHes(
FILE: thirdparty/cppad/include/cppad/core/rev_sparse_jac.hpp
type CppAD (line 169) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function SetVector (line 492) | SetVector ADFun<Base,RecBase>::RevSparseJac(
FILE: thirdparty/cppad/include/cppad/core/rev_two.hpp
type CppAD (line 141) | namespace CppAD {
function BaseVector (line 145) | BaseVector ADFun<Base,RecBase>::RevTwo(
FILE: thirdparty/cppad/include/cppad/core/reverse.hpp
type CppAD (line 12) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function BaseVector (line 85) | BaseVector ADFun<Base,RecBase>::Reverse(size_t q, const BaseVector &w)
FILE: thirdparty/cppad/include/cppad/core/sign.hpp
type CppAD (line 69) | namespace CppAD {
function sign (line 114) | AD<Base> sign(const AD<Base> &x)
function sign (line 118) | AD<Base> sign(const VecAD_reference<Base> &x)
FILE: thirdparty/cppad/include/cppad/core/sparse_hes.hpp
type CppAD (line 248) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class sparse_hes_work (line 254) | class sparse_hes_work {
method sparse_hes_work (line 266) | sparse_hes_work(void)
method clear (line 269) | void clear(void)
FILE: thirdparty/cppad/include/cppad/core/sparse_hessian.hpp
type CppAD (line 326) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class sparse_hessian_work (line 336) | class sparse_hessian_work {
method sparse_hessian_work (line 351) | sparse_hessian_work(void) : color_method("cppad.symmetric")
method clear (line 354) | void clear(void)
function BaseVector (line 751) | BaseVector ADFun<Base,RecBase>::SparseHessian(
function BaseVector (line 837) | BaseVector ADFun<Base,RecBase>::SparseHessian(const BaseVector &x, con...
FILE: thirdparty/cppad/include/cppad/core/sparse_jac.hpp
type CppAD (line 225) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class sparse_jac_work (line 230) | class sparse_jac_work {
method sparse_jac_work (line 238) | sparse_jac_work(void)
method clear (line 242) | void clear(void)
FILE: thirdparty/cppad/include/cppad/core/sparse_jacobian.hpp
type CppAD (line 274) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class sparse_jacobian_work (line 284) | class sparse_jacobian_work {
method sparse_jacobian_work (line 295) | sparse_jacobian_work(void) : color_method("cppad")
method clear (line 299) | void clear(void)
function BaseVector (line 929) | BaseVector ADFun<Base,RecBase>::SparseJacobian(
function BaseVector (line 1044) | BaseVector ADFun<Base,RecBase>::SparseJacobian( const BaseVector& x )
FILE: thirdparty/cppad/include/cppad/core/std_math_11.hpp
type CppAD (line 773) | namespace CppAD {
function erf (line 797) | inline AD<Base> erf(const AD<Base> &x)
function erfc (line 802) | inline AD<Base> erfc(const AD<Base> &x)
function erf (line 865) | inline AD<Base> erf(const VecAD_reference<Base> &x)
function erfc (line 870) | inline AD<Base> erfc(const VecAD_reference<Base> &x)
function log10 (line 889) | inline AD<Base> log10(const AD<Base> &x)
function log10 (line 892) | inline AD<Base> log10(const VecAD_reference<Base> &x)
FILE: thirdparty/cppad/include/cppad/core/sub.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/sub_eq.hpp
type CppAD (line 9) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/subgraph_jac_rev.hpp
type CppAD (line 178) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/subgraph_reverse.hpp
type CppAD (line 159) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/subgraph_sparsity.hpp
type CppAD (line 142) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
FILE: thirdparty/cppad/include/cppad/core/tape_link.hpp
type CppAD (line 15) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
function tape_id_t (line 40) | tape_id_t* AD<Base>::tape_id_ptr(size_t thread)
FILE: thirdparty/cppad/include/cppad/core/to_csrc.hpp
type CppAD (line 184) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/unary_minus.hpp
type CppAD (line 73) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/unary_plus.hpp
type CppAD (line 69) | namespace CppAD {
FILE: thirdparty/cppad/include/cppad/core/value.hpp
type CppAD (line 69) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 72) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/var2par.hpp
type CppAD (line 61) | namespace CppAD {
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 64) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
function CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION (line 72) | CPPAD_INLINE_FRIEND_TEMPLATE_FUNCTION
FILE: thirdparty/cppad/include/cppad/core/vec_ad/vec_ad.hpp
type CppAD (line 8) | namespace CppAD { // BEGIN_CPPAD_NAMESPACE
class VecAD_reference (line 156) | class VecAD_reference {
method VecAD_reference (line 168) | VecAD_reference(VecAD<Base>& vec, const AD<Base>& ind)
method CPPAD_VEC_AD_COMP_ASSIGN (line 179) | CPPAD_VEC_AD_COMP_ASSIGN( += )
class VecAD (line 365) | class VecAD {
method VecAD (line 390) | VecAD(void)
method VecAD (line 396) | VecAD(size_t length)
method size (line 420) | size_t size(void)
method Base (line 424) | Base& operator[](size_t i)
FILE: thirdparty/cppad/include/cppad/core/zdouble.hpp
type CppAD (line 209) | namespace CppAD { // CPPAD_BEGIN_NAMESPACDE
class zdouble (line 215) | class zdouble {
method zdouble (line 262) | zdouble(void)
method zdouble (line 266) | zdouble(const zdouble& z)
method zdouble (line 270) | zdouble(const double& dbl)
method zdouble (line 274) | zdouble(const size_t& i)
method zdouble (line 278) | zdouble(const long& i)
method zdouble (line 282) | zdouble(const int& i)
method zdouble (line 291) | zdouble& operator=(const zdouble& z)
method zdouble (line 296) | zdouble& operator=(const double& dbl)
method CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR (line 302) | CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR(+=)
method zdouble (line 333) | zdouble operator * (const double& x) const
method zdouble (line 338) | zdouble operator / (const zdouble& z) const
method zdouble (line 343) | zdouble operator / (const double& x) const
method zdouble (line 349) | zdouble& operator *= (const zdouble& z)
method zdouble (line 355) | zdouble& operator *= (const double& x)
method zdouble (line 362) | zdouble& operator /= (const zdouble& z)
method zdouble (line 368) | zdouble& operator /= (const double& x)
function zdouble (line 376) | inline
method zdouble (line 262) | zdouble(void)
method zdouble (line 266) | zdouble(const zdouble& z)
method zdouble (line 270) | zdouble(const double& dbl)
method zdouble (line 274) | zdouble(const size_t& i)
method zdouble (line 278) | zdouble(const long& i)
method zdouble (line 282) | zdouble(const int& i)
method zdouble (line 291) | zdouble& operator=(const zdouble& z)
method zdouble (line 296) | zdouble& operator=(const double& dbl)
method CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR (line 302) | CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR(+=)
method zdouble (line 333) | zdouble operator * (const double& x) const
method zdouble (line 338) | zdouble operator / (const zdouble& z) const
method zdouble (line 343) | zdouble operator / (const double& x) const
method zdouble (line 349) | zdouble& operator *= (const zdouble& z)
method zdouble (line 355) | zdouble& operator *= (const double& x)
method zdouble (line 362) | zdouble& operator /= (const zdouble& z)
method zdouble (line 368) | zdouble& operator /= (const double& x)
function EqualOpSeq (line 422) | inline bool EqualOpSeq(const zdouble& x, const zdouble& y)
function IdenticalCon (line 426) | inline bool IdenticalCon(const zdouble& x)
function IdenticalZero (line 428) | inline bool IdenticalZero(const zdouble& x)
function IdenticalOne (line 430) | inline bool IdenticalOne(const zdouble& x)
function IdenticalEqualCon (line 432) | inline bool IdenticalEqualCon(const zdouble& x, const zdouble& y)
function Integer (line 442) | inline int Integer(const zdouble& x)
function zdouble (line 446) | inline zdouble azmul(const zdouble& x, const zdouble& y)
function GreaterThanZero (line 450) | inline bool GreaterThanZero(const zdouble& x)
function GreaterThanOrZero (line 452) | inline bool GreaterThanOrZero(const zdouble& x)
function LessThanZero (line 454) | inline bool LessThanZero(const zdouble& x)
function LessThanOrZero (line 456) | inline bool LessThanOrZero(const zdouble& x)
function abs_geq (line 458) | inline bool abs_geq(const zdouble& x, const zdouble& y)
function zdouble (line 506) | inline zdouble abs(const zdouble& x)
function zdouble (line 510) | inline zdouble sign(const zdouble& x)
function zdouble (line 519) | inline zdouble pow(const zdouble& x, const zdouble& y)
FILE: thirdparty/cppad/include/cppad/local/ad_tape.hpp
type CppAD (line 9) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL__NAMESPACE
type local (line 9) | namespace local { // BEGIN_CPPAD_LOCAL__NAMESPACE
class ADTape (line 19) | class ADTape {
type CompareOp (line 42) | enum CompareOp
type CompareOp (line 123) | enum CompareOp
function addr_t (line 163) | addr_t ADTape<Base>::RecordParOp(const AD<Base>& y)
FILE: thirdparty/cppad/include/cppad/local/atom_state.hpp
type CppAD (line 8) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 8) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type enum_atom_state (line 10) | enum enum_atom_state {
FILE: thirdparty/cppad/include/cppad/local/atomic_index.hpp
type CppAD (line 114) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 114) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type atomic_index_info (line 116) | struct atomic_index_info {
function atomic_index (line 124) | size_t atomic_index(
FILE: thirdparty/cppad/include/cppad/local/color_general.hpp
type CppAD (line 11) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 11) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
function color_general_cppad (line 65) | void color_general_cppad(
function color_general_colpack (line 208) | void color_general_colpack(
FILE: thirdparty/cppad/include/cppad/local/color_symmetric.hpp
type CppAD (line 11) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 11) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
function color_symmetric_cppad (line 74) | void color_symmetric_cppad(
function color_symmetric_colpack (line 218) | void color_symmetric_colpack(
FILE: thirdparty/cppad/include/cppad/local/cppad_colpack.hpp
type CppAD (line 9) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 9) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
FILE: thirdparty/cppad/include/cppad/local/declare_ad.hpp
type CppAD (line 15) | namespace CppAD { namespace local {
type local (line 15) | namespace local {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type local (line 21) | namespace local { namespace val_graph {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type CompareOp (line 27) | enum CompareOp
class sparse_hes_work (line 43) | class sparse_hes_work
class sparse_jac_work (line 44) | class sparse_jac_work
class sparse_jacobian_work (line 45) | class sparse_jacobian_work
class sparse_hessian_work (line 46) | class sparse_hessian_work
class AD (line 47) | class AD
class ADFun (line 48) | class ADFun
class atomic_base (line 49) | class atomic_base
class atomic_three (line 50) | class atomic_three
class atomic_four (line 51) | class atomic_four
class discrete (line 52) | class discrete
class VecAD (line 53) | class VecAD
class VecAD_reference (line 54) | class VecAD_reference
type CompareOp (line 137) | enum CompareOp
type CppAD (line 21) | namespace CppAD { namespace local { namespace val_graph {
type local (line 15) | namespace local {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type local (line 21) | namespace local { namespace val_graph {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type CompareOp (line 27) | enum CompareOp
class sparse_hes_work (line 43) | class sparse_hes_work
class sparse_jac_work (line 44) | class sparse_jac_work
class sparse_jacobian_work (line 45) | class sparse_jacobian_work
class sparse_hessian_work (line 46) | class sparse_hessian_work
class AD (line 47) | class AD
class ADFun (line 48) | class ADFun
class atomic_base (line 49) | class atomic_base
class atomic_three (line 50) | class atomic_three
class atomic_four (line 51) | class atomic_four
class discrete (line 52) | class discrete
class VecAD (line 53) | class VecAD
class VecAD_reference (line 54) | class VecAD_reference
type CompareOp (line 137) | enum CompareOp
type CppAD (line 25) | namespace CppAD {
type local (line 15) | namespace local {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type local (line 21) | namespace local { namespace val_graph {
class ADTape (line 16) | class ADTape
class player (line 17) | class player
class dyn_player (line 18) | class dyn_player
class recorder (line 19) | class recorder
type val_graph (line 21) | namespace val_graph {
class tape_t (line 22) | class tape_t
type CompareOp (line 27) | enum CompareOp
class sparse_hes_work (line 43) | class sparse_hes_work
class sparse_jac_work (line 44) | class sparse_jac_work
class sparse_jacobian_work (line 45) | class sparse_jacobian_work
class sparse_hessian_work (line 46) | class sparse_hessian_work
class AD (line 47) | class AD
class ADFun (line 48) | class ADFun
class atomic_base (line 49) | class atomic_base
class atomic_three (line 50) | class atomic_three
class atomic_four (line 51) | class atomic_four
class discrete (line 52) | class discrete
class VecAD (line 53) | class VecAD
class VecAD_reference (line 54) | class VecAD_reference
type CompareOp (line 137) | enum CompareOp
FILE: thirdparty/cppad/include/cppad/local/define.hpp
function Op (line 155) | AD<Base> operator Op \
function Op (line 160) | AD<Base> operator Op \
function Op (line 165) | AD<Base> operator Op \
function Op (line 170) | AD<Base> operator Op \
function Op (line 178) | AD<Base> operator Op \
function Op (line 183) | AD<Base> operator Op \
function Op (line 188) | AD<Base> operator Op \
function Op (line 193) | AD<Base> operator Op \
function Op (line 199) | inline AD<double> operator Op \
function Op (line 203) | inline AD<double> operator Op \
function Op (line 207) | inline AD<double> operator Op \
function Op (line 211) | inline AD<double> operator Op \
function Op (line 258) | bool operator Op \
function Op (line 263) | bool operator Op \
function Op (line 268) | bool operator Op \
function Op (line 273) | bool operator Op \
function Op (line 281) | bool operator Op \
function Op (line 286) | bool operator Op \
function Op (line 291) | bool operator Op \
function Op (line 296) | bool operator Op \
function Op (line 302) | inline bool operator Op \
function Op (line 306) | inline bool operator Op \
function Op (line 310) | inline bool operator Op \
function Op (line 314) | inline bool operator Op \
FILE: thirdparty/cppad/include/cppad/local/graph/cpp_graph_itr.hpp
type CppAD (line 11) | namespace CppAD { namespace local { namespace graph {
type local (line 11) | namespace local { namespace graph {
type graph (line 11) | namespace graph {
class cpp_graph_itr (line 13) | class cpp_graph_itr {
method set_value (line 128) | void set_value(void)
method cpp_graph_itr (line 326) | cpp_graph_itr(void)
method cpp_graph_itr (line 330) | cpp_graph_itr(
method value_type (line 371) | value_type operator*(void)
method cpp_graph_itr (line 387) | cpp_graph_itr& operator++(void)
method cpp_graph_itr (line 394) | cpp_graph_itr operator++(int)
FILE: thirdparty/cppad/include/cppad/local/graph/cpp_graph_op.hpp
type CppAD (line 16) | namespace CppAD { namespace local { namespace graph {
type local (line 16) | namespace local { namespace graph {
type graph (line 16) | namespace graph {
FILE: thirdparty/cppad/include/cppad/local/graph/csrc_writer.hpp
type CppAD (line 26) | namespace CppAD { namespace local { namespace graph {
type local (line 26) | namespace local { namespace graph {
type graph (line 26) | namespace graph {
FILE: thirdparty/cppad/include/cppad/local/graph/json_lexer.hpp
type CppAD (line 12) | namespace CppAD { namespace local { namespace graph {
type local (line 12) | namespace local { namespace graph {
type graph (line 12) | namespace graph {
class json_lexer (line 15) | class json_lexer {
FILE: thirdparty/cppad/include/cppad/local/graph/json_parser.hpp
type CppAD (line 38) | namespace CppAD { namespace local { namespace graph {
type local (line 38) | namespace local { namespace graph {
type graph (line 38) | namespace graph {
FILE: thirdparty/cppad/include/cppad/local/graph/json_writer.hpp
type CppAD (line 35) | namespace CppAD { namespace local { namespace graph {
type local (line 35) | namespace local { namespace graph {
type graph (line 35) | namespace graph {
FILE: thirdparty/cppad/include/cppad/local/hash_code.hpp
type CppAD (line 14) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 14) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
function local_hash_code (line 38) | unsigned short local_hash_code(const Value& value)
function local_hash_code (line 115) | unsigned short local_hash_code(
FILE: thirdparty/cppad/include/cppad/local/independent.hpp
type CppAD (line 7) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 7) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
FILE: thirdparty/cppad/include/cppad/local/is_pod.hpp
type CppAD (line 41) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 41) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
function is_pod (line 43) | inline bool is_pod(void) { return false; }
FILE: thirdparty/cppad/include/cppad/local/op_code_dyn.hpp
type CppAD (line 8) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 8) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type op_code_dyn (line 172) | enum op_code_dyn {
function num_arg_dyn (line 256) | inline size_t num_arg_dyn(op_code_dyn op)
function num_non_par_arg_dyn (line 442) | inline size_t num_non_par_arg_dyn(op_code_dyn op)
FILE: thirdparty/cppad/include/cppad/local/op_code_var.hpp
type CppAD (line 19) | namespace CppAD { namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type local (line 19) | namespace local { // BEGIN_CPPAD_LOCAL_NAMESPACE
type op_code_var (line 194) | enum op_code_var {
function NumArg (line 299) | inline size_t NumArg( op_code_var op)
function NumRes (line 420) | inline size_t NumRes(op_code_var op)
function OpName (line 521) | inline std::string OpName(op_code_var op)
function printOpField (line 639) | void printOpField(
function printOp (line 707) | void printOp(
function printOpResult (line 1048) | void printOpResult(
function arg_is_variable (line 1104) | void arg_is_variable(
FILE: thirdparty/cppad/include/cppad/local/optimize/cexp_info.hpp
type CppAD (line 91) | namespace CppAD { namespace local { namespace optimize {
type local (line 91) | namespace local { namespace optimize {
type optimize (line 91) | namespace optimize {
type struct_cexp_info (line 96) | struct struct_cexp_info {
type struct_cskip_new (line 107) | struct struct_cskip_new {
type local (line 117) | namespace local {
type optimize (line 91) | namespace optimize {
type struct_cexp_info (line 96) | struct struct_cexp_info {
type struct_cskip_new (line 107) | struct struct_cskip_new {
type CppAD (line 117) | namespace CppAD { namespace local {
type local (line 91) | namespace local { namespace optimize {
type optimize (line 91) | namespace optimize {
type struct_cexp_info (line 96) | struct struct_cexp_info {
type struct_cskip_new (line 107) | struct struct_cskip_new {
type local (line 117) | namespace local {
type optimize (line 91) | namespace optimize {
type struct_cexp_info (line 96) | struct struct_cexp_info {
type struct_cskip_new (line 107) | struct struct_cskip_new {
FILE: thirdparty/cppad/include/cppad/local/optimize/csum_op_info.hpp
type CppAD (line 16) | namespace CppAD { namespace local { namespace optimize {
type local (line 16) | namespace local { namespace optimize {
type optimize (line 16) | namespace optimize {
type struct_csum_op_info (line 20) | struct struct_csum_op_info {
FILE: thirdparty/cppad/include/cppad/local/optimize/csum_stacks.hpp
type CppAD (line 16) | namespace CppAD { namespace local { namespace optimize {
type local (line 16) | namespace local { namespace optimize {
type optimize (line 16) | namespace optimize {
type struct_csum_stacks (line 20) | struct struct_csum_stacks {
Condensed preview — 831 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,110K chars).
[
{
"path": ".clang-format",
"chars": 164,
"preview": "BasedOnStyle: Microsoft\nIndentWidth: 4\nUseTab: ForIndentation\nSortIncludes: false\nColumnLimit: 100\nAlignEscapedNewlines:"
},
{
"path": ".github/actions/setup_optimizers_linux/action.yml",
"chars": 7121,
"preview": "name: \"Install optimizers on linux\"\ndescription: \"Install optimizers and Setup licenses on linux\"\n\ninputs:\n GUROBI_WLS:"
},
{
"path": ".github/actions/setup_optimizers_macos/action.yml",
"chars": 6942,
"preview": "name: \"Install optimizers on macOS\"\ndescription: \"Install optimizers and Setup licenses on macOS\"\n\ninputs:\n GUROBI_WLS:"
},
{
"path": ".github/actions/setup_optimizers_windows/action.yml",
"chars": 5631,
"preview": "name: \"Install optimizers on windows\"\ndescription: \"Install optimizers and Setup licenses on windows\"\n\ninputs:\n GUROBI_"
},
{
"path": ".github/dependabot.yml",
"chars": 536,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/doc-build.yml",
"chars": 1380,
"preview": "name: gh-pages\n\non:\n push:\n branches:\n - master\n\npermissions:\n contents: write\n\njobs:\n doc_build:\n runs-on"
},
{
"path": ".github/workflows/linux-build.yml",
"chars": 1772,
"preview": "name: linux-build\n\non:\n pull_request:\n push:\n branches:\n - master\n\njobs:\n\n linux_build:\n runs-on: ${{ matr"
},
{
"path": ".github/workflows/macos-build.yml",
"chars": 1699,
"preview": "name: macos-build\n\non:\n pull_request:\n push:\n branches:\n - master\n\njobs:\n\n macos_build:\n runs-on: ${{ matr"
},
{
"path": ".github/workflows/wheel.yml",
"chars": 2939,
"preview": "name: cibuildwheel\n\non:\n workflow_dispatch:\n inputs:\n publish:\n description: 'Publish wheels to PyPI: (t"
},
{
"path": ".github/workflows/windows-build.yml",
"chars": 1646,
"preview": "name: windows-build\n\non:\n pull_request:\n push:\n branches:\n - master\n\njobs:\n\n windows_build:\n runs-on: wind"
},
{
"path": ".gitignore",
"chars": 206,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\nbuild/\n.pytest_cache/\n.mypy_cache/\ndist/\n\n.id"
},
{
"path": ".pre-commit-config.yaml",
"chars": 390,
"preview": "repos:\n # C++ 格式化 - clang-format\n - repo: https://github.com/pre-commit/mirrors-clang-format\n rev: v22.1.1\n hook"
},
{
"path": "CMakeLists.txt",
"chars": 9736,
"preview": "cmake_minimum_required(VERSION 3.15...3.27)\n\nproject(pyoptinterface)\n\nset(CMAKE_CXX_STANDARD 20)\n# Linux: -fPIC\nset(CMAK"
},
{
"path": "GEMINI.md",
"chars": 1348,
"preview": "# PyOptInterface Modeling Guidelines\n\nWhen modeling with `pyoptinterface_native`, adhere to these patterns.\n\n## Solver I"
},
{
"path": "LICENSE.md",
"chars": 18154,
"preview": "Copyright (c) 2023: Yue Yang\n\nThe PyOptInterface is licensed under the **[MPL]** version 2.0:\n\n[MPL]: https://www.mozill"
},
{
"path": "README.md",
"chars": 5671,
"preview": "PyOptInterface (Python Optimization Interface)\n=======\n\n[\n I = 1:"
},
{
"path": "bench/bench_modify.mod",
"chars": 114,
"preview": "param N;\n\nvar x{1..N} >= 0;\n\ns.t. c1: sum {i in 1..N} x[i] = N;\n\nminimize obj: sum {i in 1..N div 2} i / N * x[i];"
},
{
"path": "bench/bench_modify.py",
"chars": 2763,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import gurobi, copt\n\n\nimport gurobipy as gp\nimport coptpy as cp\n\nimport"
},
{
"path": "bench/bench_modify.run",
"chars": 321,
"preview": "param t0;\nparam t1;\nlet t0 := time();\n\nmodel bench_modify.mod;\n\nlet N := 10000;\n\noption solver_msg 0;\noption presolve 0;"
},
{
"path": "bench/bench_static.jl",
"chars": 1169,
"preview": "using JuMP\nusing Gurobi\nusing COPT\nusing MosekTools\n\nfunction bench_jump(model, M, N)\n @variable(model, x[1:M, 1:N] >"
},
{
"path": "bench/bench_static.py",
"chars": 5471,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import gurobi, copt, mosek\n\nimport pyomo.environ as pyo\nfrom pyomo.comm"
},
{
"path": "bench/nqueens/.gitignore",
"chars": 6,
"preview": "*.csv\n"
},
{
"path": "bench/nqueens/nqueens.jl",
"chars": 958,
"preview": "using JuMP\nimport Gurobi\nimport LinearAlgebra\n\nfunction solve_nqueens(N)\n model = direct_model(Gurobi.Optimizer())\n "
},
{
"path": "bench/nqueens/nqueens_gurobipy.py",
"chars": 1154,
"preview": "from gurobipy import *\nimport numpy as np\nimport os\nimport time\n\n\ndef solve_nqueens(N):\n model = Model(\"queens\")\n "
},
{
"path": "bench/nqueens/nqueens_poi.py",
"chars": 1367,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import gurobi\nimport numpy as np\nimport os\nimport time\n\n\ndef solve_nque"
},
{
"path": "bench/nqueens/nqueens_pythonmip.py",
"chars": 1241,
"preview": "from mip.model import *\nfrom mip import GUROBI\nimport numpy as np\nimport os\nimport time\n\n\ndef solve_nqueens(N):\n mode"
},
{
"path": "bench/test_delete.py",
"chars": 1595,
"preview": "import gurobipy as gp\nimport coptpy as cp\nimport pyoptinterface as poi\nfrom pyoptinterface import copt\n\n\ndef bench_poi_b"
},
{
"path": "docs/Makefile",
"chars": 638,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
},
{
"path": "docs/make.bat",
"chars": 769,
"preview": "@ECHO OFF\n\npushd %~dp0\n\nREM Command file for Sphinx documentation\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-bu"
},
{
"path": "docs/requirements.txt",
"chars": 98,
"preview": "sphinx\nmyst-parser\nmyst-nb\nsphinx-copybutton\nfuro\nnumpy\nscipy\nhighsbox\ntccbox\nllvmlite\nmatplotlib\n"
},
{
"path": "docs/source/api/pyoptinterface.copt.rst",
"chars": 178,
"preview": "pyoptinterface.copt package\n====================================\n\n.. automodule:: pyoptinterface.copt\n :members:\n :i"
},
{
"path": "docs/source/api/pyoptinterface.gurobi.rst",
"chars": 182,
"preview": "pyoptinterface.gurobi package\n====================================\n\n.. automodule:: pyoptinterface.gurobi\n :members:\n "
},
{
"path": "docs/source/api/pyoptinterface.highs.rst",
"chars": 180,
"preview": "pyoptinterface.highs package\n====================================\n\n.. automodule:: pyoptinterface.highs\n :members:\n "
},
{
"path": "docs/source/api/pyoptinterface.knitro.rst",
"chars": 183,
"preview": "pyoptinterface.knitro package\n====================================\n\n.. automodule:: pyoptinterface.knitro\n :members:\n "
},
{
"path": "docs/source/api/pyoptinterface.mosek.rst",
"chars": 180,
"preview": "pyoptinterface.mosek package\n====================================\n\n.. automodule:: pyoptinterface.mosek\n :members:\n "
},
{
"path": "docs/source/api/pyoptinterface.rst",
"chars": 333,
"preview": "pyoptinterface package\n===========================\n\n.. automodule:: pyoptinterface\n :members:\n :undoc-members:\n :s"
},
{
"path": "docs/source/api/pyoptinterface.xpress.rst",
"chars": 182,
"preview": "pyoptinterface.xpress package\n====================================\n\n.. automodule:: pyoptinterface.xpress\n :members:\n "
},
{
"path": "docs/source/attribute/copt.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/gurobi.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/highs.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/ipopt.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/knitro.md",
"chars": 1482,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/mosek.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/attribute/xpress.md",
"chars": 1509,
"preview": "### Supported [model attribute](#pyoptinterface.ModelAttribute)\n\n:::{list-table}\n:header-rows: 1\n\n* - Attribute\n - "
},
{
"path": "docs/source/benchmark.md",
"chars": 3843,
"preview": "# Benchmark\n\n## Model construction time\n\nThe benchmark is adapted from [the JuMP paper](https://github.com/jump-dev/JuMP"
},
{
"path": "docs/source/callback.md",
"chars": 9743,
"preview": "# Callback\n\n:::{attention}\nThe behavior of callback function highly depends on the optimizer and the specific problem. P"
},
{
"path": "docs/source/changelog.md",
"chars": 3143,
"preview": "# Changelog\n\n## 0.6.1\n- Fix some bugs in Mosek interface\n- Update documentation of Knitro\n\n## 0.6.0\n- Add support for KN"
},
{
"path": "docs/source/common_model_interface.md",
"chars": 7938,
"preview": "# Common Model Interface\n\nGenerally speaking, the following APIs are common to all optimizers except for adding constrai"
},
{
"path": "docs/source/conf.py",
"chars": 1179,
"preview": "# Configuration file for the Sphinx documentation builder.\n#\n# For the full list of built-in configuration values, see t"
},
{
"path": "docs/source/constraint.md",
"chars": 9394,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Constraint\n\nPyOptInterface supports the following types of con"
},
{
"path": "docs/source/container.md",
"chars": 7565,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Container\n\nIn our previous examples, we only use scalar varia"
},
{
"path": "docs/source/copt.md",
"chars": 2317,
"preview": "# COPT\n\n## Initial setup\n\n```python\nfrom pyoptinterface import copt\n\nmodel = copt.Model()\n```\n\nYou need to follow the in"
},
{
"path": "docs/source/develop.md",
"chars": 3433,
"preview": "# Developer Guide\n\nThis section is intended for developers who want to contribute to the PyOptInterface library. It prov"
},
{
"path": "docs/source/examples/economic_dispatch.md",
"chars": 5531,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Economic Dispatch\n\nEconomic dispatch is a classic optimization"
},
{
"path": "docs/source/examples/optimal_control_rocket.md",
"chars": 3989,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Optimal Control of a Rocket\n\nThis example is adapted from [the"
},
{
"path": "docs/source/examples/optimal_power_flow.md",
"chars": 8895,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Optimal Power Flow\n\nAlternating current optimal power flow (AC"
},
{
"path": "docs/source/expression.md",
"chars": 2289,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Expression\n\n## Basic expression\n\nPyOptInterface currently supp"
},
{
"path": "docs/source/faq.md",
"chars": 2469,
"preview": "# Frequently Asked Questions\n\n## How to suppress the output of the optimizer?\n\nThere are two kinds of output that you ma"
},
{
"path": "docs/source/getting_started.md",
"chars": 11940,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Getting Started\n\n## Installation\nPyOptInterface is available "
},
{
"path": "docs/source/gurobi.md",
"chars": 3182,
"preview": "# Gurobi\n\n## Initial setup\n\n```python\nfrom pyoptinterface import gurobi\n\nmodel = gurobi.Model()\n```\n\nYou need to follow "
},
{
"path": "docs/source/highs.md",
"chars": 1272,
"preview": "# HiGHS\n\n## Initial setup\n\n```python\nfrom pyoptinterface import highs\n\nmodel = highs.Model()\n```\n\nYou need to follow the"
},
{
"path": "docs/source/index.md",
"chars": 791,
"preview": "```{include} ../../README.md\n```\n\n## Contents\n```{toctree}\n:maxdepth: 2\n:titlesonly:\n:caption: User Guide\n\ngetting_start"
},
{
"path": "docs/source/infeasibility.md",
"chars": 3024,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Infeasibility Analysis\n\nThe optimization model is not ways fe"
},
{
"path": "docs/source/ipopt.md",
"chars": 2304,
"preview": "# Ipopt\n\n## Initial setup\n\n```python\nfrom pyoptinterface import ipopt\n\nmodel = ipopt.Model()\n```\n\nYou need to follow the"
},
{
"path": "docs/source/knitro.md",
"chars": 3831,
"preview": "# KNITRO\n\n## Initial setup\n\n```python\nfrom pyoptinterface import knitro\n\nmodel = knitro.Model()\n```\n\nYou need to follow "
},
{
"path": "docs/source/model.md",
"chars": 6841,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Model\n\nModel is the central class of the PyOptInterface packa"
},
{
"path": "docs/source/mosek.md",
"chars": 1638,
"preview": "# Mosek\n\n## Initial setup\n\n```python\nfrom pyoptinterface import mosek\n\nmodel = mosek.Model()\n```\n\nYou need to follow the"
},
{
"path": "docs/source/nonlinear.md",
"chars": 9709,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n# Nonlinear Programming\n\n## Introduction\n\nCompared with the line"
},
{
"path": "docs/source/numpy.md",
"chars": 3539,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Matrix Modeling\n\nIn the previous [container](container.md) se"
},
{
"path": "docs/source/objective.md",
"chars": 1096,
"preview": "# Objective\n\nThe objective is a function of the variables that the optimization algorithm seeks to minimize or maximize."
},
{
"path": "docs/source/roadmap.md",
"chars": 325,
"preview": "## Roadmap\n\nThis is the roadmap for the project. It is a living document and will be updated as the project progresses.\n"
},
{
"path": "docs/source/structure.md",
"chars": 3264,
"preview": "---\nfile_format: mystnb\nkernelspec:\n name: python3\n---\n\n# Building Bigger Optimization Model\n\nIn this document, we will"
},
{
"path": "docs/source/variable.md",
"chars": 2276,
"preview": "# Variable\n\nVariable represents a decision variable in the optimization problem. It can be created by calling the [`add_"
},
{
"path": "docs/source/xpress.md",
"chars": 5376,
"preview": "# Xpress\n\n## Initial setup\n\n```python\nfrom pyoptinterface import xpress\nmodel = xpress.Model()\n```\n\nYou need to follow t"
},
{
"path": "include/pyoptinterface/cache_model.hpp",
"chars": 2224,
"preview": "#pragma once\n\n#include <concepts>\n#include <vector>\n#include <span>\n\n// This file defines some common utilities to store"
},
{
"path": "include/pyoptinterface/container.hpp",
"chars": 9149,
"preview": "#pragma once\n\n#include <bit>\n#include <vector>\n#include <concepts>\n#include <assert.h>\n\n#include \"pyoptinterface/core.hp"
},
{
"path": "include/pyoptinterface/copt_model.hpp",
"chars": 13168,
"preview": "#pragma once\n\n#include <memory>\n\n#include \"solvers/copt/copt.h\"\n\n#include \"pyoptinterface/core.hpp\"\n#include \"pyoptinter"
},
{
"path": "include/pyoptinterface/core.hpp",
"chars": 12141,
"preview": "#pragma once\n\n#include <stdint.h>\n#include <vector>\n#include <optional>\n#include \"ankerl/unordered_dense.h\"\n\nusing Index"
},
{
"path": "include/pyoptinterface/cppad_interface.hpp",
"chars": 2047,
"preview": "#pragma once\n\n#include \"cppad/cppad.hpp\"\n#include \"pyoptinterface/nlexpr.hpp\"\n#include \"pyoptinterface/nleval.hpp\"\n\nusin"
},
{
"path": "include/pyoptinterface/dylib.hpp",
"chars": 2348,
"preview": "#pragma once\n\n#if defined(_MSC_VER)\n#define WIN32_LEAN_AND_MEAN\n#define NOMINMAX\n#include <windows.h>\n#else\n#include <dl"
},
{
"path": "include/pyoptinterface/gurobi_model.hpp",
"chars": 14430,
"preview": "#pragma once\n\n#include <memory>\n\n#include \"solvers/gurobi/gurobi_c.h\"\n\n#include \"pyoptinterface/core.hpp\"\n#include \"pyop"
},
{
"path": "include/pyoptinterface/highs_model.hpp",
"chars": 8913,
"preview": "#pragma once\n\n#include <memory>\n\n#include \"interfaces/highs_c_api.h\"\n#include \"lp_data/HConst.h\"\n\n#include \"pyoptinterfa"
},
{
"path": "include/pyoptinterface/ipopt_model.hpp",
"chars": 8989,
"preview": "#pragma once\n\n#include \"solvers/ipopt/IpStdCInterface.h\"\n#include \"pyoptinterface/nlexpr.hpp\"\n#include \"pyoptinterface/n"
},
{
"path": "include/pyoptinterface/knitro_model.hpp",
"chars": 22356,
"preview": "#pragma once\n\n#include <deque>\n#include <memory>\n#include <optional>\n#include <variant>\n\n#include \"solvers/knitro/knitro"
},
{
"path": "include/pyoptinterface/mosek_model.hpp",
"chars": 10773,
"preview": "#pragma once\n\n#include <memory>\n\n#ifdef _MSC_VER\n#include \"solvers/mosek/mosek_win.h\"\n#else\n#include \"solvers/mosek/mose"
},
{
"path": "include/pyoptinterface/nleval.hpp",
"chars": 9858,
"preview": "#pragma once\n\n#include <cstdint>\n#include <vector>\n\n#include \"pyoptinterface/core.hpp\"\n#include \"pyoptinterface/nlexpr.h"
},
{
"path": "include/pyoptinterface/nlexpr.hpp",
"chars": 4945,
"preview": "#pragma once\n\n#include <cstdint>\n#include <vector>\n\n#include \"ankerl/unordered_dense.h\"\n#include \"core.hpp\"\n\nusing NodeI"
},
{
"path": "include/pyoptinterface/solver_common.hpp",
"chars": 17089,
"preview": "#pragma once\n\n#include <algorithm>\n#include <string>\n#include <concepts>\n#include <tuple>\n#include <numeric>\n#include \"f"
},
{
"path": "include/pyoptinterface/tcc_interface.hpp",
"chars": 1259,
"preview": "#pragma once\n\n#include <memory>\n#include <string>\n\n#include \"tcc/libtcc.h\"\n\n#include \"ankerl/unordered_dense.h\"\n#include"
},
{
"path": "include/pyoptinterface/xpress_model.hpp",
"chars": 30606,
"preview": "#pragma\n\n#include <exception>\n#include <memory>\n#include <variant>\n\n// #include <xprs.h>\n#include \"../thirdparty/solvers"
},
{
"path": "lib/cache_model.cpp",
"chars": 4669,
"preview": "// #include <optional>\n//\n// #include \"pyoptinterface/core.hpp\"\n// #include \"pyoptinterface/container.hpp\"\n//\n// struct "
},
{
"path": "lib/copt_model.cpp",
"chars": 43164,
"preview": "#include \"pyoptinterface/copt_model.hpp\"\n#include \"fmt/core.h\"\n\n#include <stack>\n\nnamespace copt\n{\n#define B DYLIB_DECLA"
},
{
"path": "lib/copt_model_ext.cpp",
"chars": 8547,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/stl/"
},
{
"path": "lib/copt_model_ext_constants.cpp",
"chars": 8790,
"preview": "#include <nanobind/nanobind.h>\n\nnamespace nb = nanobind;\n\nvoid bind_copt_constants(nb::module_ &m)\n{\n\tnb::module_ COPT ="
},
{
"path": "lib/core.cpp",
"chars": 28971,
"preview": "#include \"pyoptinterface/core.hpp\"\n#include <algorithm>\n#include <stdexcept>\n\n#include \"fmt/core.h\"\n\nVariableIndex::Vari"
},
{
"path": "lib/core_ext.cpp",
"chars": 11002,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/operators.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/stl/o"
},
{
"path": "lib/cppad_interface.cpp",
"chars": 16148,
"preview": "#include \"pyoptinterface/cppad_interface.hpp\"\n\n#include \"fmt/core.h\"\n\nstatic const std::string opt_options = \"no_compare"
},
{
"path": "lib/cppad_interface_ext.cpp",
"chars": 6969,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/make_iterator.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/s"
},
{
"path": "lib/gurobi_model.cpp",
"chars": 43788,
"preview": "#include \"pyoptinterface/gurobi_model.hpp\"\n#include \"fmt/core.h\"\n\n#include <stack>\n\nextern \"C\"\n{\n\tint __stdcall GRBloade"
},
{
"path": "lib/gurobi_model_ext.cpp",
"chars": 8534,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/stl/"
},
{
"path": "lib/gurobi_model_ext_constants.cpp",
"chars": 27490,
"preview": "#include <nanobind/nanobind.h>\n\nnamespace nb = nanobind;\n\nvoid bind_gurobi_constants(nb::module_ &m)\n{\n\tnb::module_ GRB "
},
{
"path": "lib/highs_model.cpp",
"chars": 26633,
"preview": "#include \"pyoptinterface/highs_model.hpp\"\n#include \"fmt/core.h\"\n\nnamespace highs\n{\n#define B DYLIB_DECLARE\nAPILIST\n#unde"
},
{
"path": "lib/highs_model_ext.cpp",
"chars": 6924,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/tuple.h>\n#include <nanobind/stl/v"
},
{
"path": "lib/highs_model_ext_constants.cpp",
"chars": 1260,
"preview": "#include <nanobind/nanobind.h>\n#include \"interfaces/highs_c_api.h\"\n\nnamespace nb = nanobind;\n\nvoid bind_highs_constants("
},
{
"path": "lib/ipopt_model.cpp",
"chars": 24264,
"preview": "#include \"pyoptinterface/ipopt_model.hpp\"\n#include \"pyoptinterface/solver_common.hpp\"\n\n#include \"fmt/core.h\"\n#include \"f"
},
{
"path": "lib/ipopt_model_ext.cpp",
"chars": 8995,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/"
},
{
"path": "lib/knitro_model.cpp",
"chars": 29956,
"preview": "#include \"pyoptinterface/knitro_model.hpp\"\n#include \"pyoptinterface/solver_common.hpp\"\n\n#include \"fmt/core.h\"\n#include \""
},
{
"path": "lib/knitro_model_ext.cpp",
"chars": 9888,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/optional.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/st"
},
{
"path": "lib/knitro_model_ext_constants.cpp",
"chars": 22201,
"preview": "#include <nanobind/nanobind.h>\n#include \"pyoptinterface/knitro_model.hpp\"\n\nnamespace nb = nanobind;\n\nvoid bind_knitro_co"
},
{
"path": "lib/main.cpp",
"chars": 2788,
"preview": "#include \"pyoptinterface/nleval.hpp\"\n#include \"pyoptinterface/cppad_interface.hpp\"\n\nvoid test_linear_eval()\n{\n\tLinearEva"
},
{
"path": "lib/mosek_model.cpp",
"chars": 38914,
"preview": "#include \"pyoptinterface/mosek_model.hpp\"\n#include \"fmt/core.h\"\n\nnamespace mosek\n{\n#define B DYLIB_DECLARE\nAPILIST\n#unde"
},
{
"path": "lib/mosek_model_ext.cpp",
"chars": 6726,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/tuple.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/v"
},
{
"path": "lib/mosek_model_ext_constants.cpp",
"chars": 1604,
"preview": "#include <nanobind/nanobind.h>\n#ifdef _MSC_VER\n#include \"solvers/mosek/mosek_win.h\"\n#else\n#include \"solvers/mosek/mosek_"
},
{
"path": "lib/nleval.cpp",
"chars": 28537,
"preview": "#include \"pyoptinterface/nleval.hpp\"\n#include <cassert>\n#include <span>\n\nConstraintAutodiffEvaluator::ConstraintAutodiff"
},
{
"path": "lib/nleval_ext.cpp",
"chars": 1394,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/vector.h>\n\n#include \"pyoptinterface/nleval.hpp\"\n\nnamespace nb = na"
},
{
"path": "lib/nlexpr.cpp",
"chars": 17903,
"preview": "#include \"pyoptinterface/nlexpr.hpp\"\n\n#include <cassert>\n#include <cmath>\n#include \"fmt/core.h\"\n\nbool ExpressionHandle::"
},
{
"path": "lib/nlexpr_ext.cpp",
"chars": 4391,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/vector.h>\n#include <nanobind/stl/tuple.h>\n#include <nanobind/stl/s"
},
{
"path": "lib/tcc_interface.cpp",
"chars": 4266,
"preview": "#include \"pyoptinterface/tcc_interface.hpp\"\n#include <stdexcept>\n#include <math.h>\n#include \"fmt/core.h\"\n\nnamespace tcc\n"
},
{
"path": "lib/tcc_interface_ext.cpp",
"chars": 796,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/string.h>\n\n#include \"pyoptinterface/tcc_interface.hpp\"\n\nnamespace "
},
{
"path": "lib/xpress_model.cpp",
"chars": 73630,
"preview": "#include \"pyoptinterface/xpress_model.hpp\"\n#include \"fmt/core.h\"\n#include \"pyoptinterface/core.hpp\"\n\n#include <concepts>"
},
{
"path": "lib/xpress_model_ext.cpp",
"chars": 15930,
"preview": "#include <nanobind/nanobind.h>\n#include <nanobind/stl/string.h>\n#include <nanobind/stl/pair.h>\n#include <nanobind/stl/tu"
},
{
"path": "lib/xpress_model_ext_constants.cpp",
"chars": 49842,
"preview": "#include <nanobind/nanobind.h>\n\n#include \"pyoptinterface/xpress_model.hpp\"\n\nnamespace nb = nanobind;\nusing namespace xpr"
},
{
"path": "optimizer_version.toml",
"chars": 117,
"preview": "Gurobi = \"13.0.0\"\nCOPT = \"8.0.2\"\nMOSEK = \"10.2.0\"\nHiGHS = \"1.12.0\"\nIPOPT = \"3.13.2\"\nXpress = \"9.8\"\nKNITRO = \"15.1.0\"\n"
},
{
"path": "pyproject.toml",
"chars": 1161,
"preview": "[build-system]\nrequires = [\"scikit-build-core\", \"nanobind\", \"typing_extensions\"]\nbuild-backend = \"scikit_build_core.buil"
},
{
"path": "scripts/generate_attribute_table.py",
"chars": 2000,
"preview": "from typing import IO\nfrom pathlib import Path\n\n\nimport pyoptinterface as poi\nfrom pyoptinterface import gurobi, copt, m"
},
{
"path": "scripts/generate_solver_constants.py",
"chars": 5230,
"preview": "from typing import IO\nfrom pathlib import Path\n\nimport gurobipy as gp\n\nGRB = gp.GRB\n\nimport coptpy as cp\n\nCOPT = cp.COPT"
},
{
"path": "skills/pyoptinterface-expert/SKILL.md",
"chars": 2352,
"preview": "---\nname: pyoptinterface-expert\ndescription: Specialized guidance for modeling mathematical optimization problems using "
},
{
"path": "skills/pyoptinterface-expert/references/api.md",
"chars": 1839,
"preview": "# API Reference\n\n## Model Classes\nImported from solver submodules:\n- `pyoptinterface.highs.Model`\n- `pyoptinterface.guro"
},
{
"path": "skills/pyoptinterface-expert/references/examples.md",
"chars": 1727,
"preview": "# Modeling Examples\n\n## 1. Knapsack Problem (MIP)\nMaximize total value given a weight limit.\n```python\nimport pyoptinter"
},
{
"path": "src/pyoptinterface/__init__.py",
"chars": 1469,
"preview": "from pyoptinterface._src.core_ext import (\n VariableIndex,\n ConstraintIndex,\n ExprBuilder,\n VariableDomain,\n"
},
{
"path": "src/pyoptinterface/_src/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "src/pyoptinterface/_src/aml.py",
"chars": 3158,
"preview": "from .core_ext import ExprBuilder, VariableDomain\nfrom .tupledict import make_tupledict\n\nfrom collections.abc import Col"
},
{
"path": "src/pyoptinterface/_src/attributes.py",
"chars": 3716,
"preview": "from enum import Enum, auto\nfrom .core_ext import VariableDomain, ObjectiveSense\n\n\nclass VariableAttribute(Enum):\n Va"
},
{
"path": "src/pyoptinterface/_src/codegen_c.py",
"chars": 7958,
"preview": "from .cppad_interface_ext import (\n graph_op,\n)\nfrom .cpp_graph_iter import cpp_graph_iterator\n\nfrom typing import IO"
},
{
"path": "src/pyoptinterface/_src/codegen_llvm.py",
"chars": 16914,
"preview": "from .cppad_interface_ext import (\n graph_op,\n)\nfrom .cpp_graph_iter import cpp_graph_iterator\nfrom llvmlite import i"
},
{
"path": "src/pyoptinterface/_src/comparison_constraint.py",
"chars": 190,
"preview": "from dataclasses import dataclass\nfrom typing import Any\n\nfrom .core_ext import ConstraintSense\n\n\n@dataclass\nclass Compa"
},
{
"path": "src/pyoptinterface/_src/constraint_bridge.py",
"chars": 1422,
"preview": "from .core_ext import ScalarQuadraticFunction, ConstraintSense\n\n\ndef bridge_soc_quadratic_constraint(model, cone_variabl"
},
{
"path": "src/pyoptinterface/_src/copt.py",
"chars": 20722,
"preview": "import os\nimport platform\nfrom pathlib import Path\nimport logging\nfrom typing import Dict, Tuple, Union, overload\n\nfrom "
},
{
"path": "src/pyoptinterface/_src/cpp_graph_iter.py",
"chars": 969,
"preview": "from collections import namedtuple\nfrom .cppad_interface_ext import cpp_graph_cursor\n\ncpp_graph_instruction = namedtuple"
},
{
"path": "src/pyoptinterface/_src/dylib.py",
"chars": 288,
"preview": "import platform\n\n\ndef dylib_suffix():\n system = platform.system()\n if system == \"Linux\":\n return \"so\"\n e"
},
{
"path": "src/pyoptinterface/_src/gurobi.py",
"chars": 29915,
"preview": "import os\nimport platform\nfrom pathlib import Path\nimport re\nimport sys\nimport logging\nfrom typing import Tuple, Union, "
},
{
"path": "src/pyoptinterface/_src/highs.py",
"chars": 16556,
"preview": "import logging\nimport os\nimport platform\nfrom pathlib import Path\nfrom typing import Dict, Union, overload\n\nfrom .highs_"
},
{
"path": "src/pyoptinterface/_src/ipopt.py",
"chars": 33023,
"preview": "from io import StringIO\nimport logging\nimport platform\nfrom typing import Optional, List, Dict, Set, Union, Tuple, overl"
},
{
"path": "src/pyoptinterface/_src/jit_c.py",
"chars": 2096,
"preview": "import platform\nimport os\n\nimport tccbox\n\nfrom .tcc_interface_ext import load_library, TCCInstance\n\nsystem = platform.sy"
},
{
"path": "src/pyoptinterface/_src/jit_llvm.py",
"chars": 1012,
"preview": "from llvmlite import ir, binding\n\nfrom typing import List\n\n# Initialize LLVM\ntry:\n # llvmlite older than 0.45.0 still"
},
{
"path": "src/pyoptinterface/_src/knitro.py",
"chars": 16391,
"preview": "import logging\nimport os\nimport platform\nimport re\nfrom pathlib import Path\nfrom typing import Tuple, Union, overload\n\nf"
},
{
"path": "src/pyoptinterface/_src/matrix.py",
"chars": 2653,
"preview": "from .tupledict import tupledict\nfrom .core_ext import ScalarAffineFunction\n\n\ndef iterate_sparse_matrix_rows(A):\n \"\"\""
},
{
"path": "src/pyoptinterface/_src/monkeypatch.py",
"chars": 11836,
"preview": "from .core_ext import (\n VariableIndex,\n ScalarAffineFunction,\n ScalarQuadraticFunction,\n ExprBuilder,\n C"
},
{
"path": "src/pyoptinterface/_src/mosek.py",
"chars": 19714,
"preview": "import os\nimport platform\nfrom pathlib import Path\nimport re\nimport logging\nfrom typing import Optional, Union, overload"
},
{
"path": "src/pyoptinterface/_src/nlfunc.py",
"chars": 6148,
"preview": "from .nlexpr_ext import (\n ExpressionGraph,\n ExpressionHandle,\n UnaryOperator,\n BinaryOperator,\n TernaryO"
},
{
"path": "src/pyoptinterface/_src/solver_common.py",
"chars": 2798,
"preview": "# include some common methods for solver intergaces\n\n\ndef _get_model_attribute(\n model, attribute, get_func_map, valu"
},
{
"path": "src/pyoptinterface/_src/tupledict.py",
"chars": 4258,
"preview": "from typing import Iterable\nfrom itertools import product\n\nWILDCARD = \"*\"\n\n\nclass tupledict(dict):\n def __init__(self"
},
{
"path": "src/pyoptinterface/_src/xpress.py",
"chars": 21163,
"preview": "import os\nimport platform\nfrom pathlib import Path\nimport logging\nfrom typing import Dict, Tuple, Union, overload\n\nfrom "
},
{
"path": "src/pyoptinterface/copt.py",
"chars": 324,
"preview": "from pyoptinterface._src.copt import Model, autoload_library\nfrom pyoptinterface._src.copt_model_ext import (\n EnvCon"
},
{
"path": "src/pyoptinterface/gurobi.py",
"chars": 290,
"preview": "from pyoptinterface._src.gurobi import Model, Env, autoload_library\nfrom pyoptinterface._src.gurobi_model_ext import (\n "
},
{
"path": "src/pyoptinterface/highs.py",
"chars": 234,
"preview": "from pyoptinterface._src.highs import Model, autoload_library\nfrom pyoptinterface._src.highs_model_ext import Enum, load"
},
{
"path": "src/pyoptinterface/ipopt.py",
"chars": 251,
"preview": "from pyoptinterface._src.ipopt import Model\nfrom pyoptinterface._src.ipopt_model_ext import (\n ApplicationReturnStatu"
},
{
"path": "src/pyoptinterface/knitro.py",
"chars": 336,
"preview": "from pyoptinterface._src.knitro import Env, Model, autoload_library\nfrom pyoptinterface._src.knitro_model_ext import (\n "
},
{
"path": "src/pyoptinterface/mosek.py",
"chars": 294,
"preview": "from pyoptinterface._src.mosek import Model, autoload_library\nfrom pyoptinterface._src.mosek_model_ext import (\n Env,"
},
{
"path": "src/pyoptinterface/nl.py",
"chars": 221,
"preview": "from pyoptinterface._src.nlfunc import (\n ExpressionGraphContext as graph,\n to_nlexpr,\n sin,\n cos,\n tan,\n"
},
{
"path": "src/pyoptinterface/xpress.py",
"chars": 404,
"preview": "from pyoptinterface._src.xpress import Model, autoload_library\nfrom pyoptinterface._src.xpress_model_ext import (\n En"
},
{
"path": "tests/conftest.py",
"chars": 2039,
"preview": "import pytest\nimport platform\n\nfrom pyoptinterface import gurobi, xpress, copt, mosek, highs, ipopt, knitro\n\nnlp_model_d"
},
{
"path": "tests/simple_cb.py",
"chars": 2188,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import gurobi, xpress\n\nGRB = gurobi.GRB\nXPRS = xpress.XPRS\n\n\ndef simple"
},
{
"path": "tests/test_basic.py",
"chars": 2911,
"preview": "import pyoptinterface as poi\nimport numpy as np\nfrom pytest import approx\n\nfrom pyoptinterface._src.core_ext import IntM"
},
{
"path": "tests/test_close.py",
"chars": 629,
"preview": "from pyoptinterface import gurobi, xpress, copt, mosek\n\nenvs = []\nmodels = []\nif gurobi.is_library_loaded():\n envs.ap"
},
{
"path": "tests/test_compare_constraint.py",
"chars": 4522,
"preview": "import pyoptinterface as poi\n\nimport pytest\n\n\ndef test_compare_constraint(model_interface):\n model = model_interface\n"
},
{
"path": "tests/test_exp_cone.py",
"chars": 1508,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\nimport pytest\nimport math\n\n\ndef test_exp_cone(model_interface):\n "
},
{
"path": "tests/test_iis.py",
"chars": 1632,
"preview": "import pyoptinterface as poi\nimport pytest\n\n\ndef test_constraint_iis(model_interface):\n model = model_interface\n\n "
},
{
"path": "tests/test_in_constraint.py",
"chars": 1174,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import nl, gurobi\n\nimport pytest\n\n\ndef test_linear_in_constraint(model_"
},
{
"path": "tests/test_ipopt.py",
"chars": 4931,
"preview": "import pytest\nimport pyoptinterface as poi\nfrom pyoptinterface import ipopt, nl\n\npytestmark = pytest.mark.skipif(\n no"
},
{
"path": "tests/test_knitro.py",
"chars": 16674,
"preview": "import pytest\nfrom pytest import approx\n\nfrom pyoptinterface import knitro\nimport pyoptinterface as poi\n\npytestmark = py"
},
{
"path": "tests/test_lukvle10.py",
"chars": 1776,
"preview": "import pytest\n\nimport pyoptinterface as poi\nfrom pyoptinterface import ipopt, nl, copt\n\n\ndef test_nlp_lukvle10(nlp_model"
},
{
"path": "tests/test_matrix_api.py",
"chars": 1158,
"preview": "import pyoptinterface as poi\nimport numpy as np\nfrom scipy.sparse import coo_array\nfrom pytest import approx\n\n\ndef test_"
},
{
"path": "tests/test_nlp.py",
"chars": 5053,
"preview": "import math\nimport pytest\n\nimport pyoptinterface as poi\nfrom pyoptinterface import ipopt, nl\n\n\ndef test_easy_nlp(nlp_mod"
},
{
"path": "tests/test_nlp_bilinear.py",
"chars": 511,
"preview": "import pyoptinterface as poi\n\nimport pytest\n\n\ndef test_bilinear(nlp_model_ctor):\n model = nlp_model_ctor()\n\n x = m"
},
{
"path": "tests/test_nlp_clnlbeam.py",
"chars": 1998,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import nl\n\nimport pytest\n\nimport numpy as np\n\n\ndef test_clnlbeam(nlp_mo"
},
{
"path": "tests/test_nlp_expression.py",
"chars": 1834,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import nl\nimport math\nimport pytest\nfrom pytest import approx\n\n\ndef tes"
},
{
"path": "tests/test_nlp_hs071.py",
"chars": 1332,
"preview": "import pyoptinterface as poi\nfrom pyoptinterface import nl\nimport pytest\n\n\ndef test_hs071(nlp_model_ctor):\n model = n"
},
{
"path": "tests/test_nlp_multiple_run.py",
"chars": 1156,
"preview": "from pyoptinterface import copt, ipopt, knitro, nl\nimport pytest\nimport math\n\n\ndef test_nlp_reopt(nlp_model_ctor):\n m"
},
{
"path": "tests/test_nlp_opf.py",
"chars": 6215,
"preview": "import math\nimport pyoptinterface as poi\nfrom pyoptinterface import nl\n\nimport pytest\n\n\ndef test_acopf(nlp_model_ctor):\n"
},
{
"path": "tests/test_nlp_rocket.py",
"chars": 2103,
"preview": "from pyoptinterface import nl\n\nimport math\nimport pytest\n\n\ndef rocket_model(model, nh: int):\n h_0 = 1.0\n v_0 = 0.0"
},
{
"path": "tests/test_operator.py",
"chars": 5587,
"preview": "from operator import add, sub, mul, truediv\n\nfrom pyoptinterface import (\n VariableIndex,\n ExprBuilder,\n Scalar"
},
{
"path": "tests/test_preopt.py",
"chars": 438,
"preview": "import pyoptinterface as poi\n\n\ndef test_model_attribute_termination_before_solve(model_interface_oneshot):\n \"\"\"Test t"
},
{
"path": "tests/test_qp.py",
"chars": 2371,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\n\nimport numpy as np\n\n\ndef test_simple_qp(model_interface_oneshot)"
},
{
"path": "tests/test_reducedcost.py",
"chars": 885,
"preview": "import pyoptinterface as poi\nimport pytest\nfrom pytest import approx\n\n\ndef test_simple_redcost(model_interface):\n mod"
},
{
"path": "tests/test_simple_opt.py",
"chars": 6747,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\nimport pytest\n\n\ndef test_simple_opt(model_interface):\n model ="
},
{
"path": "tests/test_soc.py",
"chars": 3176,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\nimport pytest\n\n\ndef test_soc(model_interface):\n model = model_"
},
{
"path": "tests/test_sos.py",
"chars": 1346,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\nimport pytest\n\n\n# write a test to test if SOS1 and SOS2 constrain"
},
{
"path": "tests/test_tupledict.py",
"chars": 1908,
"preview": "from pyoptinterface._src.tupledict import (\n flatten_tuple,\n make_tupledict,\n tupledict,\n WILDCARD,\n)\n\n\ndef "
},
{
"path": "tests/test_update.py",
"chars": 1351,
"preview": "import pyoptinterface as poi\nfrom pytest import approx\n\n\ndef test_update(model_interface):\n model = model_interface\n\n"
},
{
"path": "tests/tsp_cb.py",
"chars": 12677,
"preview": "# This file is adapted from the examples/python/tsp.py in Gurobi installation.\n# We use this file to ensure our callback"
},
{
"path": "tests/tsp_xpress.py",
"chars": 15253,
"preview": "# TSP example using numpy functions (for efficiency)\n#\n# (C) Fair Isaac Corp., 1983-2025\n\nfrom typing import List, Tuple"
},
{
"path": "thirdparty/ankerl/stl.h",
"chars": 3977,
"preview": "///////////////////////// ankerl::unordered_dense::{map, set} /////////////////////////\n\n// A fast & densely stored hash"
},
{
"path": "thirdparty/ankerl/unordered_dense.h",
"chars": 88135,
"preview": "///////////////////////// ankerl::unordered_dense::{map, set} /////////////////////////\n\n// A fast & densely stored hash"
},
{
"path": "thirdparty/cppad/CMakeLists.txt",
"chars": 312,
"preview": "cmake_minimum_required(VERSION 3.8...3.26)\n\nproject(CPPAD CXX)\n\nfile(GLOB CPPAD_HEADERS include/cppad/*.hpp)\nset(CPPAD_S"
},
{
"path": "thirdparty/cppad/include/cppad/base_require.hpp",
"chars": 4350,
"preview": "# ifndef CPPAD_BASE_REQUIRE_HPP\n# define CPPAD_BASE_REQUIRE_HPP\n// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later\n"
},
{
"path": "thirdparty/cppad/include/cppad/configure.hpp",
"chars": 8918,
"preview": "# ifndef CPPAD_CONFIGURE_HPP\n# define CPPAD_CONFIGURE_HPP\n// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later\n// SPD"
},
{
"path": "thirdparty/cppad/include/cppad/core/abort_recording.hpp",
"chars": 1348,
"preview": "# ifndef CPPAD_CORE_ABORT_RECORDING_HPP\n# define CPPAD_CORE_ABORT_RECORDING_HPP\n// SPDX-License-Identifier: EPL-2.0 OR G"
}
]
// ... and 631 more files (download for full content)
About this extraction
This page contains the full source code of the metab0t/PyOptInterface GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 831 files (7.4 MB), approximately 2.0M tokens, and a symbol index with 4950 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.