[BACK]Return to curves_into_grassmannian_io.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Schubert

File: [local] / OpenXM_contrib / PHC / Ada / Schubert / curves_into_grassmannian_io.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:33 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Characters_and_Numbers;             use Characters_and_Numbers;
with Symbol_Table;                       use Symbol_Table;
with Brackets;                           use Brackets;
with Curves_into_Grassmannian;           use Curves_into_Grassmannian;

package body Curves_into_Grassmannian_io is

  procedure Set_up_Symbol_Table
              ( m,p,q : in natural; top,bottom : in Bracket;
                addmix : in natural ) is

    n : constant natural := Number_of_Variables(top,bottom) + 2 + addmix;
    rws : constant natural := (m+p)*(q+1);
    row,deg : natural;
    sb : Symbol;

  begin
    if not Symbol_Table.Empty
     then Symbol_Table.Clear;
    end if;
    Symbol_Table.Init(n);             -- initialization with #variables
    sb := (sb'range => ' ');
    sb(1) := 'x';
    sb(4) := 's';
    for j in 1..p loop                -- adding the rest columnwise
      row := 0; deg := 0;
      for i in 1..rws loop
        row := row + 1;
        if i >= top(j) and i <= bottom(j)
         then sb(2) := Convert_Hexadecimal(row);
              sb(3) := Convert_Hexadecimal(j);
              sb(5) := Convert_Hexadecimal(deg);
              Symbol_Table.Add(sb);
        end if;
        if i mod (m+p) = 0
         then row := 0; deg := deg+1;
        end if;
      end loop;
    end loop;
    sb := (sb'range => ' ');
    sb(1) := 's';
    if addmix = 0
     then Symbol_Table.Add(sb);       -- adding "s"
     else sb(2) := '1';
          Symbol_Table.Add(sb);       -- adding "s1"
          sb(2) := '2';
          Symbol_Table.Add(sb);       -- adding "s2"
          sb(2) := ' ';
    end if;
    sb(1) := 't';
    Symbol_Table.Add(sb);             -- adding "t"
  end Set_up_Symbol_Table;

  procedure One_Set_up_Symbol_Table
              ( m,p,q : in natural; top,bottom : in Bracket ) is
  begin
    Set_up_Symbol_Table(m,p,q,top,bottom,0);
  end One_Set_up_Symbol_Table;

  procedure Two_Set_up_Symbol_Table
              ( m,p,q : in natural; top,bottom : in Bracket ) is
  begin
    Set_up_Symbol_Table(m,p,q,top,bottom,1);
  end Two_Set_up_Symbol_Table;

  procedure Reduce_Symbols ( top,bottom : in Bracket; locmap : in Matrix ) is

    ind : natural := 0;

  begin
    for j in locmap'range(2) loop
      for i in top(j)..bottom(j) loop
        ind := ind+1;
        if locmap(i,j) = 1
         then Symbol_Table.Remove(ind-j+1);
        end if;
      end loop;
    end loop;
  end Reduce_Symbols;

end Curves_into_Grassmannian_io;