14.2.29 Class Param¶
- mosek.fusion.Param¶
The class defines a set of static methods for manipulating parameters.
- Static members
Param.Hstack – Stack a list of parameters horizontally (i.e. along the second dimension).
Param.Repeat – Repeat a parameter a number of times in the given dimension.
Param.Stack – Stack a list of parameters in an arbitrary dimension.
Param.Vstack – Stack a list of parameters vertically (i.e. along the first dimension).
- Param.Hstack¶
Parameter Param.Hstack(Parameter[] p) Parameter Param.Hstack(Parameter p1, Parameter p2) Parameter Param.Hstack(Parameter p1, Parameter p2, Parameter p3)
Stack a list of parameters horizontally (i.e. along the second dimension). The parameters must have the same shape, except for the second dimension.
For example, if \(p^1,p^2,p^3\) are three parameters of shape
(n,1)
then their horizontal stack is the two-dimensional parameter\[\begin{split}\left[ \begin{array}{ccc} | & | & | \\ p^1 & p^2 & p^3 \\ | & | & | \end{array}\right]\end{split}\]of shape
(n,3)
.
- Param.Repeat¶
Parameter Param.Repeat(Parameter p, int n, int dim)
Repeat a parameter a number of times in the given dimension. This is equivalent to stacking
n
copies of the parameter in dimensiondim
; seeParam.Stack
.
- Param.Stack¶
Parameter Param.Stack(Parameter[][] p) Parameter Param.Stack(int dim, Parameter[] p) Parameter Param.Stack(int dim, Parameter p1, Parameter p2) Parameter Param.Stack(int dim, Parameter p1, Parameter p2, Parameter p3)
Stack a list of parameters along an arbitrary dimension. All parameters must have the same shape, except for dimension
dim
.For example, suppose \(P,Q\) are two \(n\times m\) parameters. Then stacking them in the first dimension produces a parameter of shape
(2n,m)
:\[\begin{split}\left[\begin{array}{c}P\\ Q\end{array}\right],\end{split}\]stacking them in the second dimension produces a parameter of shape
(n,2m)
:\[\left[\begin{array}{cc}P & Q\end{array}\right],\]and stacking them in the third dimension produces a three-dimensional parameter of shape
(n,m,2)
.The version which takes a two-dimensional array of parameters constructs a block matrix parameter with the given parameters as blocks. The dimensions of the blocks must be suitably compatible.
- Param.Vstack¶
Parameter Param.Vstack(Parameter[] p) Parameter Param.Vstack(Parameter p1, Parameter p2) Parameter Param.Vstack(Parameter p1, Parameter p2, Parameter p3)
Stack a list of parameters vertically (i.e. along the first dimension). The parameters must have the same shape, except for the first dimension.
For example, if \(p^1,p^2,p^3\) are three parameters of shape
(1,n)
then their vertical stack is the two-dimensional parameter\[\begin{split}\left[ \begin{array}{c}- p^1 - \\ - p^2 - \\ - p^3 - \end{array}\right]\end{split}\]of shape
(3,n)
.