ContentsIndexHome
PreviousUpNext
IAimmsMathProgramInfo::GetQmatrixData Method

Get quadratic objective coefficients.

virtual _LONG_T GetQmatrixData(
    _LONG_T is_update, 
    _LONG_T max_no, 
    _LONG_T col_no1[], 
    _LONG_T col_no2[], 
    double val[]
) = 0;
Parameters 
Description 
_LONG_T is_update 
An integer indicator for full (value 0) or update (value 1) retrieval. 
_LONG_T max_no 
The maximum number of non-zero matrix elements to retrieve. If this value is smaller than the total number of non-zero elements, the method must be called repeatedly. 
_LONG_T col_no1[] 
Array with the first column numbers of the quadratic matrix elements. Length must be at least max_no. If this argument is set to NULL then only the nonzero diagonal elements are retrieved via the corresponding column numbers. 
_LONG_T col_no2[] 
Array with the second column numbers of the quadratic matrix elements. Length must be at least max_no. If this argument is set to NULL then only the non-zero diagonal elements are retrieved via the corresponding row numbers. 
double val[] 
Array with the values of the quadratic matrix coefficients. Length must be at least max_no

The GetQmatrixData method returns the actual number of matrix elements retrieved.

The GetQmatrixData method only applies to Quadratic Programming models and is used to retrieve the non-zero quadratic matrix elements from AIMMS. The generated quadratic matrix is based on the following objective function:

   cTx + 0.5 xTQx

where c is the vector of objective coefficients and x the column vector. In case of an update retrieval, only updates for the right upper triangle are passed to the solver. The user has to generate the updates for the left lower triangle himself (if needed).

  1. This method should only be used if the capability flag SolverCapability::CAPAB_QP_NOT_SPEC is not set in the GetInitialInfo method. If that flag is set then the GetMatrixData method should be used to retrieve the quadratic matrix. Typically, GetQmatrixData is used by LP solvers that can handle QP models, and it is not used by NLP solvers.
  2. Mixing of update and full retrievals in one solve is not allowed.
  3. The number of non-zero elements in the quadratic matrix for the columns can be retrieved by using the GetColumnData method.
  4. One of the arguments row_no or col_no may be set to NULL but not both.

Copyright © 1993–2016 by AIMMS B.V. All rights reserved.