Am 24.01.11 07:47, schrieb tvn: > hi, just wondering if the Fourier-Motzkin algorithm for eliminating > variable from a system of linear inequalities is implemented somewhere in > Sage ? > Hi,
it shouldn't be too hard to implement Fourier-Motzkin elemimination yourself. Here is the definition of a function with projects the Polyhedron P: (A*x<=b) along the vector c. The Fouier-Motzkin elimination is just the special case with c = e_j (the unit vector with Komponent j = 1). Greetings, Philipp def proj_Poly(P,c): A,b = P m = A.nrows(); M = range(0,m) n = A.ncols() N = [i for i in M if A[i,:]*c < 0] Z = [i for i in M if A[i,:]*c == 0] P = [i for i in M if A[i,:]*c > 0] p = Z + [(i,j) for i in N for j in P] r = len(p) D = Matrix(r,n); d = Matrix(r,1) for i in range(0,r): if not isinstance(p[i],tuple): D[i,:] = A[p[i],:] d[i] = b[p[i]] else: (s,t) = p[i] D[i,:] = (A[t,:]*c)*A[s,:] - (A[s,:]*c)*A[t,:] d[i] = (A[t,:]*c)*b[s] - (A[s,:]*c)*b[t] return (D,d) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org