[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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:

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:

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 !


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October, 27 2006 using texi2html