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