Esempio n. 1
0
void wt_init(lie_Index r)
{   sorted=copypoly(poly_null(r));
    pos_acc=mkpoly(ACCMIN,r);
    neg_acc=mkpoly(ACCMIN,r);
    pos_acc->nrows=0;
    neg_acc->nrows=0;
}
Esempio n. 2
0
void wt_ins(entry* wt, bigint* c, boolean neg)
{   if (c->size==0) {
        freemem(c);
        return;
    }
    {   lie_Index i=searchterm(sorted,wt);
        if (i>=0)
        {   clrshared(sorted->coef[i]);
            sorted->coef[i]= (neg ? sub : add)(sorted->coef[i],c);
            setshared(sorted->coef[i]);
        }
        else

        {   poly** acc= neg ? &neg_acc : &pos_acc;
            lie_Index i=(*acc)->nrows;
            if (i==(*acc)->rowsize)
            {   sorted=Add_pol_pol(sorted,*acc,neg);
                *acc=mkpoly(Max(sorted->nrows,ACCMIN),sorted->ncols);
                i=0;
            }
            copyrow(wt,(*acc)->elm[i],sorted->ncols);
            (*acc)->coef[i++]=c;
            setshared(c);
            (*acc)->nrows=i;
        }
    }
}
Esempio n. 3
0
File: lr.c Progetto: d4g33z/lie
poly* From_Part_p (poly* p)
{ _index i,j,n_rows=p->nrows,n=p->ncols; poly* result=mkpoly(n_rows,n-1);
  entry** lambda=p->elm; entry** res=result->elm;
  for (i=0; i<n_rows; ++i)
  { result->coef[i]=p->coef[i]; setshared(p->coef[i]); /* copy coefficient */
    for (j=0; j<n-1; ++j) res[i][j]=lambda[i][j]-lambda[i][j+1];
  }
  return Reduce_pol(result);
}
Esempio n. 4
0
File: lr.c Progetto: d4g33z/lie
poly* To_Part_p (poly* p)
{ _index i,n_rows=p->nrows,n=p->ncols; entry** wt=p->elm;
  poly* result=mkpoly(n_rows,n+1); entry** lambda=result->elm;
  for (i=0; i<n_rows; ++i)
  { _index j=n; entry sum=0; 
    result->coef[i]=p->coef[i]; setshared(p->coef[i]);
    while (lambda[i][j]=sum, --j>=0) sum+=wt[i][j];
  }
  return Reduce_pol(result);
}
Esempio n. 5
0
poly *pol_mul_pol_mat(poly *a, matrix *b) {
    poly *m;
    int i;
    if (a->ncols != b->nrows)
	error("Number variables arg1 unequal number of rows arg2 .\n");
    m = mkpoly(a->nrows,b->ncols);
    mulmatmatelm(a->elm,b->elm,m->elm,a->nrows,a->ncols,b->ncols);
    for (i=0;i<m->nrows;i++) { 
	m->coef[i] = a->coef[i];
	setshared(m->coef[i]);
    }
    return m;
}
Esempio n. 6
0
File: weyl.c Progetto: nhatcher/lie
poly* alt_Wsum(poly* p)
{ lie_Index i,k=0,r=p->ncols; poly* result; entry** res,*rho=mkintarray(r);
  p=Alt_dom(p); for (i=0; i<r; ++i) rho[i]=1;
  for (i=0; i<p->nrows; ++i) add_xrow_to(p->elm[i],1,rho,r);
  result=mkpoly(p->nrows*bigint2entry(Worder(grp)),r); res=result->elm;
  for (i=0; i<p->nrows; ++i)
  { lie_Index j,l; matrix* orbit=Weyl_orbit(p->elm[i],NULL); entry** x=orbit->elm;
    bigint* c=p->coef[i],* min_c=sub(null,c);
    for (j=0; j<orbit->nrows; ++j)
    { subrow(*x,rho,res[k],r); l=make_dominant(*x++)%2;
      result->coef[k]= l ? min_c : c; setshared(result->coef[k]); ++k;
    }
    freemem(orbit);
  }
  freearr(rho);
  assert(k==result->nrows);
  return result; /* not sorted, but rows are unique */
}
Esempio n. 7
0
File: grpdata.c Progetto: d4g33z/lie
poly* Adjoint(object grp)
{ _index i,j,r=Lierank(grp)
  ,n=type_of(grp)==SIMPGRP ? 1: grp->g.ncomp+(grp->g.toraldim!=0);
  poly* adj= mkpoly(n,r);
  for (i=0; i<n; ++i)
  { adj->coef[i]=one; for (j=0; j<r; ++j) adj->elm[i][j]=0; }
  if (type_of(grp)==SIMPGRP) set_simp_adjoint(adj->elm[0],&grp->s);
  else
  { _index offs=0; simpgrp* g;
    for (i=0; i<grp->g.ncomp; offs+=g->lierank,++i)
      set_simp_adjoint(&adj->elm[i][offs],g=Liecomp(grp,i));
    if (grp->g.toraldim!=0)
    { adj->coef[i]=entry2bigint(grp->g.toraldim);
      setshared(adj->coef[i]);
    }
  }
  return adj;
}
Esempio n. 8
0
File: weyl.c Progetto: nhatcher/lie
poly* Worbit_p(poly* p)
{ lie_Index i,k=0,l=0,r=p->ncols; poly* result; entry** res;
  p=copypoly(p); for (i=0; i<p->nrows; ++i) make_dominant(p->elm[i]);
  Reduce_pol(p);
  for (i=0; i<p->nrows; ++i)
    if ((l += bigint2entry(Orbitsize(p->elm[i])))<0)
      error ("That's too large an orbit");
  result=mkpoly(l,p->ncols); res=result->elm;
  for (i=0; i<p->nrows; ++i)
  { lie_Index j; matrix* orbit=Weyl_orbit(p->elm[i],NULL); entry** x=orbit->elm;
    for (j=0; j<orbit->nrows; ++j)
    { result->coef[k]=p->coef[i]; setshared(p->coef[i]);
      copyrow(*x++,res[k++],r);
    }
    freemem(orbit);
  }
  assert(k==result->nrows);
  return result; /* not sorted, but rows are unique */
}
Esempio n. 9
0
local poly* vdecomp_irr(entry* lambda)
{   if (type_of(grp)==SIMPGRP) return simp_vdecomp_irr(lambda,&grp->s);
    if (simpgroup(grp)) return simp_vdecomp_irr(lambda,Liecomp(grp,0));
    {   poly* result;
        lie_Index i;

        {   lie_Index td=grp->g.toraldim;
            lambda+=Ssrank(grp);
            result=mkpoly(1,td);
            copyrow(lambda,*result->elm,td);
            *result->coef=one;
        }
        for (i=grp->g.ncomp-1; i>=0; --i)
            /* traverse simple components in reverse order */
        {   simpgrp* g=Liecomp(grp,i);
            lambda-=g->lierank;
            result= Disjunct_mul_pol_pol(simp_vdecomp_irr(lambda,g),result);
        }
        return result;
    }
}