My Project  UNKNOWN_GIT_VERSION
Data Structures | Macros | Typedefs | Functions | Variables
matpol.h File Reference
#include "polys/monomials/ring.h"

Go to the source code of this file.

Data Structures

class  ip_smatrix
 

Macros

#define MATROWS(i)   ((i)->nrows)
 
#define MATCOLS(i)   ((i)->ncols)
 
#define MATELEM(mat, i, j)   ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]
 
#define SMATELEM(A, i, j, R)   p_Vec2Poly(A->m[j],i+1,R)
 

Typedefs

typedef ip_smatrixmatrix
 

Functions

matrix mpNew (int r, int c)
 create a r x c zero-matrix More...
 
static matrix mp_New (int r, int c)
 
void mp_Delete (matrix *a, const ring r)
 
matrix mp_Copy (const matrix a, const ring rSrc, const ring rDst)
 copies matrix a from rSrc into rDst More...
 
matrix mp_Copy (matrix a, const ring r)
 copies matrix a (from ring r to r) More...
 
matrix mp_InitP (int r, int c, poly p, const ring R)
 make it a p * unit matrix More...
 
matrix mp_InitI (int r, int c, int v, const ring R)
 make it a v * unit matrix More...
 
matrix mp_MultI (matrix a, int f, const ring r)
 c = f*a More...
 
matrix mp_MultP (matrix a, poly p, const ring r)
 multiply a matrix 'a' by a poly 'p', destroy the args More...
 
matrix pMultMp (poly p, matrix a, const ring r)
 
matrix mp_Add (matrix a, matrix b, const ring r)
 
matrix mp_Sub (matrix a, matrix b, const ring r)
 
matrix mp_Mult (matrix a, matrix b, const ring r)
 
matrix mp_Transp (matrix a, const ring r)
 
BOOLEAN mp_Equal (matrix a, matrix b, const ring r)
 
poly mp_Trace (matrix a, const ring r)
 
poly TraceOfProd (matrix a, matrix b, int n, const ring r)
 
matrix mp_Wedge (matrix a, int ar, const ring r)
 
poly mp_DetBareiss (matrix a, const ring r)
 returns the determinant of the matrix m; uses Bareiss algorithm More...
 
void mp_Monomials (matrix c, int r, int var, matrix m, const ring R)
 
matrix mp_Coeffs (ideal I, int var, const ring r)
 corresponds to Maple's coeffs: var has to be the number of a variable More...
 
matrix mp_CoeffProc (poly f, poly vars, const ring r)
 
matrix mp_CoeffProcId (ideal I, poly vars, const ring R)
 
void mp_Coef2 (poly v, poly vars, matrix *c, matrix *m, const ring r)
 corresponds to Macauley's coef: the exponent vector of vars has to contain the variables, eg 'xy'; then the poly f is searched for monomials in x and y, these monimials are written to the first row of the matrix co. the second row of co contains the respective factors in f. Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2. More...
 
void mp_RecMin (int, ideal, int &, matrix, int, int, poly, ideal, const ring)
 for minors with Bareiss More...
 
void mp_MinorToResult (ideal, int &, matrix, int, int, ideal, const ring)
 entries of a are minors and go to result (only if not in R) More...
 
BOOLEAN mp_IsDiagUnit (matrix U, const ring r)
 
void iiWriteMatrix (matrix im, const char *n, int dim, const ring r, int spaces)
 set spaces to zero by default More...
 
char * iiStringMatrix (matrix im, int dim, const ring r, char ch=',')
 
int mp_Compare (matrix a, matrix b, const ring r)
 
ideal sm_Add (ideal a, ideal b, const ring R)
 
ideal sm_Sub (ideal a, ideal b, const ring R)
 
ideal sm_Mult (ideal a, ideal b, const ring R)
 
ideal sm_Flatten (ideal a, const ring R)
 
ideal sm_UnFlatten (ideal a, int col, const ring R)
 
poly sm_Trace (ideal a, const ring R)
 
int sm_Compare (ideal a, ideal b, const ring R)
 
BOOLEAN sm_Equal (ideal a, ideal b, const ring R)
 
ideal sm_Tensor (ideal A, ideal B, const ring r)
 

Variables

omBin ip_smatrix_bin
 

Macro Definition Documentation

◆ MATCOLS

#define MATCOLS (   i)    ((i)->ncols)

Definition at line 27 of file matpol.h.

◆ MATELEM

#define MATELEM (   mat,
  i,
  j 
)    ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1]

Definition at line 28 of file matpol.h.

◆ MATROWS

#define MATROWS (   i)    ((i)->nrows)

Definition at line 26 of file matpol.h.

◆ SMATELEM

#define SMATELEM (   A,
  i,
  j,
  R 
)    p_Vec2Poly(A->m[j],i+1,R)

Definition at line 107 of file matpol.h.

Typedef Documentation

◆ matrix

typedef ip_smatrix* matrix

Definition at line 30 of file matpol.h.

Function Documentation

◆ iiStringMatrix()

char* iiStringMatrix ( matrix  im,
int  dim,
const ring  r,
char  ch = ',' 
)

Definition at line 857 of file matpol.cc.

