for i \in \{1, 2, \ldots ,n\}. This is very easy to construct in JuMP. However, to create a robust formulation for this problem it is beneficial for me to concatenate all the y_{i,j} in one variable x \equiv \{y_{i,j}\}_{i\in [1:n], j \in [1:n] }, and also write down the constraint \texttt{con}[i] in the form
where \sum_{j \in [1:n]} y_{j,i} = \langle v_i^{\textrm{in}} ; x \rangle, and \sum_{j \in [1:n]} y_{i,j} = \langle v_i^{\textrm{out}} ; x\rangle. I was wondering in JuMP if we can (i) create a concatenated decision variable x \equiv \{y_{i,j}\}_{i\in [1:n], j \in [1:n] }, and (ii) extract the vectors v_i^{\textrm{in}}, v_i^{\textrm{out}} if we create the constraints \texttt{con}[i] for i\in [1:n] in JuMP. Any help will be much appreciated!
If you use constraint_object(con[I]).func you can get the AffExpr of the constraint. That contains the coefficients. But it isn’t a vector. You’d need to write that conversion yourself.
Thanks for your response @odow ! What I meant is that if we concatenate all the variables into one in x \triangleq \{y_{i,j}\}_{i,\in [1:n]j\in[1:n]}, then all the constraints of the form
for some matrix A \in \mathbb{R}^{n^2 \times n}. My question was is there a way to get the matrix A if I create the JuMP model using the constraints in the first form and is there a way to creat x \triangleq \{y_{i,j}\}_{i,\in [1:n]j\in[1:n]} programmatically in JuMP.