14.2.28 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).

Parameters:
Return:

(Parameter)

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 dimension dim; see Param.Stack.

Parameters:
  • p (Parameter) – The parameter to repeat.

  • n (int) – Number of times to repeat. Must be strictly positive.

  • dim (int) – The dimension in which to repeat. Must define a valid dimension index.

Return:

(Parameter)

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.

Parameters:
  • p (Parameter[][]) – Parameters to stack.

  • p (Parameter[]) – Parameters to stack.

  • dim (int) – The dimension in which to stack.

  • p1 (Parameter) – First parameter to stack.

  • p2 (Parameter) – Second parameter to stack.

  • p3 (Parameter) – Third parameter to stack.

Return:

(Parameter)

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).

Parameters:
Return:

(Parameter)