859 {
860  int i,ii = MATROWS(im);
861  int j,jj = MATCOLS(im);
862  poly *pp = im->m;
863  char ch_s[2];
864  ch_s[0]=ch;
865  ch_s[1]='\0';
866 
867  StringSetS("");
868 
869  for (i=0; i<ii; i++)
870  {
871  for (j=0; j<jj; j++)
872  {
873  p_String0(*pp++, r);
874  StringAppendS(ch_s);
875  if (dim > 1) StringAppendS("\n");
876  }
877  }
878  char *s=StringEndS();
879  s[strlen(s)- (dim > 1 ? 2 : 1)]='\0';
880  return s;

◆ iiWriteMatrix()

void iiWriteMatrix ( matrix  im,
const char *  n,
int  dim,
const ring  r,
int  spaces 
)

set spaces to zero by default

Definition at line 836 of file matpol.cc.

838 {
839  int i,ii = MATROWS(im)-1;
840  int j,jj = MATCOLS(im)-1;
841  poly *pp = im->m;
842 
843  for (i=0; i<=ii; i++)
844  {
845  for (j=0; j<=jj; j++)
846  {
847  if (spaces>0)
848  Print("%-*.*s",spaces,spaces," ");
849  if (dim == 2) Print("%s[%u,%u]=",n,i+1,j+1);
850  else if (dim == 1) Print("%s[%u]=",n,j+1);
851  else if (dim == 0) Print("%s=",n);
852  if ((i<ii)||(j<jj)) p_Write(*pp++, r);
853  else p_Write0(*pp, r);
854  }
855  }

◆ mp_Add()

matrix mp_Add ( matrix  a,
matrix  b,
const ring  r 
)

Definition at line 178 of file matpol.cc.

180 {
181  int k, n = a->nrows, m = a->ncols;
182  if ((n != b->nrows) || (m != b->ncols))
183  {
184 /*
185 * Werror("cannot add %dx%d matrix and %dx%d matrix",
186 * m,n,b->cols(),b->rows());
187 */
188  return NULL;
189  }
190  matrix c = mpNew(n,m);
191  for (k=m*n-1; k>=0; k--)
192  c->m[k] = p_Add_q(p_Copy(a->m[k], R), p_Copy(b->m[k], R), R);
193  return c;

◆ mp_Coef2()

void mp_Coef2 ( poly  v,
poly  vars,
matrix c,
matrix m,
const ring  r 
)

corresponds to Macauley's coef: the exponent vector of vars has to contain the variables, eg 'xy'; then the poly f is searched for monomials in x and y, these monimials are written to the first row of the matrix co. the second row of co contains the respective factors in f. Thus f = sum co[1,i]*co[2,i], i = 1..cols, rows equals 2.

Definition at line 583 of file matpol.cc.

585 {
586  poly* s;
587  poly p;
588  int sl,i,j;
589  int l=0;
590  poly sel=mp_Select(v,mon, R);
591 
592  p_Vec2Polys(sel,&s,&sl, R);
593  for (i=0; i<sl; i++)
594  l=si_max(l,pLength(s[i]));
595  *c=mpNew(sl,l);
596  *m=mpNew(sl,l);
597  poly h;
598  int isConst;
599  for (j=1; j<=sl;j++)
600  {
601  p=s[j-1];
602  if (p_IsConstant(p, R)) /*p != NULL */
603  {
604  isConst=-1;
605  i=l;
606  }
607  else
608  {
609  isConst=1;
610  i=1;
611  }
612  while(p!=NULL)
613  {
614  h = p_Head(p, R);
615  MATELEM(*m,j,i) = h;
616  i+=isConst;
617  p = p->next;
618  }
619  }
620  while (v!=NULL)
621  {
622  i = 1;
623  j = __p_GetComp(v, R);
624  loop
625  {
626  poly mp=MATELEM(*m,j,i);
627  if (mp!=NULL)
628  {
629  h = mp_Exdiv(v, mp /*MATELEM(*m,j,i)*/, mp, R);
630  if (h!=NULL)
631  {
632  p_SetComp(h,0, R);
633  MATELEM(*c,j,i) = p_Add_q(MATELEM(*c,j,i), h, R);
634  break;
635  }
636  }
637  if (i < l)
638  i++;
639  else
640  break;
641  }
642  v = v->next;
643  }

◆ mp_CoeffProc()

matrix mp_CoeffProc ( poly  f,
poly  vars,
const ring  r 
)

Definition at line 401 of file matpol.cc.

403 {
404  assume(vars!=NULL);
405  poly sel, h;
406  int l, i;
407  int pos_of_1 = -1;
408  matrix co;
409 
410  if (f==NULL)
411  {
412  co = mpNew(2, 1);
413  MATELEM(co,1,1) = p_One(R);
414  //MATELEM(co,2,1) = NULL;
415  return co;
416  }
417  sel = mp_Select(f, vars, R);
418  l = pLength(sel);
419  co = mpNew(2, l);
420 
422  {
423  for (i=l; i>=1; i--)
424  {
425  h = sel;
426  pIter(sel);
427  pNext(h)=NULL;
428  MATELEM(co,1,i) = h;
429  //MATELEM(co,2,i) = NULL;
430  if (p_IsConstant(h, R)) pos_of_1 = i;
431  }
432  }
433  else
434  {
435  for (i=1; i<=l; i++)
436  {
437  h = sel;
438  pIter(sel);
439  pNext(h)=NULL;
440  MATELEM(co,1,i) = h;
441  //MATELEM(co,2,i) = NULL;
442  if (p_IsConstant(h, R)) pos_of_1 = i;
443  }
444  }
445  while (f!=NULL)
446  {
447  i = 1;
448  loop
449  {
450  if (i!=pos_of_1)
451  {
452  h = mp_Exdiv(f, MATELEM(co,1,i),vars, R);
453  if (h!=NULL)
454  {
455  MATELEM(co,2,i) = p_Add_q(MATELEM(co,2,i), h, R);
456  break;
457  }
458  }
459  if (i == l)
460  {
461  // check monom 1 last:
462  if (pos_of_1 != -1)
463  {
464  h = mp_Exdiv(f, MATELEM(co,1,pos_of_1),vars, R);
465  if (h!=NULL)
466  {
467  MATELEM(co,2,pos_of_1) = p_Add_q(MATELEM(co,2,pos_of_1), h, R);
468  }
469  }
470  break;
471  }
472  i ++;
473  }
474  pIter(f);
475  }
476  return co;

◆ mp_CoeffProcId()

matrix mp_CoeffProcId ( ideal  I,
poly  vars,
const ring  R 
)

Definition at line 478 of file matpol.cc.

480 {
481  assume(vars!=NULL);
482  poly sel, h;
483  int l, i;
484  int pos_of_1 = -1;
485  matrix co;
486 
487  if (idIs0(I))
488  {
489  co = mpNew(IDELEMS(I)+1,1);
490  MATELEM(co,1,1) = p_One(R);
491  return co;
492  }
493  sel = mp_SelectId(I, vars, R);
494  l = pLength(sel);
495  co = mpNew(IDELEMS(I)+1, l);
496 
498  {
499  for (i=l; i>=1; i--)
500  {
501  h = sel;
502  pIter(sel);
503  pNext(h)=NULL;
504  MATELEM(co,1,i) = h;
505  //MATELEM(co,2,i) = NULL;
506  if (p_IsConstant(h, R)) pos_of_1 = i;
507  }
508  }
509  else
510  {
511  for (i=1; i<=l; i++)
512  {
513  h = sel;
514  pIter(sel);
515  pNext(h)=NULL;
516  MATELEM(co,1,i) = h;
517  //MATELEM(co,2,i) = NULL;
518  if (p_IsConstant(h, R)) pos_of_1 = i;
519  }
520  }
521  for(int j=0;j<IDELEMS(I);j++)
522  {
523  poly f=I->m[j];
524  while (f!=NULL)
525  {
526  i = 1;
527  loop
528  {
529  if (i!=pos_of_1)
530  {
531  h = mp_Exdiv(f, MATELEM(co,1,i),vars, R);
532  if (h!=NULL)
533  {
534  MATELEM(co,j+2,i) = p_Add_q(MATELEM(co,j+2,i), h, R);
535  break;
536  }
537  }
538  if (i == l)
539  {
540  // check monom 1 last:
541  if (pos_of_1 != -1)
542  {
543  h = mp_Exdiv(f, MATELEM(co,1,pos_of_1),vars, R);
544  if (h!=NULL)
545  {
546  MATELEM(co,j+2,pos_of_1) = p_Add_q(MATELEM(co,j+2,pos_of_1), h, R);
547  }
548  }
549  break;
550  }
551  i ++;
552  }
553  pIter(f);
554  }
555  }
556  return co;

◆ mp_Coeffs()

matrix mp_Coeffs ( ideal  I,
int  var,
const ring  r 
)

corresponds to Maple's coeffs: var has to be the number of a variable

Definition at line 315 of file matpol.cc.

317 {
318  poly h,f;
319  int l, i, c, m=0;
320  /* look for maximal power m of x_var in I */
321  for (i=IDELEMS(I)-1; i>=0; i--)
322  {
323  f=I->m[i];
324  while (f!=NULL)
325  {
326  l=p_GetExp(f,var, R);
327  if (l>m) m=l;
328  pIter(f);
329  }
330  }
331  matrix co=mpNew((m+1)*I->rank,IDELEMS(I));
332  /* divide each monomial by a power of x_var,
333  * remember the power in l and the component in c*/
334  for (i=IDELEMS(I)-1; i>=0; i--)
335  {
336  f=I->m[i];
337  I->m[i]=NULL;
338  while (f!=NULL)
339  {
340  l=p_GetExp(f,var, R);
341  p_SetExp(f,var,0, R);
342  c=si_max((int)p_GetComp(f, R),1);
343  p_SetComp(f,0, R);
344  p_Setm(f, R);
345  /* now add the resulting monomial to co*/
346  h=pNext(f);
347  pNext(f)=NULL;
348  //MATELEM(co,c*(m+1)-l,i+1)
349  // =p_Add_q(MATELEM(co,c*(m+1)-l,i+1),f, R);
350  MATELEM(co,(c-1)*(m+1)+l+1,i+1)
351  =p_Add_q(MATELEM(co,(c-1)*(m+1)+l+1,i+1),f, R);
352  /* iterate f*/
353  f=h;
354  }
355  }
356  id_Delete(&I, R);
357  return co;

◆ mp_Compare()

int mp_Compare ( matrix  a,
matrix  b,
const ring  r 
)

Definition at line 645 of file matpol.cc.

647 {
648  if (MATCOLS(a)<MATCOLS(b)) return -1;
649  else if (MATCOLS(a)>MATCOLS(b)) return 1;
650  if (MATROWS(a)<MATROWS(b)) return -1;
651  else if (MATROWS(a)<MATROWS(b)) return 1;
652 
653  unsigned ii=MATCOLS(a)*MATROWS(a)-1;
654  unsigned j=0;
655  int r=0;
656  while (j<=ii)
657  {
658  r=p_Compare(a->m[j],b->m[j],R);
659  if (r!=0) return r;
660  j++;
661  }
662  return r;

◆ mp_Copy() [1/2]

matrix mp_Copy ( const matrix  a,
const ring  rSrc,
const ring  rDst 
)

copies matrix a from rSrc into rDst

Definition at line 84 of file matpol.cc.

86 {
87  id_Test((ideal)a, rSrc);
88 
89  poly t;
90  int i, m=MATROWS(a), n=MATCOLS(a);
91 
92  matrix b = mpNew(m, n);
93 
94  for (i=m*n-1; i>=0; i--)
95  {
96  t = a->m[i];
97  if (t!=NULL)
98  {
99  b->m[i] = prCopyR_NoSort(t, rSrc, rDst);
100  p_Normalize(b->m[i], rDst);
101  }
102  }
103  b->rank=a->rank;
104 
105  id_Test((ideal)b, rDst);
106 
107  return b;

◆ mp_Copy() [2/2]

matrix mp_Copy ( matrix  a,
const ring  r 
)

copies matrix a (from ring r to r)

Definition at line 63 of file matpol.cc.

65 {
66  id_Test((ideal)a, r);
67  poly t;
68  int i, m=MATROWS(a), n=MATCOLS(a);
69  matrix b = mpNew(m, n);
70 
71  for (i=m*n-1; i>=0; i--)
72  {
73  t = a->m[i];
74  if (t!=NULL)
75  {
76  p_Normalize(t, r);
77  b->m[i] = p_Copy(t, r);
78  }
79  }
80  b->rank=a->rank;
81  return b;

◆ mp_Delete()

void mp_Delete ( matrix a,
const ring  r 
)

Definition at line 882 of file matpol.cc.

884 {
885  id_Delete((ideal *) a, r);

◆ mp_DetBareiss()

poly mp_DetBareiss ( matrix  a,
const ring  r 
)

returns the determinant of the matrix m; uses Bareiss algorithm

Definition at line 1678 of file matpol.cc.

1680 {
1681  int s;
1682  poly div, res;
1683  if (MATROWS(a) != MATCOLS(a))
1684  {
1685  Werror("det of %d x %d matrix",MATROWS(a),MATCOLS(a));
1686  return NULL;
1687  }
1688  matrix c = mp_Copy(a,r);
1689  mp_permmatrix *Bareiss = new mp_permmatrix(c,r);
1690  row_col_weight w(Bareiss->mpGetRdim(), Bareiss->mpGetCdim());
1691 
1692  /* Bareiss */
1693  div = NULL;
1694  while(Bareiss->mpPivotBareiss(&w))
1695  {
1696  Bareiss->mpElimBareiss(div);
1697  div = Bareiss->mpGetElem(Bareiss->mpGetRdim(), Bareiss->mpGetCdim());
1698  }
1699  Bareiss->mpRowReorder();
1700  Bareiss->mpColReorder();
1701  Bareiss->mpSaveArray();
1702  s = Bareiss->mpGetSign();
1703  delete Bareiss;
1704 
1705  /* result */
1706  res = MATELEM(c,1,1);
1707  MATELEM(c,1,1) = NULL;
1708  id_Delete((ideal *)&c,r);
1709  if (s < 0)
1710  res = p_Neg(res,r);
1711  return res;

◆ mp_Equal()

BOOLEAN mp_Equal ( matrix  a,
matrix  b,
const ring  r 
)

Definition at line 664 of file matpol.cc.

666 {
667  if ((MATCOLS(a)!=MATCOLS(b)) || (MATROWS(a)!=MATROWS(b)))
668  return FALSE;
669  int i=MATCOLS(a)*MATROWS(a)-1;
670  while (i>=0)
671  {
672  if (a->m[i]==NULL)
673  {
674  if (b->m[i]!=NULL) return FALSE;
675  }
676  else if (b->m[i]==NULL) return FALSE;
677  else if (p_Cmp(a->m[i],b->m[i], R)!=0) return FALSE;
678  i--;
679  }
680  i=MATCOLS(a)*MATROWS(a)-1;
681  while (i>=0)
682  {
683  if(!p_EqualPolys(a->m[i],b->m[i], R)) return FALSE;
684  i--;
685  }
686  return TRUE;

◆ mp_InitI()

matrix mp_InitI ( int  r,
int  c,
int  v,
const ring  R 
)

make it a v * unit matrix

Definition at line 128 of file matpol.cc.

130 {
131  return mp_InitP(r, c, p_ISet(v, R), R);

◆ mp_InitP()

matrix mp_InitP ( int  r,
int  c,
poly  p,
const ring  R 
)

make it a p * unit matrix

Definition at line 112 of file matpol.cc.

114 {
115  matrix rc = mpNew(r,c);
116  int i=si_min(r,c), n = c*(i-1)+i-1, inc = c+1;
117 
118  p_Normalize(p, R);
119  while (n>0)
120  {
121  rc->m[n] = p_Copy(p, R);
122  n -= inc;
123  }
124  rc->m[0]=p;
125  return rc;

◆ mp_IsDiagUnit()

BOOLEAN mp_IsDiagUnit ( matrix  U,
const ring  r 
)

Definition at line 818 of file matpol.cc.

820 {
821  if(MATROWS(U)!=MATCOLS(U))
822  return FALSE;
823  for(int i=MATCOLS(U);i>=1;i--)
824  {
825  for(int j=MATCOLS(U); j>=1; j--)
826  {
827  if (i==j)
828  {
829  if (!p_IsUnit(MATELEM(U,i,i), R)) return FALSE;
830  }
831  else if (MATELEM(U,i,j)!=NULL) return FALSE;
832  }
833  }
834  return TRUE;

◆ mp_MinorToResult()

void mp_MinorToResult ( ideal  ,
int &  ,
matrix  ,
int  ,
int  ,
ideal  ,
const  ring 
)

entries of a are minors and go to result (only if not in R)

Definition at line 1509 of file matpol.cc.

1512 {
1513  poly *q1;
1514  int e=IDELEMS(result);
1515  int i,j;
1516 
1517  if (R != NULL)
1518  {
1519  for (i=r-1;i>=0;i--)
1520  {
1521  q1 = &(a->m)[i*a->ncols];
1522  //for (j=c-1;j>=0;j--)
1523  //{
1524  // if (q1[j]!=NULL) q1[j] = kNF(R,currRing->qideal,q1[j]);
1525  //}
1526  }
1527  }
1528  for (i=r-1;i>=0;i--)
1529  {
1530  q1 = &(a->m)[i*a->ncols];
1531  for (j=c-1;j>=0;j--)
1532  {
1533  if (q1[j]!=NULL)
1534  {
1535  if (elems>=e)
1536  {
1537  pEnlargeSet(&(result->m),e,e);
1538  e += e;
1539  IDELEMS(result) =e;
1540  }
1541  result->m[elems] = q1[j];
1542  q1[j] = NULL;
1543  elems++;
1544  }
1545  }
1546  }

◆ mp_Monomials()

void mp_Monomials ( matrix  c,
int  r,
int  var,
matrix  m,
const ring  R 
)

Definition at line 364 of file matpol.cc.

366 {
367  /* clear contents of m*/
368  int k,l;
369  for (k=MATROWS(m);k>0;k--)
370  {
371  for(l=MATCOLS(m);l>0;l--)
372  {
373  p_Delete(&MATELEM(m,k,l), R);
374  }
375  }
376  omfreeSize((ADDRESS)m->m,MATROWS(m)*MATCOLS(m)*sizeof(poly));
377  /* allocate monoms in the right size r x MATROWS(c)*/
378  m->m=(poly*)omAlloc0(r*MATROWS(c)*sizeof(poly));
379  MATROWS(m)=r;
380  MATCOLS(m)=MATROWS(c);
381  m->rank=r;
382  /* the maximal power p of x_var: MATCOLS(m)=r*(p+1) */
383  int p=MATCOLS(m)/r-1;
384  /* fill in the powers of x_var=h*/
385  poly h=p_One(R);
386  for(k=r;k>0; k--)
387  {
388  MATELEM(m,k,k*(p+1))=p_One(R);
389  }
390  for(l=p;l>=0; l--)
391  {
392  p_SetExp(h,var,p-l, R);
393  p_Setm(h, R);
394  for(k=r;k>0; k--)
395  {
396  MATELEM(m,k,k*(p+1)-l)=p_Copy(h, R);
397  }
398  }
399  p_Delete(&h, R);

◆ mp_Mult()

matrix mp_Mult ( matrix  a,
matrix  b,
const ring  r 
)

Definition at line 212 of file matpol.cc.

214 {
215  int i, j, k;
216  int m = MATROWS(a);
217  int p = MATCOLS(a);
218  int q = MATCOLS(b);
219 
220  if (p!=MATROWS(b))
221  {
222 /*
223 * Werror("cannot multiply %dx%d matrix and %dx%d matrix",
224 * m,p,b->rows(),q);
225 */
226  return NULL;
227  }
228  matrix c = mpNew(m,q);
229 
230  for (i=1; i<=m; i++)
231  {
232  for (k=1; k<=p; k++)
233  {
234  poly aik;
235  if ((aik=MATELEM(a,i,k))!=NULL)
236  {
237  for (j=1; j<=q; j++)
238  {
239  poly bkj;
240  if ((bkj=MATELEM(b,k,j))!=NULL)
241  {
242  poly *cij=&(MATELEM(c,i,j));
243  poly s = pp_Mult_qq(aik /*MATELEM(a,i,k)*/, bkj/*MATELEM(b,k,j)*/, R);
244  if (/*MATELEM(c,i,j)*/ (*cij)==NULL) (*cij)=s;
245  else (*cij) = p_Add_q((*cij) /*MATELEM(c,i,j)*/ ,s, R);
246  }
247  }
248  }
249  // pNormalize(t);
250  // MATELEM(c,i,j) = t;
251  }
252  }
253  for(i=m*q-1;i>=0;i--) p_Normalize(c->m[i], R);
254  return c;

◆ mp_MultI()

matrix mp_MultI ( matrix  a,
int  f,
const ring  r 
)

c = f*a

Definition at line 134 of file matpol.cc.

136 {
137  int k, n = a->nrows, m = a->ncols;
138  poly p = p_ISet(f, R);
139  matrix c = mpNew(n,m);
140 
141  for (k=m*n-1; k>0; k--)
142  c->m[k] = pp_Mult_qq(a->m[k], p, R);
143  c->m[0] = p_Mult_q(p_Copy(a->m[0], R), p, R);
144  return c;

◆ mp_MultP()

matrix mp_MultP ( matrix  a,
poly  p,
const ring  r 
)

multiply a matrix 'a' by a poly 'p', destroy the args

Definition at line 147 of file matpol.cc.

149 {
150  int k, n = a->nrows, m = a->ncols;
151 
152  p_Normalize(p, R);
153  for (k=m*n-1; k>0; k--)
154  {
155  if (a->m[k]!=NULL)
156  a->m[k] = p_Mult_q(a->m[k], p_Copy(p, R), R);
157  }
158  a->m[0] = p_Mult_q(a->m[0], p, R);
159  return a;

◆ mp_New()

static matrix mp_New ( int  r,
int  c 
)
inlinestatic

Definition at line 33 of file matpol.h.

34 { return mpNew(r,c); }

◆ mp_RecMin()

void mp_RecMin ( int  ar,
ideal  result,
int &  elems,
matrix  a,
int  lr,
int  lc,
poly  barDiv,
ideal  R,
const ring  r 
)

for minors with Bareiss

for minors with Bareiss

Definition at line 1605 of file matpol.cc.

1608 {
1609  int k;
1610  int kr=lr-1,kc=lc-1;
1611  matrix nextLevel=mpNew(kr,kc);
1612 
1613  loop
1614  {
1615 /*--- look for an optimal row and bring it to last position ------------*/
1616  if(mp_PrepareRow(a,lr,lc,r)==0) break;
1617 /*--- now take all pivots from the last row ------------*/
1618  k = lc;
1619  loop
1620  {
1621  if(mp_PreparePiv(a,lr,k,r)==0) break;
1622  mp_ElimBar(a,nextLevel,barDiv,lr,k,r);
1623  k--;
1624  if (ar>1)
1625  {
1626  mp_RecMin(ar-1,result,elems,nextLevel,kr,k,a->m[kr*a->ncols+k],R,r);
1627  mp_PartClean(nextLevel,kr,k, r);
1628  }
1629  else mp_MinorToResult(result,elems,nextLevel,kr,k,R,r);
1630  if (ar>k-1) break;
1631  }
1632  if (ar>=kr) break;
1633 /*--- now we have to take out the last row...------------*/
1634  lr = kr;
1635  kr--;
1636  }
1637  mpFinalClean(nextLevel);

◆ mp_Sub()

matrix mp_Sub ( matrix  a,
matrix  b,
const ring  r 
)

Definition at line 195 of file matpol.cc.

197 {
198  int k, n = a->nrows, m = a->ncols;
199  if ((n != b->nrows) || (m != b->ncols))
200  {
201 /*
202 * Werror("cannot sub %dx%d matrix and %dx%d matrix",
203 * m,n,b->cols(),b->rows());
204 */
205  return NULL;
206  }
207  matrix c = mpNew(n,m);
208  for (k=m*n-1; k>=0; k--)
209  c->m[k] = p_Sub(p_Copy(a->m[k], R), p_Copy(b->m[k], R), R);
210  return c;

◆ mp_Trace()

poly mp_Trace ( matrix  a,
const ring  r 
)

Definition at line 277 of file matpol.cc.

279 {
280  int i;
281  int n = (MATCOLS(a)<MATROWS(a)) ? MATCOLS(a) : MATROWS(a);
282  poly t = NULL;
283 
284  for (i=1; i<=n; i++)
285  t = p_Add_q(t, p_Copy(MATELEM(a,i,i), R), R);
286  return t;

◆ mp_Transp()

matrix mp_Transp ( matrix  a,
const ring  r 
)

Definition at line 256 of file matpol.cc.

258 {
259  int i, j, r = MATROWS(a), c = MATCOLS(a);
260  poly *p;
261  matrix b = mpNew(c,r);
262 
263  p = b->m;
264  for (i=0; i<c; i++)
265  {
266  for (j=0; j<r; j++)
267  {
268  if (a->m[j*c+i]!=NULL) *p = p_Copy(a->m[j*c+i], R);
269  p++;
270  }
271  }
272  return b;

◆ mp_Wedge()

matrix mp_Wedge ( matrix  a,
int  ar,
const ring  r 
)

Definition at line 1753 of file matpol.cc.

1755 {
1756  int i,j,k,l;
1757  int *rowchoise,*colchoise;
1758  BOOLEAN rowch,colch;
1759  matrix result;
1760  matrix tmp;
1761  poly p;
1762 
1763  i = binom(a->nrows,ar);
1764  j = binom(a->ncols,ar);
1765 
1766  rowchoise=(int *)omAlloc(ar*sizeof(int));
1767  colchoise=(int *)omAlloc(ar*sizeof(int));
1768  result = mpNew(i,j);
1769  tmp = mpNew(ar,ar);
1770  l = 1; /* k,l:the index in result*/
1771  idInitChoise(ar,1,a->nrows,&rowch,rowchoise);
1772  while (!rowch)
1773  {
1774  k=1;
1775  idInitChoise(ar,1,a->ncols,&colch,colchoise);
1776  while (!colch)
1777  {
1778  for (i=1; i<=ar; i++)
1779  {
1780  for (j=1; j<=ar; j++)
1781  {
1782  MATELEM(tmp,i,j) = MATELEM(a,rowchoise[i-1],colchoise[j-1]);
1783  }
1784  }
1785  p = mp_DetBareiss(tmp, R);
1786  if ((k+l) & 1) p=p_Neg(p, R);
1787  MATELEM(result,l,k) = p;
1788  k++;
1789  idGetNextChoise(ar,a->ncols,&colch,colchoise);
1790  }
1791  idGetNextChoise(ar,a->nrows,&rowch,rowchoise);
1792  l++;
1793  }
1794 
1795  /*delete the matrix tmp*/
1796  for (i=1; i<=ar; i++)
1797  {
1798  for (j=1; j<=ar; j++) MATELEM(tmp,i,j) = NULL;
1799  }
1800  id_Delete((ideal *) &tmp, R);
1801  return (result);

◆ mpNew()

matrix mpNew ( int  r,
int  c 
)

create a r x c zero-matrix

Definition at line 36 of file matpol.cc.

38 {
39  int rr=r;
40  if (rr<=0) rr=1;
41  //if ( (((int)(MAX_INT_VAL/sizeof(poly))) / rr) <= c)
42  //{
43  // Werror("internal error: creating matrix[%d][%d]",r,c);
44  // return NULL;
45  //}
47  rc->nrows = r;
48  rc->ncols = c;
49  rc->rank = r;
50  if ((c != 0)&&(r!=0))
51  {
52  size_t s=((size_t)r)*((size_t)c)*sizeof(poly);
53  rc->m = (poly*)omAlloc0(s);
54  //if (rc->m==NULL)
55  //{
56  // Werror("internal error: creating matrix[%d][%d]",r,c);
57  // return NULL;
58  //}
59  }
60  return rc;

◆ pMultMp()

matrix pMultMp ( poly  p,
matrix  a,
const ring  r 
)

Definition at line 164 of file matpol.cc.

166 {
167  int k, n = a->nrows, m = a->ncols;
168 
169  p_Normalize(p, R);
170  for (k=m*n-1; k>0; k--)
171  {
172  if (a->m[k]!=NULL)
173  a->m[k] = p_Mult_q(p_Copy(p, R), a->m[k], R);
174  }
175  a->m[0] = p_Mult_q(p, a->m[0], R);
176  return a;

◆ sm_Add()

ideal sm_Add ( ideal  a,
ideal  b,
const ring  R 
)

Definition at line 1872 of file matpol.cc.

1875 {
1876  assume(IDELEMS(a)==IDELEMS(b));
1877  assume(a->rank==b->rank);
1878  ideal c=idInit(IDELEMS(a),a->rank);
1879  for (int k=IDELEMS(a)-1; k>=0; k--)
1880  c->m[k] = p_Add_q(p_Copy(a->m[k], R), p_Copy(b->m[k], R), R);

◆ sm_Compare()

int sm_Compare ( ideal  a,
ideal  b,
const ring  R 
)

Definition at line 1985 of file matpol.cc.

1988 {
1989  if (IDELEMS(a)<IDELEMS(b)) return -1;
1990  else if (IDELEMS(a)>IDELEMS(b)) return 1;
1991  if ((a->rank)<(b->rank)) return -1;
1992  else if ((a->rank)<(b->rank)) return 1;
1993 
1994  unsigned ii=IDELEMS(a)-1;
1995  unsigned j=0;
1996  int r=0;
1997  while (j<=ii)
1998  {
1999  r=p_Compare(a->m[j],b->m[j],R);
2000  if (r!=0) return r;
2001  j++;
2002  }

◆ sm_Equal()

BOOLEAN sm_Equal ( ideal  a,
ideal  b,
const ring  R 
)

Definition at line 2004 of file matpol.cc.

2007 {
2008  if ((a->rank!=b->rank) || (IDELEMS(a)!=IDELEMS(b)))
2009  return FALSE;
2010  int i=IDELEMS(a)-1;
2011  while (i>=0)
2012  {
2013  if (a->m[i]==NULL)
2014  {
2015  if (b->m[i]!=NULL) return FALSE;
2016  }
2017  else if (b->m[i]==NULL) return FALSE;
2018  else if (p_Cmp(a->m[i],b->m[i], R)!=0) return FALSE;
2019  i--;
2020  }
2021  i=IDELEMS(a)-1;
2022  while (i>=0)
2023  {
2024  if(!p_EqualPolys(a->m[i],b->m[i], R)) return FALSE;
2025  i--;
2026  }

◆ sm_Flatten()

ideal sm_Flatten ( ideal  a,
const ring  R 
)

Definition at line 1927 of file matpol.cc.

1930 {
1931  if (IDELEMS(a)==0) return id_Copy(a,R);
1932  ideal res=idInit(1,IDELEMS(a)*a->rank);
1933  for(int i=0;i<IDELEMS(a);i++)
1934  {
1935  if(a->m[i]!=NULL)
1936  {
1937  poly p=p_Copy(a->m[i],R);
1938  if (i==0) res->m[0]=p;
1939  else
1940  {
1941  p_Shift(&p,i*a->rank,R);
1942  res->m[0]=p_Add_q(res->m[0],p,R);
1943  }
1944  }
1945  }

◆ sm_Mult()

ideal sm_Mult ( ideal  a,
ideal  b,
const ring  R 
)

Definition at line 1892 of file matpol.cc.

1895 {
1896  int i, j, k;
1897  int m = a->rank;
1898  int p = IDELEMS(a);
1899  int q = IDELEMS(b);
1900 
1901  assume (IDELEMS(a)==b->rank);
1902  ideal c = idInit(q,m);
1903 
1904  for (i=0; i<m; i++)
1905  {
1906  for (k=0; k<p; k++)
1907  {
1908  poly aik;
1909  if ((aik=SMATELEM(a,i,k,R))!=NULL)
1910  {
1911  for (j=0; j<q; j++)
1912  {
1913  poly bkj=SMATELEM(b,k,j,R);
1914  if (bkj!=NULL)
1915  {
1916  poly s = p_Mult_q(p_Copy(aik,R) /*SMATELEM(a,i,k)*/, bkj/*SMATELEM(b,k,j)*/, R);
1917  if (s!=NULL) p_SetComp(s,i+1,R);
1918  c->m[j]=p_Add_q(c->m[j],s, R);
1919  }
1920  }
1921  p_Delete(&aik,R);
1922  }
1923  }
1924  }
1925  for(i=q-1;i>=0;i--) p_Normalize(c->m[i], R);

◆ sm_Sub()

ideal sm_Sub ( ideal  a,
ideal  b,
const ring  R 
)

Definition at line 1882 of file matpol.cc.

1885 {
1886  assume(IDELEMS(a)==IDELEMS(b));
1887  assume(a->rank==b->rank);
1888  ideal c=idInit(IDELEMS(a),a->rank);
1889  for (int k=IDELEMS(a)-1; k>=0; k--)
1890  c->m[k] = p_Sub(p_Copy(a->m[k], R), p_Copy(b->m[k], R), R);

◆ sm_Tensor()

ideal sm_Tensor ( ideal  A,
ideal  B,
const ring  r 
)

Definition at line 1833 of file matpol.cc.

1835 {
1836  // size of the result m*p x n*q
1837  int n=IDELEMS(A); // m x n
1838  int m=A->rank;
1839  int q=IDELEMS(B); // p x q
1840  int p=B->rank;
1841  ideal res=idInit(n*q,m*p);
1842  poly *a=(poly*)omAlloc(m*sizeof(poly));
1843  for(int i=0; i<n; i++)
1844  {
1845  memset(a,0,m*sizeof(poly));
1846  p_Vec2Array(A->m[i],a,m,r);
1847  for(int j=0;j<m;j++)
1848  {
1849  if (a[j]!=NULL)
1850  {
1851  ideal sm=sm_MultAndShift(a[j], // A_i_j
1852  B,
1853  j*p, // shift j*p down
1854  r);
1855  sm_AddSubMat(res,sm,i*q,r); // add this columns to col i*q ff
1856  id_Delete(&sm,r); // delete the now empty ideal
1857  }
1858  }
1859  }
1860  omFreeSize(a,m*sizeof(poly));
1861  return res;

◆ sm_Trace()

poly sm_Trace ( ideal  a,
const ring  R 
)

Definition at line 1974 of file matpol.cc.

1977 {
1978  int i;
1979  int n = (IDELEMS(a)<a->rank) ? IDELEMS(a) : a->rank;
1980  poly t = NULL;
1981 
1982  for (i=0; i<=n; i++)
1983  t = p_Add_q(t, p_Copy(SMATELEM(a,i,i,R), R), R);

◆ sm_UnFlatten()

ideal sm_UnFlatten ( ideal  a,
int  col,
const ring  R 
)

Definition at line 1947 of file matpol.cc.

1950 {
1951  if ((IDELEMS(a)!=1)
1952  ||((a->rank % col)!=0))
1953  {
1954  Werror("wrong format: %d x %d for unflatten",(int)a->rank,IDELEMS(a));
1955  return NULL;
1956  }
1957  int row=a->rank/col;
1958  ideal res=idInit(col,row);
1959  poly p=a->m[0];
1960  while(p!=NULL)
1961  {
1962  poly h=p_Head(p,R);
1963  int comp=p_GetComp(h,R);
1964  int c=(comp-1)/row;
1965  int r=comp%row; if (r==0) r=row;
1966  p_SetComp(h,r,R); p_SetmComp(h,R);
1967  res->m[c]=p_Add_q(res->m[c],h,R);
1968  pIter(p);
1969  }

◆ TraceOfProd()

poly TraceOfProd ( matrix  a,
matrix  b,
int  n,
const ring  r 
)

Definition at line 291 of file matpol.cc.

293 {
294  int i, j;
295  poly p, t = NULL;
296 
297  for (i=1; i<=n; i++)
298  {
299  for (j=1; j<=n; j++)
300  {
301  p = pp_Mult_qq(MATELEM(a,i,j), MATELEM(b,j,i), R);
302  t = p_Add_q(t, p, R);
303  }
304  }
305  return t;

Variable Documentation

◆ ip_smatrix_bin

omBin ip_smatrix_bin
dim
int dim(ideal I, ring r)
Definition: tropicalStrategy.cc:22
si_min
static int si_min(const int a, const int b)
Definition: auxiliary.h:139
FALSE
#define FALSE
Definition: auxiliary.h:94
sip_sideal_bin
omBin sip_sideal_bin
Definition: simpleideals.cc:28
matrix
ip_smatrix * matrix
Definition: matpol.h:30
p_GetComp
#define p_GetComp(p, r)
Definition: monomials.h:62
ip_smatrix
Definition: matpol.h:13
StringAppendS
void StringAppendS(const char *st)
Definition: reporter.cc:106
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:458
j
int j
Definition: facHensel.cc:105
f
FILE * f
Definition: checklibs.c:9
p_Normalize
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3720
k
int k
Definition: cfEzgcd.cc:92
p_Write0
void p_Write0(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:193
MATELEM
#define MATELEM(mat, i, j)
Definition: matpol.h:28
result
return result
Definition: facAbsBiFact.cc:76
mp_permmatrix::mpPivotBareiss
int mpPivotBareiss(row_col_weight *)
Definition: matpol.cc:1161
pEnlargeSet
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3644
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
mp_ElimBar
static void mp_ElimBar(matrix a0, matrix re, poly div, int lr, int lc, const ring R)
Definition: matpol.cc:1451
mp_SelectId
static poly mp_SelectId(ideal I, poly what, const ring R)
Definition: matpol.cc:768
p_Head
static poly p_Head(poly p, const ring r)
Definition: p_polys.h:811
p_Neg
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1029
mp_Select
static poly mp_Select(poly fro, poly what, const ring)
Definition: matpol.cc:750
mp_Exdiv
static poly mp_Exdiv(poly m, poly d, poly vars, const ring)
Definition: matpol.cc:563
mp_PrepareRow
static int mp_PrepareRow(matrix a, int lr, int lc, const ring R)
Definition: matpol.cc:1383
mp_InitP
matrix mp_InitP(int r, int c, poly p, const ring R)
make it a p * unit matrix
Definition: matpol.cc:112
idGetNextChoise
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
Definition: simpleideals.cc:854
__p_GetComp
#define __p_GetComp(p, r)
Definition: monomials.h:61
mp_RecMin
void mp_RecMin(int ar, ideal result, int &elems, matrix a, int lr, int lc, poly barDiv, ideal R, const ring r)
produces recursively the ideal of all arxar-minors of a
Definition: matpol.cc:1605
SMATELEM
#define SMATELEM(A, i, j, R)
Definition: matpol.h:107
mp_PartClean
static void mp_PartClean(matrix a, int lr, int lc, const ring R)
Definition: matpol.cc:806
omAllocBin
#define omAllocBin(bin)
Definition: omAllocDecl.h:203
Variable::next
Variable next() const
Definition: factory.h:137
StringEndS
char * StringEndS()
Definition: reporter.cc:150
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition: simpleideals.cc:767
loop
#define loop
Definition: structs.h:77
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
mp_permmatrix::mpGetElem
poly mpGetElem(int, int)
Definition: matpol.cc:1238
b
CanonicalForm b
Definition: cfModGcd.cc:4044
mpFinalClean
static void mpFinalClean(matrix a)
Definition: matpol.cc:1597
mp_permmatrix::mpColReorder
void mpColReorder()
Definition: matpol.cc:1100
p_SetmComp
#define p_SetmComp
Definition: p_polys.h:236
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:477
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:184
mp_permmatrix::mpElimBareiss
void mpElimBareiss(poly)
Definition: matpol.cc:1246
mp_MinorToResult
void mp_MinorToResult(ideal result, int &elems, matrix a, int r, int c, ideal R, const ring)
entries of a are minors and go to result (only if not in R)
Definition: matpol.cc:1509
row_col_weight
Definition: matpol.cc:890
sm_MultAndShift
static ideal sm_MultAndShift(poly f, ideal B, int s, const ring r)
Definition: matpol.cc:1805
sm_AddSubMat
static void sm_AddSubMat(ideal res, ideal sm, int col, const ring r)
Definition: matpol.cc:1824
for
for(int i=0;i<=n;i++) degsf[i]
Definition: cfEzgcd.cc:65
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:798
mp_permmatrix::mpGetRdim
int mpGetRdim()
Definition: matpol.cc:950
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
ip_smatrix::nrows
int nrows
Definition: matpol.h:20
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:113
rHasLocalOrMixedOrdering
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
p_Sub
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1934
res
CanonicalForm res
Definition: facAbsFact.cc:64
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
lc
CanonicalForm lc(const CanonicalForm &f)
Definition: canonicalform.h:297
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
p_Cmp
static int p_Cmp(poly p1, poly p2, ring r)
Definition: p_polys.h:1633
omfreeSize
#define omfreeSize(addr, size)
Definition: omAllocDecl.h:234
h
static Poly * h
Definition: janet.cc:972
mp_PreparePiv
static int mp_PreparePiv(matrix a, int lr, int lc, const ring r)
Definition: matpol.cc:1441
ip_smatrix::m
poly * m
Definition: matpol.h:18
p_String0
void p_String0(poly p, ring lmRing, ring tailRing)
print p according to ShortOut in lmRing & tailRing
Definition: polys0.cc:133
pp_Mult_qq
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1073
p_Write
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:203
pIter
#define pIter(p)
Definition: monomials.h:35
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
mp_permmatrix
Definition: matpol.cc:927
p_Compare
int p_Compare(const poly a, const poly b, const ring R)
Definition: p_polys.cc:4804
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
p_IsUnit
static BOOLEAN p_IsUnit(const poly p, const ring r)
Definition: p_polys.h:1934
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:36
p_Shift
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
Definition: p_polys.cc:4600
mp_permmatrix::mpRowReorder
void mpRowReorder()
Definition: matpol.cc:1121
mp_permmatrix::mpGetCdim
int mpGetCdim()
Definition: matpol.cc:951
div
CF_NO_INLINE CanonicalForm div(const CanonicalForm &, const CanonicalForm &)
CF_INLINE CanonicalForm div, mod ( const CanonicalForm & lhs, const CanonicalForm & rhs )
Definition: cf_inline.cc:553
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:878
p_One
poly p_One(const ring r)
Definition: p_polys.cc:1302
p_EqualPolys
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4406
StringSetS
void StringSetS(const char *st)
Definition: reporter.cc:127
si_max
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
Print
#define Print
Definition: emacs.cc:79
B
b *CanonicalForm B
Definition: facBivar.cc:52
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:188
idInitChoise
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
Definition: simpleideals.cc:832
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
p_Vec2Polys
void p_Vec2Polys(poly v, poly **p, int *len, const ring r)
Definition: p_polys.cc:3570
m
int m
Definition: cfEzgcd.cc:121
MATCOLS
#define MATCOLS(i)
Definition: matpol.h:27
assume
#define assume(x)
Definition: mod2.h:384
ip_smatrix::rank
long rank
Definition: matpol.h:19
NULL
#define NULL
Definition: omList.c:9
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:239
l
int l
Definition: cfEzgcd.cc:93
binom
int binom(int n, int r)
Definition: simpleideals.cc:912
R
#define R
Definition: sirandom.c:26
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:225
mp_DetBareiss
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
Definition: matpol.cc:1678
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
ip_smatrix::ncols
int ncols
Definition: matpol.h:21
p
int p
Definition: cfModGcd.cc:4019
p_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1907
p_Vec2Array
void p_Vec2Array(poly v, poly *p, int len, const ring r)
vector to already allocated array (len>=p_MaxComp(v,r))
Definition: p_polys.cc:3540
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
mp_permmatrix::mpSaveArray
void mpSaveArray()
Definition: matpol.cc:954
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1286
comp
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
Definition: facSparseHensel.h:25
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition: simpleideals.cc:403
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1036
prCopyR_NoSort
poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:77
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:63
id_Test
#define id_Test(A, lR)
Definition: simpleideals.h:79
MATROWS
#define MATROWS(i)
Definition: matpol.h:26
A
#define A
Definition: sirandom.c:23
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:36
pNext
#define pNext(p)
Definition: monomials.h:34
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
mp_permmatrix::mpGetSign
int mpGetSign()
Definition: matpol.cc:952