naginterfaces.library.opt.handle_init¶
- naginterfaces.library.opt.handle_init(nvar)[source]¶
handle_init
initializes a data structure for the NAG optimization modelling suite for problems such as, Linear Programming (LP), Quadratic Programming (QP), Nonlinear Programming (NLP), Least Squares (LSQ) problems, Second-order Cone Programming (SOCP), linear Semidefinite Programming (SDP) and Semidefinite Programming with Bilinear Matrix Inequalities (BMI-SDP).For full information please refer to the NAG Library document for e04ra
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/e04/e04raf.html
- Parameters
- nvarint
, the initial number of decision variables defining the problem.
- Returns
- handleHandle
Holds a handle to the internal data structure where an empty problem with variables is defined.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- Notes
handle_init
initializes an empty problem, adds decision variables, , and returns a handle to the data structure. Note that further variables may be added to the problem later byhandle_add_vars()
and it is also possible to temporarily disable and enable individual variables in the model byhandle_disable()
andhandle_enable()
, respectively. This handle may then be passed to some of the functions of the suite to formulate the problem (define or edit the variables, the objective function and constraints). Once the problem is fully defined, the handle may be passed to a suitable solver from the suite (handle_solve_dfls()
,handle_solve_dfls_rcomm()
,handle_solve_bxnl()
,handle_solve_nldf()
,handle_solve_dfno()
,handle_solve_dfno_rcomm()
,handle_solve_bounds_foas()
,handle_solve_lp_ipm()
,handle_solve_socp_ipm()
,handle_solve_ssqp()
,handle_solve_ipopt()
,handle_solve_pennon()
ormip.handle_solve_milp
). Afterwards, the problem may be further modified or passed to another solver of the suite. The handle must not be changed between calls to the functions of the suite. When the handle is no longer needed,handle_free()
must be called to destroy it and deallocate all the allocated memory and data within. See the E04 Introduction for more details about the NAG optimization modelling suite.
See also
naginterfaces.library.examples.glopt.handle_solve_mcs_ex.main()
naginterfaces.library.examples.mip.handle_solve_milp_ex.main()
naginterfaces.library.examples.mip.handle_solve_minlp_ex.main()
naginterfaces.library.examples.opt.handle_add_vars_ex.main()
naginterfaces.library.examples.opt.handle_disable_ex.main()
naginterfaces.library.examples.opt.handle_solve_bounds_foas_ex.main()
naginterfaces.library.examples.opt.handle_solve_dfls_ex.main()
naginterfaces.library.examples.opt.handle_solve_dfno_ex.main()
naginterfaces.library.examples.opt.handle_solve_ipopt_ex.main()
naginterfaces.library.examples.opt.handle_solve_lp_ipm_ex.main()
(and others)