Input & Output of OCaml vectors
These functions use the pretty input/output facilities described in
module Polka.
Printing and output functions takes as first paramater a function
of type (int -> string) associating variable names to variable
ranks. By definition, variable index = polka_dec + variable
rank.
- Function: print_constraint : (int -> string) -> Format.formatter -> t -> unit
- Pretty-print on the given formatter the vector considered as
as a constraint.
- Function: print_frame : (int -> string) -> Format.formatter -> t -> unit
- Pretty-print on the given formatter the vector considered as a
generator.
The output has the following meaning:
- V:0 represents the origin vertex;
- V:3x+4y represents the vertex defined by x=3, y=4;
- V:(3x+4y)/2 represents the vertex defined by x=3/2, y=2;
- R:3x+4y represents the ray 3.i_x + 4.i_y;
- L:3x+4y represents the line whose direction is given by
3.i_x + 4.i_y.
- Function: print_expr : (int -> string) -> Format.formatter -> t -> unit
- Pretty-print on the given formatter the vector considered as an affine
expression.
The next functions are input functions: they converts strings to
vectors. They as first paramater a function of type (string ->
int) associating variable ranks to variable names, and as second
parameter the dimension of the returned vector. By definition,
length = polka_dec + dimension.
- Function: of_expr : (string -> int) -> int -> string -> t
- Make a vector from a string parsed as an affine expression.
The syntax of an expression is
(+|-) a_x/b_x x (+|-) ... (+|-) a_y/b_y y
where the a's are numerators, b's are optional
denominators, and x,y,... are variable names. If there is no
name, then the constant coefficient is concerned, and if there is no
numerator, 1 is assumed. An example is x+2y-1/2z-1/3w. There is no
way to reference the special dimension \epsilon (and it is
unnecessary in this case any way).
- Function: of_constraint : (string -> int) -> int -> string -> t
- Make a vector from a string parsed as a constraint.
The syntax of a constraint is <expr> (>|>=|=|<=|<) <expr>.
- Function: of_frame : (string -> int) -> int -> string -> t
- Make a vector from a string parsed respectively as a constraint or as
a generator.
The syntax of a generator is the following one:
- V:0 represents the origin vertex.
- V:(+|-)a_x/b_x x (+|-) ... (+|-) a_y/b_y y represents the
vertex defined by
x=(+|-)a_x/b_x, ..., y=(+/-)a_y/b_y;
- R:(+|-)a_x/b_x x (+|-) ... (+|-) a_y/b_y y represents
the ray
(+|-)a_x/b_x.i_x (+|-) ... (+|-) a_y/b_y.i_y;
- L:(+|-)a_x/b_x x (+|-) ... (+|-) a_y/b_y y represents
the line whose direction is given by
(+|-)a_x/b_x.i_x (+|-) ... (+|-) a_y/b_y.i_y.
Non-zero constants have no sense such expressions. There is
unfortunately no way to specify vertices with non-zero \epsilon
components. However, the meaning of such vertices is difficult to get
!
This document was generated
on October, 27 2006
using texi2html