Changeset aef5db in git for libpolys/polys/matpol.cc


Ignore:
Timestamp:
Jun 29, 2018, 2:13:21 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '6e5adcba05493683b94648c659a729c189812c77')
Children:
96cd73ba8e350c13e7964b70073c3fec90b296c4
Parents:
13673122266edb13d76ff215c7d27bf6d7aa7ce3
Message:
add: system("unflatten",<smatrix>,<cols>)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/matpol.cc

    r1367312 raef5db  
    18431843  return res;
    18441844}
     1845
     1846ideal sm_UnFlatten(ideal a, int col, const ring R)
     1847{
     1848  if ((IDELEMS(a)!=1)
     1849  ||((a->rank % col)!=0))
     1850  {
     1851    Werror("wrong format: %d x %d for unflatten",(int)a->rank,IDELEMS(a));
     1852    return NULL;
     1853  }
     1854  int row=a->rank/col;
     1855  ideal res=idInit(col,row);
     1856  poly p=a->m[0];
     1857  while(p!=NULL)
     1858  {
     1859    poly h=p_Head(p,R);
     1860    int comp=p_GetComp(h,R);
     1861    int c=(comp-1)/row;
     1862    int r=comp%row; if (r==0) r=row;
     1863    p_SetComp(h,r,R); p_SetmComp(h,R);
     1864    res->m[c]=p_Add_q(res->m[c],h,R);
     1865    pIter(p);
     1866  }
     1867  return res;
     1868}
     1869
    18451870/*2
    18461871*returns the trace of matrix a
Note: See TracChangeset for help on using the changeset viewer.