getmpname
getmpname |
Purpose
Synopsis
const char *getmpname(XPRMcontext ctx, int type, int ind);
Arguments
ctx
|
Mosel's execution context
|
||||||
type
|
|
||||||
ind
|
Return value
The entity name or
NULL if names are not available or the entity does not belong to the matrix.
Example
/* Display all names */ void disprsnames(XPRMcontext ctx) { int ndx,ncol,nsos,nrow; if(mmx->getmatsolv(ctx, NULL, NULL)<3) { /* only if a problem exists */ mmx->genmpnames(ctx, XPRM_KEEPOBJ, NULL, 0); mmx->getmatsize(ctx, NULL, &nrow, &nsos, NULL); for(ndx=0;ndx<ncol;ndx++) mm->printf(ctx, "%s\n", mmx->getmpname(ctx, XPRM_MPNAM_COL, ndx)); for(ndx=0;ndx<nrow;ndx++) mm->printf(ctx, "%s\n", mmx->getmpname(ctx, XPRM_MPNAM_ROW, ndx)); for(ndx=0;ndx<nsos;ndx++) mm->printf(ctx, "%s\n", mmx->getmpname(ctx, XPRM_MPNAM_SOS, ndx)); } }
Further information
This function is used to access the row, column and SOS names generated by the function
genmpnames. Index numbers start with 0 but the numbering returned by
getctrnum for SOS (-2, -3...) is also accepted.
Related topics