0
votes

How do you create an array of (variable)matrices A1,..,AN of semi definite matrices in Julia Jump where N is a parameter? @variable(model,x[1:N]) won't work because this is an array of variables, not of matrix variables. Thanks in advance.

1

1 Answers

1
votes

It's best to use the anonymous variable syntax here.

@variable(m, [1:N,1:N], SDP)

returns one matrix N x N of variables which is symmetric and PSD constrained. If you want a collection of K of them, just make one:

A = [@variable(m, [1:N, 1:N], SDP) for k in 1:K]