Note that this is a question about convex polyhedra since it involves 
inequalities! You can't solve it with linear algebra alone. A simple way is 
to intersect your null space with the positive orthant, which gives you a 
cone in your null space whose elements have all positive entries:

sage: kernel = Polyhedron(lines=[
....:   [ 1,  0,  1,  0, -1,  0,  0],
....:   [ 0,  1,  1,  0,  0,  0,  0],
....:   [ 0,  0,  0,  1,  1,  0,  0],
....:   [ 0,  0,  0,  0,  0,  1,  1]])
sage: positive = Polyhedron(rays=identity_matrix(7).columns())
sage: pos_ker = kernel.intersection(positive)
sage: pos_ker
A 4-dimensional polyhedron in ZZ^7 defined as the convex hull of 1 vertex 
and 4 rays
sage: pos_ker.rays()
(A ray in the direction (0, 0, 0, 0, 0, 1, 1), A ray in the direction (0, 
0, 0, 1, 1, 0, 0), A ray in the direction (0, 1, 1, 0, 0, 0, 0), A ray in 
the direction (1, 0, 1, 1, 0, 0, 0))




On Tuesday, April 24, 2012 9:36:04 AM UTC-4, Doaa El-Sakout wrote:
>
> Hi
>
> I am using right_kernel to find a kernel, for example the result is
> [ 1  0  1  0 -1  0  0]
> [ 0  1  1  0  0  0  0]
> [ 0  0  0  1  1  0  0]
> [ 0  0  0  0  0  1  1]
>
> How can I (for an arbitrary kernel) get positive entries only,
> by making a linear combination of rows?
>
> Regards,
> Doaa
>
>

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to