title: CVXPY constraint on 2d array with 3 elements referenced simultaneously
body: <p>I have a matrix <code>S</code> of size VxV. I want to impose several contraints on it of the form: <a href="https://i.stack.imgur.com/jAsXQ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jAsXQ.gif" alt="Constraint"></a>. I have attempted to do so, but this code runs into the issue <code>ValueError: Atoms must be at most 2D.</code></p>
  
  <p>I put together a simplified example of my problem:</p>
  
  <pre><code>def ILP_example(scores):
      V = scores.shape[0]
      u, v, w = np.meshgrid(range(V), range(V), range(V))
  
      arr = cp.Variable(scores.shape)
  
      objective = cp.Maximize(
          cp.sum(cp.multiply(scores, arr))
      )
      constraints = [
          arr[u, v]           + arr[v, w]          - arr[u, w]          &lt;= 1,
        ]
      prob = cp.Problem(objective, constraints)
      prob.solve()
      return
  </code></pre>
  
  <p>Attempting to run this, for example with <code>ILP_example(np.random.rand(5, 5))</code> results in the error <code>ValueError: Atoms must be at most 2D.</code> How do I fix this?</p>