Parameter specificationParameters are placeholders for problem data, and may be used in the objective and constraints. Parameter values are not given until the generated solver is called. Parameters are specified by a name, dimension and optional attributes. Dimensions can use symbolic values from dimensions blocks. CVXGEN supports scalar, vector and matrix parameters, as well as indexed parameters. Some examples (assuming m and n were specified in a dimensions block): parameters
A (m,n) b (m) c (2*m) Q (n,n) symmetric psd a nonnegative end Notes
Sparse parametersCVXGEN supports sparse parameters; that is, parameters with only certain specific entries non-zero. To specify a sparse matrix , for example, use the syntax parameters
A (3,5) {1,1 2,2 3,3 3,4 3,5 2,5 1,5} end Here, is a matrix, with nonzero entries . With the C interface, these will be stored in the order declared, so params.A[0] will be the entry, and params.A[6] will be the entry. If you are using the Matlab interface, pass in a dense matrix. Only the indicated entries will be used, and all other entries will be ignored, even if nonzero. Treat symmetric matrices in an identical way: declare diagonals once, and declare and set non-zero off-diagonals for both the and entries. |