# NAG CPP Interfacenagcpp::opt::handle_print (e04ry)

Settings help

CPP Name Style:

## 1Purpose

handle_print is a part of the NAG optimization modelling suite. It allows you to print information about the problem, stored as a handle, such as which parts have already been defined or details of the constraints.

## 2Specification

```#include "e04/nagcpp_e04ry.hpp"
#include "e04/nagcpp_class_CommE04RA.hpp"
```
```template <typename COMM>

void function handle_print(COMM &comm, const types::f77_integer nout, const string cmdstr, OptionalE04RY opt)```
```template <typename COMM>

void function handle_print(COMM &comm, const types::f77_integer nout, const string cmdstr)```

## 3Description

handle_print prints information on a problem handle which has been previously correctly initialized (e.g., by handle_​init). Various pieces of information can be retrieved and printed to the given output unit. This can be helpful when the function is interfaced from interactive environments, for debugging purposes or to help familiarize you with the NAG optimization modelling suite.
The printer is guided by a command string which contains one or more of the following keywords:
Overview
Gives a brief overview of the problem handle, particularly, the problem dimension and which parts of the problem have already been set.
Objective
Prints the objective function as it was defined by handle_​set_​linobj, handle_​set_​quadobj, e04rsf (no CPP interface) and e04rtf (no CPP interface) when it is linear or quadratic. Prints the sparsity structure of the objective function as it was defined by handle_​set_​nlnobj when it is nonlinear or nonlinear least squares by handle_​set_​nlnls.
Simple bounds
Prints the variable bounds as defined by handle_​set_​simplebounds. This might help you understand the effect of the optional parameter Infinite Bound Size on the bounds.
Linear constraints bounds
Linear constraints detailed
Prints the bounds or the linear constraint matrix as defined by handle_​set_​linconstr.
Quadratic constraints detailed
Prints all the quadratic constraints including all nonzeros of quadratic, linear and constant terms as defined by e04rsf (no CPP interface) and e04rtf (no CPP interface).
Cone constraints
Cone constraints detailed
Prints all second-order cone constraints as defined by handle_​set_​group. For each cone constraint, its idgroup, dimension and type are printed. If details are requested, the variables composing the cone constraint are also listed.
Matrix constraints
Gives a list of the matrix constraints as defined by e04rnf (no CPP interface) and e04rpf (no CPP interface). For each matrix constraint its idblk, dimension and order (e.g., linear, bilinear) are printed.
Matrix constraints detailed
Prints all the matrix constraints including all nonzeros of all the matrices as formulated by e04rnf (no CPP interface) and e04rpf (no CPP interface).
Nonlinear constraints bounds
Nonlinear constraints detailed
Prints the bounds or sparsity structure of the nonlinear constraints as defined by handle_​set_​nlnconstr.
Multipliers sizes
Prints the expected dimensions of arrays storing the Lagrangian multipliers, such as u and ua of the solver e04svf (no CPP interface) which store the Lagrangian multipliers for standard and matrix constraints, respectively. This might be helpful with Overview and Matrix constraints to check the way the sizes of the arrays are derived.
Options
Options solver
Prints all the current optional parameters. It flags whether the argument is set to its default, whether you have set it or whether it is chosen by the solver (for example, options left on ‘AUTO’ setting after the solver has been called). In addition, you can print optional parameters belonging to a specific solver by adding the solver name after Options, e.g., keywords Options e04mt or Options handle_solve_lp_ipm print options only belonging to the linear programming solver handle_​solve_​lp_​ipm.
Note that the output data might not match your input exactly. The sparse matrices are typically transposed, sorted and explicit zeros removed and in certain cases transformed as needed (for example, matrices ${Q}_{ij}$ and ${Q}_{ji}$ are merged by e04rpf (no CPP interface)).
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

None.

## 5Arguments

1: $\mathbf{comm}$CommE04RA Input/Output
Communication structure. An object of either the derived class CommE04RA or its base class NoneCopyableComm can be supplied. It is recommended that the derived class is used. If the base class is supplied it must first be initialized via a call to opt::handle_init (e04ra).
2: $\mathbf{nout}$types::f77_integer Input
On entry: the Fortran unit number which identifies the file to be written to.
Constraint: ${\mathbf{nout}}\ge 0$.
3: $\mathbf{cmdstr}$string Input
On entry: a command string which contains one or more keywords which identify the piece of information about the handle to be printed. Keywords are case-insensitive and space tolerant. Multiple keywords in cmdstr must be separated by commas or semicolons.
Constraint: cmdstr can only contain one or more of the following accepted keywords: overview, objective, simple bounds, linear constraints bounds, linear constraints detailed, matrix constraints, matrix constraints detailed, nonlinear constraints bounds, nonlinear constraints detailed, multipliers sizes, options.
4: $\mathbf{opt}$OptionalE04RY Input/Output
Optional parameter container, derived from Optional.

## 6Exceptions and Warnings

Errors or warnings detected by the function:
All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of opt.ifail, depending on how errors and warnings are being handled (see Error Handling for more details).
Raises: ErrorException
$\mathbf{errorid}=1$
comm::handle has not been initialized.
$\mathbf{errorid}=1$
comm::handle does not belong to the NAG optimization modelling suite,
has not been initialized properly or is corrupted.
$\mathbf{errorid}=1$
comm::handle has not been initialized properly or is corrupted.
$\mathbf{errorid}=6$
On entry, ${\mathbf{nout}}=⟨\mathit{value}⟩$.
Constraint: ${\mathbf{nout}}\ge 0$.
$\mathbf{errorid}=7$
Keyword number $⟨\mathit{\text{value}}⟩$ is not recognized.
$\mathbf{errorid}=7$
Keyword number $⟨\mathit{\text{value}}⟩$ is not recognized, it is too long.
$\mathbf{errorid}=7$
cmdstr does not contain any keywords or is empty.
$\mathbf{errorid}=199$
An error occurred when writing to output.
$\mathbf{errorid}=10605$
On entry, the communication class $⟨\mathit{\text{value}}⟩$ has not been initialized correctly.
$\mathbf{errorid}=10703$
An exception was thrown during IO (writing).
$\mathbf{errorid}=-99$
An unexpected error has been triggered by this routine.
$\mathbf{errorid}=-399$
Your licence key may have expired or may not have been installed correctly.
$\mathbf{errorid}=-999$
Dynamic memory allocation failed.

Not applicable.

## 8Parallelism and Performance

Please see the description for the underlying computational routine in this section of the FL Interface documentation.

None.

## 10Example

Examples of the use of this method may be found in the examples for: handle_​solve_​ipopt.