#
# rho(R)    computes half the sum of the positive roots of R.
# co_rho(R) computes half the sum of the positive co-roots.
#
`weyl/rho`:=proc(R) local Rho,S,i,c,eq;
  S:=coxeter['base'](R);
  Rho:=[seq(c[i]*S[i],i=1..nops(S))];
  Rho:=collect(2*convert(Rho,`+`),indets(S));
  eq:={seq(coxeter['iprod'](i,Rho-i)=0,i=S)};
  subs(`coxeter/linsolve`(eq,indets(eq)),Rho/2)
end:
#
`weyl/co_rho`:=proc() coxeter['interior_pt'](args) end:
#
save `weyl/rho`, `weyl/co_rho`, cat(HomeLib,`/weyl/rho.m`);
read cat(HomeLib,`/help/weyl/rho`);
read cat(HomeLib,`/help/weyl/co_rho`);
quit;

