[back] [prev] [next] [index] [root]

 


SimplexReInit

Reinitializes a given simplex. May be used to set delta.

Syntax:

SimplexReInit(s [, delta ]);

simplex
  s  
real
  delta  

See also:  SimplexNext, SimplexElt, SimplexInit

Description:

Restarts the enumeration of the integral points of the given simplex. In addition you may give a ( delta) that is used as a scaling factor on the bounds of the enumeration environment. It is intended to be used to correct round-off errors for border points.


Example:

Find all x,y in {\Bbb Z}^2|{ >= 0} subject to x+y <= 2:

kash> A := Mat(R, [[1,1],[-1, 0],[0,-1]]);;
kash> b := MatTrans(Mat(R, [[2, 0, 0]]));;
kash> s := SimplexInit(A, b);;
kash> while SimplexNext(s) do Print(SimplexElt(s), "\n"); od;
> [ 0, 0 ]
[ 1, 0 ]
[ 2, 0 ]
[ 0, 1 ]
[ 1, 1 ]
[ 0, 2 ]


<- back[back] [prev] [next] [index] [root]