For the legal operations on optimization variables and expressions:
x2 represent optimization
arrays of arbitrary size (usually the same size).
x3 represents a 2-D optimization array.
a is a scalar numeric constant.
M is a constant numeric matrix.
c is an array of the same size as
These operations on optimization variables or expressions return an optimization expression.
Addition of a constant,
Addition of two or more variables,
Subtraction of a constant,
Subtraction of two or more variables,
Multiplication by a constant scalar,
Division by a constant scalar,
Pointwise multiplication by an array,
Pointwise division by an array,
Pointwise multiplication of two optimization variables,
Multiplication of two optimization variables of sizes that make sense for
Pointwise squaring a variable,
Squaring a variable that has the same number of rows as columns,
Multiplication of a 2-D variable by a 2-D matrix,
Dot product of a variable and an array
Linear combination of variables, including
These operations on optimization variables return an optimization variable.
N-D numeric indexing (includes colon and
N-D logical indexing
N-D string indexing
N-D mixed indexing (combination of numeric, logical, colon, end, and string)
Linear numeric indexing (includes colon and
Linear logical indexing
Linear string indexing
Optimization expressions support all the operations that optimization variables
support, and return optimization expressions. Also, you can index into or assign
into an optimization expression using numeric, logical, string, or linear indexing,
including the colon and
end operators for numeric or linear
Constraints are any two comparable expressions that include
one of these comparison operators:
>=. Comparable expressions have the same size, or one of the
expressions must be scalar, meaning of size 1-by-1. For examples, see Expressions for Constraints.
Internally, some functions and operations call only the documented supported
operations. In these cases you can obtain sensible results from the functions or
operations. For example, currently
squeeze internally calls
reshape, which is a documented supported operation. So if you
squeeze an optimization variable then you can obtain a