CPXXsetlongannotations and CPXsetlongannotations
The routine
CPXXsetlongannotations/CPXsetlongannotations
sets the annotation values for a set of modeling objects in the CPLEX problem object.
int CPXXsetlongannotations( CPXCENVptr env, CPXLPptr lp, CPXDIM idx, int objtype, CPXDIM cnt, CPXDIM const * indices, CPXLONG const * values )
int CPXsetlongannotations( CPXCENVptr env, CPXLPptr lp, int idx, int objtype, int cnt, int const * indices, long const * values )
Description
The routine
CPXXsetlongannotations/CPXsetlongannotations
sets the annotation values for a set of modeling objects in the CPLEX problem object.
For an example of this routine in use, see benders.c
distributed with the product.
For more routines supporting annotations, see Annotating Models in the CPLEX Callable Library (C API) in the reference manual of the CPLEX Callable Library (C API).
Arguments
- env
-
A pointer to the CPLEX environment as returned by
CPXXopenCPLEX/CPXopenCPLEX. - lp
-
A pointer to a CPLEX problem object as returned by
CPXXcreateprob/CPXcreateprob. - idx
- An integer that specifies the index of the annotation for which to assign values. To access this integer, call CPXXgetlongannotationindex or CPXgetlongannotationindex
- objtype
-
An integer that specifies the type of the modeling objects listed by
the integers provided in the argument indices.
The table documents the types of modeling objects currently supported in CPLEX.
Variables (that is, columns) are the only type of annotated modeling object
pertinent to a Benders decomposition.
Table 1. Symbolic names and identifiers for annotation object types Symbol Value Meaning CPX_ANNOTATIONOBJ_OBJ 0 objective CPX_ANNOTATIONOBJ_COL 1 column or variable CPX_ANNOTATIONOBJ_ROW 2 row or constraint CPX_ANNOTATIONOBJ_SOS 3 special ordered set (SOS) CPX_ANNOTATIONOBJ_IND 4 indicator constraint CPX_ANNOTATIONOBJ_QC 5 quadratic constraint - cnt
- An integer that specifies the total number of annotations to set.
- indices
-
An array of length
cntcontaining the numeric indices of the modeling primitives of the given type for which to set the annotation values. - values
-
An array of length
cntcontaining the new annotation values for the modeling primitives of the givenobjtypeinindices.
Return
The routine returns 0 (zero) if successful and nonzero if an error occurs.Example
status = CPXsetlongannotations (env, lp, anno_idx, CPX_ANNOTATIONOBJ_COL, cnt, indices, values);