cov_prim.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
class COV_PRIM
class COV_PRIM is
--1998/05
--LongInt version
--
--1996/10
--LINUX version
--
--1992/6/28
--split from cover.mod
--
--primitives for covering space and covering linkage.
--prints
--relation in coverings
--relation matrix
--
-- 1989 Cover K.Kodam
---------- print routines -----------
LonPrint(compo:INT, Mer:INT, Lon:WORD) is
s:STR;
s:="meridian: "+WORD::gstr(Mer,0)+"\n"+" -"+"->";
REP::stack.Fetch(REP::merPtr+compo);
s:=s+REP::stack.get_str+"\n";
#LOGOUT+s; s:="longitude: "+Lon.wstr+"\n"+" -"+"->";
REP::stack.Fetch(REP::longPtr+compo);
s:=s+REP::stack.get_str+"\n";
#LOGOUT+s;
end;
OrbitPrintLog(compo:INT, NOrbit:INT) is
oFlg:BOOL;
s:STR;
s:="\n"+"Covering link: "+NOrbit.str+" component";
if NOrbit>1 then s:=s+"s"; end;
loop o::=1.upto!(REP::stack.st[REP::orbitpPtr+compo][0]);
s:=s+"\n"+"br. index: "+REP::stack.st[REP::orbitmPtr+compo][o].str
+"/ orbit of peripheral: ";
oFlg:=false;
loop j::=1.upto!(REP::stack.Jn) ;
if REP::stack.st[REP::orbitpPtr+compo][j]=o then
if oFlg then s:=s+","; end;
s:=s+j.str;
oFlg:=true;
end;
end;
end;
#LOGOUT+s;
end;
--------------Branch index---------------------
SetLongitude(TCode:TCODE, compo:INT, out Mer:INT, out Lon:WORD) is
-- set mer & Lon[*]
-- set
-- st[longPtr+compo]:longitude.
-- st[merPtr+compo]]:meridian.
-- Lon[*]: word of longitude
stp:INT:=TCode.compoStart(compo); enp:INT:=TCode.endOfString(stp,1);
Mer:=TCode[stp].gen;
l:INT:=0;
copt:INT;
Lon:=#;
loop i::=stp.upto!(enp);
if VERTEXC::under.in(TCode[i].sep) then
copt:=TCode[i].companion;
if VERTEXC::positive.in(TCode[i].sep) then
Lon.append(TCode[copt].gen);
if TCode[copt].compo=compo then l:=l+1; end;
else Lon.append(-TCode[copt].gen);
if TCode[copt].compo=compo then l:=l-1; end;
end;
end;
end;
if Lon.size>0 then
s:INT;
if l>0 then s:=-TCode[enp].gen; else s:=TCode[enp].gen; end;
loop l.abs.times!; Lon.append(s); end;
else Lon.w:=#(|Mer, -Mer|);
end;
REP::stack.CMul(Lon.w); REP::stack.Store(REP::longPtr+compo);
REP::stack.Fetch(Mer); REP::stack.Store(REP::merPtr+compo);
end;
SetBranchIndex(compo:INT) is
o,bi,p:INT;
REP::stack.st[REP::orbitmPtr+compo].to_val(0);
REP::stack.Fetch(REP::merPtr+compo);
REP::stack.Store(REP::Work);
loop i:INT:=1.upto!(REP::stack.Jn);
p:=i;
loop bi:=1.up!; p:=REP::stack.st[REP::Work][p]; until!(i=p); end;
o:=REP::stack.st[REP::orbitpPtr+compo][i];
REP::stack.st[REP::orbitmPtr+compo][o]:=bi;
end;
end;
SetWindLong(compo:INT) is
--Set st[windLon+compo] winding of the covering longitude
i,i0,wind:INT;
loop cvComp::=1.upto!(REP::stack.st[REP::orbitpPtr+compo][0]);
REP::stack.st[REP::Work].to_val(0);
loop
i0:=1.up!;
while!(REP::stack.st[REP::orbitpPtr+compo][i0]/=cvComp);
end;
i:=i0;
loop REP::stack.st[REP::Work][i]:=1;
i:=REP::stack.st[REP::longPtr+compo][i]; until!(i=i0);
end;
wind:=0;
loop
if REP::stack.st[REP::Work][i]=1 then wind:=wind+1; end;
i:=REP::stack.st[REP::merPtr+compo][i];
until!(i=i0);
end;
REP::stack.st[REP::windLon+compo][cvComp]:=wind;
#OUT+"wind: "+wind.str+"\n";
end;
end;
SetOrbits(compo:INT, out NOrbit:INT) is
-- st[orbitpPtr+compo]: orbit table of meridian.
-- NOrbit: number of Orbit=covering link.
-- st[orbitmPtr+compo]: table of Branch index.
-- orbits of meridian & longitude in S(Jn).
REP::stack.Fetch(REP::merPtr+compo);
REP::stack.Fetch(REP::longPtr+compo);
REP::stack.OrbitC(2);
REP::stack.Store(REP::orbitpPtr+compo);
NOrbit:=REP::stack.st[REP::orbitpPtr+compo][0];
SetBranchIndex(compo);
end;
rm1(el:INT) is
REP::stack.Fetch(el); REP::stack.Mul;
REP::stack.Store(REP::Work); REP::stack.Pu;
end;
Relation(word:WORD, base:INT, rm2:ROUT{INT,INT}) is
-- relation in covering sp.
z:INT:=REP::Work;
REP::stack.Unit; REP::stack.Store(z); REP::stack.Pu;
-- word.printD;
loop el::=word.w.elt!;
if el>0 then rm2.call(el,REP::stack.st[z][base]);
--#OUT+WORD::gstr(el,REP::stack.st[z][base])+" ";
rm1(el);
else rm1(el); rm2.call(el,REP::stack.st[z][base]);
--#OUT+WORD::gstr(el,REP::stack.st[z][base])+" ";
end;
end;
-- #OUT+"\n";
REP::stack.Pd;
end;
end;