[BACK]Return to frequency_graph.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Dynlift

Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Dynlift/frequency_graph.ads, Revision 1.1.1.1

1.1       maekawa     1: with Standard_Integer_Vectors;           use Standard_Integer_Vectors;
                      2: with Standard_Integer_VecVecs;           use Standard_Integer_VecVecs;
                      3: with Standard_Integer_Matrices;          use Standard_Integer_Matrices;
                      4: with Lists_of_Integer_Vectors;           use Lists_of_Integer_Vectors;
                      5: with Arrays_of_Integer_Vector_Lists;     use Arrays_of_Integer_Vector_Lists;
                      6:
                      7: package Frequency_Graph is
                      8:
                      9: -- DESCRIPTION :
                     10: --   This package allows to compute the frequency of a vector w.r.t.
                     11: --   a tuple of point sets.
                     12:
                     13: -- CREATORS :
                     14:
                     15:   function Occurrences ( i : natural; l : List ) return natural;
                     16:
                     17:   -- DESCRIPTION :
                     18:   --   Returns the number of times the ith component of vectors in l
                     19:   --   differs from zero.
                     20:
                     21:   function Graph ( n : natural; supports : Array_of_Lists ) return Matrix;
                     22:
                     23:   -- DESCRIPTION :
                     24:   --   Computes the graph wich represents the occurencies of each variable
                     25:   --   in each support.  In particular, if Graph(i,j) = 0, then the ith
                     26:   --   unknown does not occur in the jth support, else the number of
                     27:   --   occurrences in different vectors is given.
                     28:
                     29: -- MODIFIER :
                     30:
                     31:   procedure Ignore ( m : in out Matrix; point : in Vector );
                     32:
                     33:   -- DESCRIPTION :
                     34:   --   For each component i of the point, for which point(i) /= 0,
                     35:   --   the element m(i,j) := 1, for all j in m'range(2).
                     36:   --   This is to ignore the occurrences of the ith unknown and to give
                     37:   --   priority to those unknowns that have not been chosen yet.
                     38:
                     39: -- SELECTORS :
                     40:
                     41:   function Occurrence ( i : natural; m : Matrix ) return natural;
                     42:   function Occurrence ( i : natural; m : Matrix; col : natural; perm : Vector )
                     43:                      return natural;
                     44:
                     45:   -- DESCRIPTION :
                     46:   --   Returns the number of nonzero columns of ith row of m.
                     47:   --   The second function does not consider a number of columns
                     48:   --   equal to col and applies Occurrence to the columns
                     49:   --   perm(j) for j in col+1..m'last(2).
                     50:
                     51:   function Occurrence ( v : Vector; m : Matrix ) return natural;
                     52:   function Occurrence ( v : Vector; m : Matrix; col : natural; perm : Vector )
                     53:                       return natural;
                     54:
                     55:   -- DESCRIPTION :
                     56:   --   Returns the minimal Occurrence(i,m), for all i, for which v(i) /= 0.
                     57:   --   The second function does not consider a number of columns
                     58:   --   equal to col and applies Occurrence to the columns
                     59:   --   perm(j) for j in col+1..m'last(2).
                     60:
                     61:   function Lowest_Occurrence
                     62:                ( vec : VecVec; start : natural; m : Matrix ) return natural;
                     63:   function Lowest_Occurrence
                     64:                ( vec : VecVec; start : natural; m : Matrix;
                     65:                  col : natural; perm : vector  ) return natural;
                     66:
                     67:   -- DESCRIPTION :
                     68:   --   Returns the index of the vector with lowest occurrence in
                     69:   --   vec(start..vec'last).
                     70:   --   The second function does not consider a number of columns
                     71:   --   equal to col and applies Lowest_Occurrence to the columns
                     72:   --   perm(j) for j in col+1..m'last(2).
                     73:
                     74: -- CONSTRUCTORS :
                     75:
                     76:   function  Sort ( l : List; m : Matrix ) return List;
                     77:   procedure Sort ( l : in out List; m : in Matrix );
                     78:
                     79:   -- DESCRIPTION :
                     80:   --   Sorts the points in the list l, so that on return,
                     81:   --   the points are ordered, from low to high occurrence.
                     82:
                     83:   function  Sort ( l : List; m : Matrix;
                     84:                    col : natural; perm : vector ) return List;
                     85:   procedure Sort ( l : in out List; m : in Matrix;
                     86:                    col : in natural; perm : in vector );
                     87:
                     88:   -- DESCRIPTION :
                     89:   --   Sorts the points in the list l, so that on return,
                     90:   --   the points are ordered, from low to high occurrence.
                     91:   --   Only the columns perm(j), for j in col+1..m'last(2) will be
                     92:   --   considered when computing the occurrences.
                     93:
                     94: end Frequency_Graph;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>