I'm getting stuck in defining constraints and the optimization function in matrix form for proc optmodel.
Suppose these scenarios:
1) I have two vectors A and B, and my constraint is A<=B (meaning: element-wise). How can I write it without a for loop to cycle the on the elements?
2) I have two matrices A and B, and my constraint is A[:, k]' * B[: ,k] <= 0 for each k in 1..n (meaning: for each k in 1..n, take the k-th column of matrix A, transpose it, take the k-th column of matrix B, and do the scalar product between the two vectors; this number must be <=0). How can I write it with only one for loop to cycle over k?
These conditions are very easy to write e.g. in Matlab, but I find very difficult to write them in the proc optmodel.
How would you do that?
Any help appreciated,
Thanks