intvec.cc
Go to the documentation of this file.
1 /*****************************************
2 * Computer Algebra System SINGULAR *
3 *****************************************/
4 /*
5 * ABSTRACT: class intvec: lists/vectors of integers
6 */
7 #ifndef INTVEC_CC
8 #define INTVEC_CC
9 
10 #include <misc/auxiliary.h>
11 
12 // #include <resources/feFopen.h>
13 #include <misc/intvec.h>
14 #include <misc/options.h>
15 #include <omalloc/omalloc.h>
16 
17 #pragma GCC push_options
18 #pragma GCC optimize ("wrapv")
19 
20 /*0 implementation*/
21 
22 intvec::intvec(int s, int e)
23 {
24  int inc;
25  col = 1;
26  if (s<e)
27  {
28  row = e-s+1;
29  inc = 1;
30  }
31  else
32  {
33  row = s-e+1;
34  inc = -1;
35  }
36  v = (int *)omAlloc(sizeof(int)*row);
37  for (int i=0; i<row; i++)
38  {
39  v[i] = s;
40  s+=inc;
41  }
42 }
43 
44 intvec::intvec(int r, int c, int init)
45 {
46  row = r;
47  col = c;
48  int l = r*c;
49  if (l>0) /*(r>0) && (c>0) */
50  v = (int *)omAlloc(sizeof(int)*l);
51  else
52  v = NULL;
53  for (int i=0; i<l; i++)
54  {
55  v[i] = init;
56  }
57 }
58 
59 char * intvec::ivString(int not_mat,int spaces, int dim) const
60 {
61  //Print("ivString:this=%x,v=%x,row=%d\n",this,v,row);
62 #ifndef OM_NDEBUG
63  omCheckAddr((void *)this);
64  if (v!=NULL) omCheckAddr((void *)v);
65 #endif
66  StringSetS("");
67  if ((col == 1)&&(not_mat))
68  {
69  int i=0;
70  for (; i<row-1; i++)
71  {
72  StringAppend("%d,",v[i]);
73  }
74  if (i<row)
75  {
76  StringAppend("%d",v[i]);
77  }
78  }
79  else
80  {
81  for (int j=0; j<row; j++)
82  {
83  if (j<row-1)
84  {
85  for (int i=0; i<col; i++)
86  {
87  StringAppend("%d%c",v[j*col+i],',');
88  }
89  }
90  else
91  {
92  for (int i=0; i<col; i++)
93  {
94  StringAppend("%d%c",v[j*col+i],i<col-1 ? ',' : ' ');
95  }
96  }
97  if (j+1<row)
98  {
99  if (dim > 1) StringAppendS("\n");
100  if (spaces>0) StringAppend("%-*.*s",spaces,spaces," ");
101  }
102  }
103  }
104  return StringEndS();
105 }
106 
107 void intvec::resize(int new_length)
108 {
109  assume(new_length >= 0 && col == 1);
110  if (new_length==0)
111  {
112  if (v!=NULL)
113  {
114  omFreeSize(v, row*sizeof(int));
115  v=NULL;
116  }
117  }
118  else
119  {
120  if (v!=NULL)
121  v = (int*) omRealloc0Size(v, row*sizeof(int), new_length*sizeof(int));
122  else
123  v = (int*) omAlloc0(new_length*sizeof(int));
124  }
125  row = new_length;
126 }
127 
128 char * intvec::String(int dim) const
129 {
130  return ivString(1, 0, dim);
131 }
132 
133 #ifndef SING_NDEBUG
134 // debug only
135 void intvec::view () const
136 {
137  Print ("intvec: {rows: %d, cols: %d, length: %d, Values: \n", rows(), cols(), length());
138 
139  for (int i = 0; i < rows(); i++)
140  {
141  Print ("Row[%3d]:", i);
142  for (int j = 0; j < cols(); j++)
143  Print (" %5d", this->operator[]((i)*cols()+j) );
144  PrintLn ();
145  }
146  PrintS ("}\n");
147 }
148 #endif
149 
150 void intvec::show(int notmat,int spaces) const
151 {
152  char *s=ivString(notmat,spaces);
153  if (spaces>0)
154  {
155  PrintNSpaces(spaces);
156  PrintS(s);
157  }
158  else
159  {
160  PrintS(s);
161  }
162  omFree(s);
163 }
164 
165 void intvec::operator+=(int intop)
166 {
167  for (int i=0; i<row*col; i++) { v[i] += intop; }
168 }
169 
170 void intvec::operator-=(int intop)
171 {
172  for (int i=0; i<row*col; i++) { v[i] -= intop; }
173 }
174 
175 void intvec::operator*=(int intop)
176 {
177  for (int i=0; i<row*col; i++) { v[i] *= intop; }
178 }
179 
180 void intvec::operator/=(int intop)
181 {
182  if (intop == 0) return;
183  int bb=ABS(intop);
184  for (int i=0; i<row*col; i++)
185  {
186  int r=v[i];
187  int c=r%bb;
188  if (c<0) c+=bb;
189  r=(r-c)/intop;
190  v[i]=r;
191  }
192 }
193 
194 void intvec::operator%=(int intop)
195 {
196  if (intop == 0) return;
197  int bb=ABS(intop);
198  for (int i=0; i<row*col; i++)
199  {
200  int r=v[i];
201  int c=r%bb;
202  if (c<0) c+=bb;
203  v[i]=c;
204  }
205 }
206 
207 int intvec::compare(const intvec* op) const
208 {
209  if ((col!=1) ||(op->cols()!=1))
210  {
211  if((col!=op->cols())
212  || (row!=op->rows()))
213  return -2;
214  }
215  int i;
216  for (i=0; i<si_min(length(),op->length()); i++)
217  {
218  if (v[i] > (*op)[i])
219  return 1;
220  if (v[i] < (*op)[i])
221  return -1;
222  }
223  // this can only happen for intvec: (i.e. col==1)
224  for (; i<row; i++)
225  {
226  if (v[i] > 0)
227  return 1;
228  if (v[i] < 0)
229  return -1;
230  }
231  for (; i<op->rows(); i++)
232  {
233  if (0 > (*op)[i])
234  return 1;
235  if (0 < (*op)[i])
236  return -1;
237  }
238  return 0;
239 }
240 int intvec::compare(int o) const
241 {
242  for (int i=0; i<row*col; i++)
243  {
244  if (v[i] <o) return -1;
245  if (v[i] >o) return 1;
246  }
247  return 0;
248 }
249 
251 {
252  intvec * iv;
253  int mn, ma, i;
254  if (a->cols() != b->cols()) return NULL;
255  mn = si_min(a->rows(),b->rows());
256  ma = si_max(a->rows(),b->rows());
257  if (a->cols() == 1)
258  {
259  iv = new intvec(ma);
260  for (i=0; i<mn; i++) (*iv)[i] = (*a)[i] + (*b)[i];
261  if (ma > mn)
262  {
263  if (ma == a->rows())
264  {
265  for(i=mn; i<ma; i++) (*iv)[i] = (*a)[i];
266  }
267  else
268  {
269  for(i=mn; i<ma; i++) (*iv)[i] = (*b)[i];
270  }
271  }
272  return iv;
273  }
274  if (mn != ma) return NULL;
275  iv = new intvec(a);
276  for (i=0; i<mn*a->cols(); i++) { (*iv)[i] += (*b)[i]; }
277  return iv;
278 }
279 
281 {
282  intvec * iv;
283  int mn, ma, i;
284  if (a->cols() != b->cols()) return NULL;
285  mn = si_min(a->rows(),b->rows());
286  ma = si_max(a->rows(),b->rows());
287  if (a->cols() == 1)
288  {
289  iv = new intvec(ma);
290  for (i=0; i<mn; i++) (*iv)[i] = (*a)[i] - (*b)[i];
291  if (ma > mn)
292  {
293  if (ma == a->rows())
294  {
295  for(i=mn; i<ma; i++) (*iv)[i] = (*a)[i];
296  }
297  else
298  {
299  for(i=mn; i<ma; i++) (*iv)[i] = -(*b)[i];
300  }
301  }
302  return iv;
303  }
304  if (mn != ma) return NULL;
305  iv = new intvec(a);
306  for (i=0; i<mn*a->cols(); i++) { (*iv)[i] -= (*b)[i]; }
307  return iv;
308 }
309 
311 {
312  int i, j, r = o->rows(), c = o->cols();
313  intvec * iv= new intvec(c, r, 0);
314  for (i=0; i<r; i++)
315  {
316  for (j=0; j<c; j++)
317  (*iv)[j*r+i] = (*o)[i*c+j];
318  }
319  return iv;
320 }
321 
322 int ivTrace(intvec * o)
323 {
324  int i, s = 0, m = si_min(o->rows(),o->cols()), c = o->cols();
325  for (i=0; i<m; i++)
326  {
327  s += (*o)[i*c+i];
328  }
329  return s;
330 }
331 
333 {
334  int i, j, k, sum,
335  ra = a->rows(), ca = a->cols(),
336  rb = b->rows(), cb = b->cols();
337  intvec * iv;
338  if (ca != rb) return NULL;
339  iv = new intvec(ra, cb, 0);
340  for (i=0; i<ra; i++)
341  {
342  for (j=0; j<cb; j++)
343  {
344  sum = 0;
345  for (k=0; k<ca; k++)
346  sum += (*a)[i*ca+k]*(*b)[k*cb+j];
347  (*iv)[i*cb+j] = sum;
348  }
349  }
350  return iv;
351 }
352 
353 /*2
354 *computes a triangular matrix
355 */
356 //void ivTriangMat(intvec * imat)
357 //{
358 // int i=0,j=imat->rows(),k=j*imat->cols()-1;
359 //
360 // ivTriangIntern(imat,i,j);
361 // i *= imat->cols();
362 // for(j=k;j>=i;j--)
363 // (*imat)[j] = 0;
364 //}
365 
366 /* def. internals */
367 static int ivColPivot(intvec *, int, int, int, int);
368 static void ivNegRow(intvec *, int);
369 static void ivSaveRow(intvec *, int);
370 static void ivSetRow(intvec *, int, int);
371 static void ivFreeRow(intvec *, int, int);
372 static void ivReduce(intvec *, int, int, int, int);
373 static void ivZeroElim(intvec *,int, int, int &);
374 static void ivRowContent(intvec *, int, int);
375 static void ivKernFromRow(intvec *, intvec *, intvec *,
376  int, int, int);
377 static intvec * ivOptimizeKern(intvec *);
378 static int ivGcd(int, int);
379 static void ivOptRecursive(intvec *, intvec *, intvec *,
380  int &, int &, int);
381 static void ivOptSolve(intvec *, intvec *, int &, int &);
382 static void ivContent(intvec *);
383 static int ivL1Norm(intvec *);
384 static int ivCondNumber(intvec *, int);
385 
386 /* Triangulierung in intmat.cc */
387 void ivTriangIntern(intvec *imat, int &ready, int &all)
388 {
389  int rpiv, colpos=0, rowpos=0;
390  int ia=ready, ie=all;
391 
392  do
393  {
394  rowpos++;
395  do
396  {
397  colpos++;
398  rpiv = ivColPivot(imat, colpos, rowpos, ia, ie);
399  } while (rpiv==0);
400  if (rpiv>ia)
401  {
402  if (rowpos!=rpiv)
403  {
404  ivSaveRow(imat, rpiv);
405  ivFreeRow(imat, rowpos, rpiv);
406  ivSetRow(imat, rowpos, colpos);
407  rpiv = rowpos;
408  }
409  ia++;
410  if (ia==imat->cols())
411  {
412  ready = ia;
413  all = ie;
414  return;
415  }
416  }
417  ivReduce(imat, rpiv, colpos, ia, ie);
418  ivZeroElim(imat, colpos, ia, ie);
419  } while (ie>ia);
420  ready = ia;
421  all = ie;
422 }
423 
424 /* Kernberechnung in intmat.cc */
425 intvec * ivSolveKern(intvec *imat, int dimtr)
426 {
427  int d=imat->cols();
428  int kdim=d-dimtr;
429  intvec *perm = new intvec(dimtr+1);
430  intvec *kern = new intvec(kdim,d,0);
431  intvec *res;
432  int c, cp, r, t;
433 
434  t = kdim;
435  c = 1;
436  for (r=1;r<=dimtr;r++)
437  {
438  while (IMATELEM(*imat,r,c)==0) c++;
439  (*perm)[r] = c;
440  c++;
441  }
442  c = d;
443  for (r=dimtr;r>0;r--)
444  {
445  cp = (*perm)[r];
446  if (cp!=c)
447  {
448  ivKernFromRow(kern, imat, perm, t, r, c);
449  t -= (c-cp);
450  if (t==0)
451  break;
452  c = cp-1;
453  }
454  else
455  c--;
456  }
457  if (kdim>1)
458  res = ivOptimizeKern(kern);
459  else
460  res = ivTranp(kern);
461  delete kern;
462  delete perm;
463  return res;
464 }
465 
466 /* internals */
467 static int ivColPivot(intvec *imat, int colpos, int rowpos, int ready, int all)
468 {
469  int rpiv;
470 
471  if (IMATELEM(*imat,rowpos,colpos)!=0)
472  return rowpos;
473  for (rpiv=ready+1;rpiv<=all;rpiv++)
474  {
475  if (IMATELEM(*imat,rpiv,colpos)!=0)
476  return rpiv;
477  }
478  return 0;
479 }
480 
481 static void ivNegRow(intvec *imat, int rpiv)
482 {
483  int i;
484  for (i=imat->cols();i!=0;i--)
485  IMATELEM(*imat,rpiv,i) = -(IMATELEM(*imat,rpiv,i));
486 }
487 
488 static void ivSaveRow(intvec *imat, int rpiv)
489 {
490  int i, j=imat->rows();
491 
492  for (i=imat->cols();i!=0;i--)
493  IMATELEM(*imat,j,i) = IMATELEM(*imat,rpiv,i);
494 }
495 
496 static void ivSetRow(intvec *imat, int rowpos, int colpos)
497 {
498  int i, j=imat->rows();
499 
500  for (i=imat->cols();i!=0;i--)
501  IMATELEM(*imat,rowpos,i) = IMATELEM(*imat,j,i);
502  ivRowContent(imat, rowpos, colpos);
503 }
504 
505 static void ivFreeRow(intvec *imat, int rowpos, int rpiv)
506 {
507  int i, j;
508 
509  for (j=rpiv-1;j>=rowpos;j--)
510  {
511  for (i=imat->cols();i!=0;i--)
512  IMATELEM(*imat,j+1,i) = IMATELEM(*imat,j,i);
513  }
514 }
515 
516 static void ivReduce(intvec *imat, int rpiv, int colpos,
517  int ready, int all)
518 {
519  int tgcd, ce, m1, m2, j, i;
520  int piv = IMATELEM(*imat,rpiv,colpos);
521 
522  for (j=all;j>ready;j--)
523  {
524  ivRowContent(imat, j, 1);
525  ce = IMATELEM(*imat,j,colpos);
526  if (ce!=0)
527  {
528  IMATELEM(*imat,j,colpos) = 0;
529  m1 = piv;
530  m2 = ce;
531  tgcd = ivGcd(m1, m2);
532  if (tgcd != 1)
533  {
534  m1 /= tgcd;
535  m2 /= tgcd;
536  }
537  for (i=imat->cols();i>colpos;i--)
538  {
539  IMATELEM(*imat,j,i) = IMATELEM(*imat,j,i)*m1-
540  IMATELEM(*imat,rpiv,i)*m2;
541  }
542  ivRowContent(imat, j, colpos+1);
543  }
544  }
545 }
546 
547 static void ivZeroElim(intvec *imat, int colpos,
548  int ready, int &all)
549 {
550  int j, i, k, l;
551 
552  k = ready;
553  for (j=ready+1;j<=all;j++)
554  {
555  for (i=imat->cols();i>colpos;i--)
556  {
557  if (IMATELEM(*imat,j,i)!=0)
558  {
559  k++;
560  if (k<j)
561  {
562  for (l=imat->cols();l>colpos;l--)
563  IMATELEM(*imat,k,l) = IMATELEM(*imat,j,l);
564  }
565  break;
566  }
567  }
568  }
569  all = k;
570 }
571 
572 static void ivRowContent(intvec *imat, int rowpos, int colpos)
573 {
574  int tgcd, m;
575  int i=imat->cols();
576 
577  loop
578  {
579  tgcd = IMATELEM(*imat,rowpos,i--);
580  if (tgcd!=0) break;
581  if (i<colpos) return;
582  }
583  if (tgcd<0) tgcd = -tgcd;
584  if (tgcd==1) return;
585  loop
586  {
587  m = IMATELEM(*imat,rowpos,i--);
588  if (m!=0) tgcd= ivGcd(tgcd, m);
589  if (tgcd==1) return;
590  if (i<colpos) break;
591  }
592  for (i=imat->cols();i>=colpos;i--)
593  IMATELEM(*imat,rowpos,i) /= tgcd;
594 }
595 
596 static void ivKernFromRow(intvec *kern, intvec *imat,
597  intvec *perm, int pos, int r, int c)
598 {
599  int piv, cp, g, i, j, k, s;
600 
601  for (i=c;i>(*perm)[r];i--)
602  {
603  IMATELEM(*kern,pos,i) = 1;
604  for (j=r;j!=0;j--)
605  {
606  cp = (*perm)[j];
607  s=0;
608  for(k=c;k>cp;k--)
609  s += IMATELEM(*imat,j,k)*IMATELEM(*kern,pos,k);
610  if (s!=0)
611  {
612  piv = IMATELEM(*imat,j,cp);
613  g = ivGcd(piv,s);
614  if (g!=1)
615  {
616  s /= g;
617  piv /= g;
618  }
619  for(k=c;k>cp;k--)
620  IMATELEM(*kern,pos,k) *= piv;
621  IMATELEM(*kern,pos,cp) = -s;
622  ivRowContent(kern,pos,cp);
623  }
624  }
625  if (IMATELEM(*kern,pos,i)<0)
626  ivNegRow(kern,pos);
627  pos--;
628  }
629 }
630 
631 static int ivGcd(int a,int b)
632 {
633  int x;
634 
635  if (a<0) a=-a;
636  if (b<0) b=-b;
637  if (b>a)
638  {
639  x=b;
640  b=a;
641  a=x;
642  }
643  while (b!=0)
644  {
645  x = a % b;
646  a = b;
647  b = x;
648  }
649  return a;
650 }
651 
652 static intvec * ivOptimizeKern(intvec *kern)
653 {
654  int i,l,j,c=kern->cols(),r=kern->rows();
655  intvec *res=new intvec(c);
656 
657  if (TEST_OPT_PROT)
658  Warn(" %d linear independent solutions\n",r);
659  for (i=r;i>1;i--)
660  {
661  for (j=c;j>0;j--)
662  {
663  (*res)[j-1] += IMATELEM(*kern,i,j);
664  }
665  }
666  ivContent(res);
667  if (r<11)
668  {
669  l = ivCondNumber(res,-c);
670  j = ivL1Norm(res);
671  ivOptRecursive(res, NULL, kern, l, j, r);
672  }
673  return res;
674 }
675 
676 static void ivOptRecursive(intvec *res, intvec *w, intvec *kern,
677  int &l, int &j, int pos)
678 {
679  int m, k, d;
680  intvec *h;
681 
682  d=kern->rows();
683  d=96/(d*d);
684  if (d<3) d=3;
685  if (w!=0)
686  h = new intvec(w);
687  else
688  h = new intvec(res->rows());
689  for (m=d;m>0;m--)
690  {
691  for(k=h->rows()-1;k>=0;k--)
692  (*h)[k] += IMATELEM(*kern,pos,k+1);
693  if(pos>1)
694  ivOptRecursive(res, h, kern, l, j, pos-1);
695  else
696  ivOptSolve(res, h, l, j);
697  }
698  delete h;
699  if (pos>1)
700  ivOptRecursive(res, w, kern, l, j, pos-1);
701  else if (w!=NULL)
702  ivOptSolve(res, w, l, j);
703 }
704 
705 static void ivOptSolve(intvec *res, intvec *w, int &l, int &j)
706 {
707  int l0, j0, k;
708 
709  l0 = ivCondNumber(w, l);
710  if (l0==l)
711  {
712  ivContent(w);
713  j0 = ivL1Norm(w);
714  if(j0<j)
715  {
716  j = j0;
717  for(k=w->rows()-1;k>=0;k--)
718  (*res)[k] = (*w)[k];
719  }
720  return;
721  }
722  if(l0>l)
723  {
724  l = l0;
725  ivContent(w);
726  j = ivL1Norm(w);
727  for(k=w->rows()-1;k>=0;k--)
728  (*res)[k] = (*w)[k];
729  }
730 }
731 
732 static int ivL1Norm(intvec *w)
733 {
734  int i, j, s = 0;
735 
736  for (i=w->rows()-1;i>=0;i--)
737  {
738  j = (*w)[i];
739  if (j>0)
740  s += j;
741  else
742  s -= j;
743  }
744  return s;
745 }
746 
747 static int ivCondNumber(intvec *w, int l)
748 {
749  int l0=0, i;
750 
751  if (l<0)
752  {
753  for (i=w->rows()-1;i>=0;i--)
754  {
755  if ((*w)[i]<0) l0--;
756  }
757  if (l0==0)
758  {
759  for (i=w->rows()-1;i>=0;i--)
760  {
761  if ((*w)[i]>0) l0++;
762  }
763  }
764  return l0;
765  }
766  else
767  {
768  for (i=w->rows()-1;i>=0;i--)
769  {
770  if ((*w)[i]<0) return -1;
771  }
772  for (i=w->rows()-1;i>=0;i--)
773  {
774  if ((*w)[i]>0) l0++;
775  }
776  return l0;
777  }
778 }
779 
780 static void ivContent(intvec *w)
781 {
782  int tgcd, m;
783  int i=w->rows()-1;
784 
785  loop
786  {
787  tgcd = (*w)[i--];
788  if (tgcd!=0) break;
789  if (i<0) return;
790  }
791  if (tgcd<0) tgcd = -tgcd;
792  if (tgcd==1) return;
793  loop
794  {
795  m = (*w)[i--];
796  if (m!=0) tgcd= ivGcd(tgcd, m);
797  if (tgcd==1) return;
798  if (i<0) break;
799  }
800  for (i=w->rows()-1;i>=0;i--)
801  (*w)[i] /= tgcd;
802 }
803 
804 // columnwise concatination of two intvecs
806 {
807  int ac=a->cols();
808  int c = ac + b->cols(); int r = si_max(a->rows(),b->rows());
809  intvec * ab = new intvec(r,c,0);
810 
811  int i,j;
812  for (i=1; i<=a->rows(); i++)
813  {
814  for(j=1; j<=ac; j++)
815  IMATELEM(*ab,i,j) = IMATELEM(*a,i,j);
816  }
817  for (i=1; i<=b->rows(); i++)
818  {
819  for(j=1; j<=b->cols(); j++)
820  IMATELEM(*ab,i,j+ac) = IMATELEM(*b,i,j);
821  }
822  return ab;
823 }
824 
825 #pragma GCC pop_options
826 
827 #endif
void operator-=(int intop)
Definition: intvec.cc:170
#define omRealloc0Size(addr, o_size, size)
Definition: omAllocDecl.h:221
const CanonicalForm int s
Definition: facAbsFact.cc:55
static void ivNegRow(intvec *, int)
Definition: intvec.cc:481
void resize(int new_length)
Definition: intvec.cc:107
const poly a
Definition: syzextra.cc:212
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
static intvec * ivOptimizeKern(intvec *)
Definition: intvec.cc:652
#define TEST_OPT_PROT
Definition: options.h:98
loop
Definition: myNF.cc:98
static int si_min(const int a, const int b)
Definition: auxiliary.h:167
static void ivZeroElim(intvec *, int, int, int &)
Definition: intvec.cc:547
static int ivL1Norm(intvec *)
Definition: intvec.cc:732
static int ivGcd(int, int)
Definition: intvec.cc:631
intvec(int l=1)
Definition: intvec.h:22
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void operator/=(int intop)
Definition: intvec.cc:180
int length() const
Definition: intvec.h:86
static void ivFreeRow(intvec *, int, int)
Definition: intvec.cc:505
intvec * ivSub(intvec *a, intvec *b)
Definition: intvec.cc:280
intvec * ivTranp(intvec *o)
Definition: intvec.cc:310
g
Definition: cfModGcd.cc:4031
int k
Definition: cfEzgcd.cc:93
char * StringEndS()
Definition: reporter.cc:151
static void ivSaveRow(intvec *, int)
Definition: intvec.cc:488
#define omAlloc(size)
Definition: omAllocDecl.h:210
void operator+=(int intop)
Definition: intvec.cc:165
static void ivContent(intvec *)
Definition: intvec.cc:780
char * String(int dim=2) const
Definition: intvec.cc:128
int * v
Definition: intvec.h:17
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
int row
Definition: intvec.h:18
static int ivColPivot(intvec *, int, int, int, int)
Definition: intvec.cc:467
Definition: intvec.h:14
void operator%=(int intop)
Definition: intvec.cc:194
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
void ivTriangIntern(intvec *imat, int &ready, int &all)
Definition: intvec.cc:387
#define assume(x)
Definition: mod2.h:405
void StringSetS(const char *st)
Definition: reporter.cc:128
void operator*=(int intop)
Definition: intvec.cc:175
int compare(const intvec *o) const
Definition: intvec.cc:207
void StringAppendS(const char *st)
Definition: reporter.cc:107
All the auxiliary stuff.
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int dim(ideal I, ring r)
#define StringAppend
Definition: emacs.cc:82
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
static void ivOptRecursive(intvec *, intvec *, intvec *, int &, int &, int)
Definition: intvec.cc:676
intvec * ivConcat(intvec *a, intvec *b)
Definition: intvec.cc:805
static void ivReduce(intvec *, int, int, int, int)
Definition: intvec.cc:516
static void ivSetRow(intvec *, int, int)
Definition: intvec.cc:496
intvec * ivMult(intvec *a, intvec *b)
Definition: intvec.cc:332
int col
Definition: intvec.h:19
#define NULL
Definition: omList.c:10
int cols() const
Definition: intvec.h:87
char * ivString(int not_mat=1, int spaces=0, int dim=2) const
Definition: intvec.cc:59
static void ivKernFromRow(intvec *, intvec *, intvec *, int, int, int)
Definition: intvec.cc:596
int rows() const
Definition: intvec.h:88
#define ABS(x)
Definition: auxiliary.h:157
const CanonicalForm & w
Definition: facAbsFact.cc:55
Variable x
Definition: cfModGcd.cc:4023
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
intvec * ivSolveKern(intvec *imat, int dimtr)
Definition: intvec.cc:425
static void ivOptSolve(intvec *, intvec *, int &, int &)
Definition: intvec.cc:705
#define omCheckAddr(addr)
Definition: omAllocDecl.h:328
static void ivRowContent(intvec *, int, int)
Definition: intvec.cc:572
int perm[100]
static Poly * h
Definition: janet.cc:978
static int ivCondNumber(intvec *, int)
Definition: intvec.cc:747
#define IMATELEM(M, I, J)
Definition: intvec.h:77
const poly b
Definition: syzextra.cc:213
void PrintNSpaces(const int n)
Definition: reporter.cc:381
int ivTrace(intvec *o)
Definition: intvec.cc:322
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
intvec * ivAdd(intvec *a, intvec *b)
Definition: intvec.cc:250
void view() const
Definition: intvec.cc:135
#define Warn
Definition: emacs.cc:80