Map upper triangular matrix on vector skipping the diagonal
问题 I have a problem that could be boiled down to finding a way of mapping a triangular matrix to a vector skipping the diagonal. Basically I need to translate this C++ code using the Gecode libraries // implied constraints for (int k=0, i=0; i<n-1; i++) for (int j=i+1; j<n; j++, k++) rel(*this, d[k], IRT_GQ, (j-i)*(j-i+1)/2); Into this MiniZinc (functional) code constraint forall ( i in 1..m-1 , j in i+1..m ) ( (differences[?]) >= (floor(int2float(( j-i )*( j-i+1 )) / int2float(2)) )); And I