CVXGEN: Code Generation for Convex Optimization

Dimension specification

Dimensions may be used anywhere in the problem specification in place of integers. This removes ‘magic numbers’ from the dimensions of variables and parameters (for example), and makes it easy to adjust the size of a problem.

Some examples:

dimensions
  m = 5
  n = 20  # number of assets.
  T_horizon = 12
end

The left-hand side must consist only of numbers, letters and underscore, and must start with a letter or an underscore. The right-hand side must be an integer.

Dimensions can be used anywhere else in the problem specification.