My Project  UNKNOWN_GIT_VERSION
bbfan.cc
Go to the documentation of this file.
1 #include "kernel/mod2.h"
2 
3 #if HAVE_GFANLIB
4 
5 #include "misc/intvec.h"
6 #include "coeffs/coeffs.h"
7 #include "coeffs/bigintmat.h"
8 
9 #include "Singular/ipid.h"
10 #include "Singular/ipshell.h"
11 #include "Singular/blackbox.h"
12 
13 #include "Singular/links/ssiLink.h"
14 
15 #include "callgfanlib_conversion.h"
16 #include "bbfan.h"
17 #include "gfan.h"
18 
19 int fanID;
20 
21 void* bbfan_Init(blackbox* /*b*/)
22 {
23  return (void*) new gfan::ZFan(0);
24 }
25 
26 void bbfan_destroy(blackbox* /*b*/, void *d)
27 {
28  if (d!=NULL)
29  {
30  gfan::ZFan* zf = (gfan::ZFan*) d;
31  delete zf;
32  }
33 }
34 
35 char* bbfan_String(blackbox* /*b*/, void *d)
36 {
37  if (d==NULL) return omStrDup("invalid object");
38  else
39  {
40  gfan::initializeCddlibIfRequired();
41  gfan::ZFan* zf = (gfan::ZFan*)d;
42  std::string s = zf->toString(2+4+8+128);
43  gfan::deinitializeCddlibIfRequired();
44  return omStrDup(s.c_str());
45 // =======
46 // std::stringstream s;
47 // std::string raysAndCones = zf->toStringJustRaysAndMaximalCones();
48 // s << raysAndCones;
49 // if (zf->getDimension() >= 0) // <=> zf is not empty
50 // {
51 // assert(zf->numberOfConesOfDimension(zf->getDimension()-zf->getLinealityDimension(),0,0));
52 // gfan::ZCone zc = zf->getCone(zf->getDimension()-zf->getLinealityDimension(),0,0,0);
53 // gfan::ZMatrix genLinSpace = zc.generatorsOfLinealitySpace();
54 // char* gens = toString(genLinSpace);
55 // s << std::endl << "GENERATORS_LINEALITY_SPACE:" << std::endl;
56 // s << gens;
57 // }
58 // std::string sstring = s.str();
59 // return omStrDup(sstring.c_str());
60 // >>>>>>> status updated 11.03.
61  }
62 }
63 
64 void* bbfan_Copy(blackbox* /*b*/, void *d)
65 {
66  gfan::ZFan* zf = (gfan::ZFan*)d;
67  gfan::ZFan* newZf = new gfan::ZFan(*zf);
68  return newZf;
69 }
70 
72 {
73  gfan::ZFan* newZf;
74  if (r==NULL)
75  {
76  if (l->Data()!=NULL)
77  {
78  gfan::ZFan* zd = (gfan::ZFan*) l->Data();
79  delete zd;
80  }
81  newZf = new gfan::ZFan(0);
82  }
83  else if (r->Typ()==l->Typ())
84  {
85  if (l->Data()!=NULL)
86  {
87  gfan::ZFan* zd = (gfan::ZFan*) l->Data();
88  delete zd;
89  }
90  newZf = (gfan::ZFan*) r->CopyD();
91  }
92  else if (r->Typ()==INT_CMD)
93  {
94  int ambientDim = (int) (long) r->Data();
95  if (ambientDim < 0)
96  {
97  Werror("expected an int >= 0, but got %d", ambientDim);
98  return TRUE;
99  }
100  if (l->Data()!=NULL)
101  {
102  gfan::ZFan* zd = (gfan::ZFan*) l->Data();
103  delete zd;
104  }
105  newZf = new gfan::ZFan(ambientDim);
106  }
107  else
108  {
109  Werror("assign Type(%d) = Type(%d) not implemented",l->Typ(),r->Typ());
110  return TRUE;
111  }
112 
113  if (l->rtyp==IDHDL)
114  {
115  IDDATA((idhdl)l->data) = (char*) newZf;
116  }
117  else
118  {
119  l->data = (void*) newZf;
120  }
121  return FALSE;
122 }
123 
124 /* returns 1 iff all rows consist of entries 1..n,
125  where n is the number of columns of the provided
126  bigintmat; 0 otherwise */
127 static gfan::IntMatrix permutationIntMatrix(const bigintmat* iv)
128 {
129  int cc = iv->cols();
130  int rr = iv->rows();
131  bigintmat* ivCopy = new bigintmat(rr, cc, coeffs_BIGINT);
132  number temp1 = n_Init(1,coeffs_BIGINT);
133  for (int r = 1; r <= rr; r++)
134  for (int c = 1; c <= cc; c++)
135  {
136  number temp2 = n_Sub(IMATELEM(*iv, r, c),temp1,coeffs_BIGINT);
137  ivCopy->set(r,c,temp2);
138  n_Delete(&temp2,coeffs_BIGINT);
139  }
140  n_Delete(&temp1,coeffs_BIGINT);
141  gfan::ZMatrix* zm = bigintmatToZMatrix(ivCopy);
142  gfan::IntMatrix im = gfan::IntMatrix(gfan::ZToIntMatrix(*zm));
143  delete zm;
144  return im;
145 }
147 {
148  int ambientDim = (int)(long)v->Data();
149  if (ambientDim < 0)
150  {
151  Werror("expected non-negative ambient dim but got %d", ambientDim);
152  return TRUE;
153  }
154  res->rtyp = fanID;
155  res->data = (void*)(new gfan::ZFan(ambientDim));
156  return FALSE;
157 }
158 
160 {
161  bigintmat* permutations = (bigintmat*)v->Data();
162  int ambientDim = permutations->cols();
163  gfan::IntMatrix im = permutationIntMatrix(permutations);
164  if (!gfan::Permutation::arePermutations(im))
165  {
166  Werror("provided bigintmat contains invalid permutations of {1, ..., %d}", ambientDim);
167  return TRUE;
168  }
169  gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
170  sg.computeClosure(im);
171  res->rtyp = fanID;
172  res->data = (void*)(new gfan::ZFan(sg));
173  return FALSE;
174 }
175 
177 {
178  leftv u = args;
179  if (u == NULL)
180  {
181  res->rtyp = fanID;
182  res->data = (void*) new gfan::ZFan(0);
183  return FALSE;
184  }
185  if ((u != NULL) && (u->Typ() == INT_CMD))
186  {
187  if (u->next == NULL) return jjFANEMPTY_I(res, u);
188  }
189  if ((u != NULL) && (u->Typ() == BIGINTMAT_CMD))
190  {
191  if (u->next == NULL) return jjFANEMPTY_IM(res, u);
192  }
193  WerrorS("emptyFan: unexpected parameters");
194  return TRUE;
195 }
196 
198 {
199  int ambientDim = (int)(long)v->Data();
200  if (ambientDim < 0)
201  {
202  Werror("expected non-negative ambient dim but got %d", ambientDim);
203  return TRUE;
204  }
205  gfan::ZFan* zf = new gfan::ZFan(gfan::ZFan::fullFan(ambientDim));
206  res->rtyp = fanID;
207  res->data = (void*) zf;
208  return FALSE;
209 }
211 {
212  bigintmat* permutations = (bigintmat*)v->Data();
213  int ambientDim = permutations->cols();
214  gfan::IntMatrix im = permutationIntMatrix(permutations);
215  if (!gfan::Permutation::arePermutations(im))
216  {
217  Werror("provided bigintmat contains invalid permutations of {1, ..., %d}", ambientDim);
218  return TRUE;
219  }
220  gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
221  sg.computeClosure(im);
222  gfan::ZFan* zf = new gfan::ZFan(gfan::ZFan::fullFan(sg));
223  res->rtyp = fanID;
224  res->data = (void*) zf;
225  return FALSE;
226 }
227 
229 {
230  gfan::initializeCddlibIfRequired();
231  leftv u = args;
232  if (u == NULL)
233  {
234  res->rtyp = fanID;
235  res->data = (void*) new gfan::ZFan(0);
236  return FALSE;
237  }
238  if ((u != NULL) && (u->Typ() == INT_CMD))
239  if (u->next == NULL) return jjFANFULL_I(res, u);
240  if ((u != NULL) && (u->Typ() == BIGINTMAT_CMD))
241  if (u->next == NULL) return jjFANFULL_IM(res, u);
242  WerrorS("fullFan: unexpected parameters");
243  return TRUE;
244 }
245 
246 int getAmbientDimension(gfan::ZFan* zf)
247 {
248  return zf->getAmbientDimension();
249 }
250 
251 int getCodimension(gfan::ZFan* zf)
252 {
253  return zf->getCodimension();
254 }
255 
256 int getDimension(gfan::ZFan* zf)
257 {
258  return zf->getDimension();
259 }
260 
261 int getLinealityDimension(gfan::ZFan* zf)
262 {
263  return zf->getLinealityDimension();
264 }
265 
267 {
268  leftv u=args;
269  if ((u != NULL) && (u->Typ() == fanID))
270  {
271  leftv v=u->next;
272  if ((v != NULL) && (v->Typ() == INT_CMD))
273  {
274  leftv w=v->next;
275  if ((w != NULL) && (w->Typ() == INT_CMD))
276  {
277  leftv x=w->next;
278  if ((x != NULL) && (x->Typ() == INT_CMD))
279  {
280  gfan::initializeCddlibIfRequired();
281  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
282  int d = (int)(long)v->Data();
283  int o = (int)(long)w->Data();
284  int m = (int)(long)x->Data();
285  if ( (0<=d) && (d <= zf->getAmbientDimension())
286  && ((o == 0) || (o == 1))
287  && ((m == 0) || (m == 1)))
288  {
289  bool oo = (bool) o;
290  bool mm = (bool) m;
291  int ld = zf->getLinealityDimension();
292  if (d-ld>=0)
293  {
294  int n = zf->numberOfConesOfDimension(d-ld,oo,mm);
295  res->rtyp = INT_CMD;
296  res->data = (void*) (long) n;
297  gfan::deinitializeCddlibIfRequired();
298  return FALSE;
299  }
300  res->rtyp = INT_CMD;
301  res->data = (void*) (long) 0;
302  gfan::deinitializeCddlibIfRequired();
303  return FALSE;
304  }
305  }
306  }
307  }
308  }
309  WerrorS("numberOfConesOfDimension: unexpected parameters");
310  return TRUE;
311 }
312 
314 {
315  leftv u=args;
316  if ((u != NULL) && (u->Typ() == fanID))
317  {
318  gfan::initializeCddlibIfRequired();
319  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
320  int d = zf->getAmbientDimension();
321  int n = 0;
322 
323  for (int i=0; i<=d; i++)
324  n = n + zf->numberOfConesOfDimension(i,0,0);
325 
326  res->rtyp = INT_CMD;
327  res->data = (void*) (long) n;
328  gfan::deinitializeCddlibIfRequired();
329  return FALSE;
330  }
331  WerrorS("ncones: unexpected parameters");
332  return TRUE;
333 }
334 
336 {
337  leftv u=args;
338  if ((u != NULL) && (u->Typ() == fanID))
339  {
340  gfan::initializeCddlibIfRequired();
341  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
342 
343  int n = 0;
344  for (int d=0; d<=zf->getAmbientDimension(); d++)
345  n = n + zf->numberOfConesOfDimension(d,0,1);
346 
347  res->rtyp = INT_CMD;
348  res->data = (void*) (long) n;
349  gfan::deinitializeCddlibIfRequired();
350  return FALSE;
351  }
352  WerrorS("nmaxcones: unexpected parameters");
353  return TRUE;
354 }
355 
356 bool isCompatible(const gfan::ZFan* zf, const gfan::ZCone* zc)
357 {
358  bool b = (zf->getAmbientDimension() == zc->ambientDimension());
359  if(b)
360  {
361  for (int d=0; d<=zf->getAmbientDimension(); d++)
362  {
363  for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
364  {
365  gfan::ZCone zd = zf->getCone(d,i,0,1);
366  gfan::ZCone zt = gfan::intersection(*zc,zd);
367  zt.canonicalize();
368  b = b && zd.hasFace(zt);
369  }
370  }
371  }
372  return b;
373 }
374 
376 {
377  leftv u=args;
378  if ((u != NULL) && (u->Typ() == fanID))
379  {
380  leftv v=u->next;
381  if ((v != NULL) && (v->Typ() == coneID))
382  {
383  gfan::initializeCddlibIfRequired();
384  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
385  gfan::ZCone* zc = (gfan::ZCone*)v->Data();
386  int b = isCompatible(zf,zc);
387  res->rtyp = INT_CMD;
388  res->data = (void*) (long) b;
389  gfan::deinitializeCddlibIfRequired();
390  return FALSE;
391  }
392  }
393  WerrorS("isCompatible: unexpected parameters");
394  return TRUE;
395 }
396 
398 {
399  leftv u=args;
400  if ((u != NULL) && (u->rtyp==IDHDL) && (u->e==NULL) && (u->Typ() == fanID))
401  {
402  leftv v=u->next;
403  if ((v != NULL) && (v->Typ() == coneID))
404  {
405  gfan::initializeCddlibIfRequired();
406  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
407  gfan::ZCone* zc = (gfan::ZCone*)v->Data();
408  zc->canonicalize();
409 
410  leftv w=v->next;
411  int n=1;
412  if ((w != NULL) && (w->Typ() == INT_CMD))
413  n = (int)(long) w->Data();
414 
415  if (n != 0)
416  {
417  if (!isCompatible(zf,zc))
418  {
419  WerrorS("insertCone: cone and fan not compatible");
420  gfan::deinitializeCddlibIfRequired();
421  return TRUE;
422  }
423  }
424 
425  zf->insert(*zc);
426  res->rtyp = NONE;
427  res->data = NULL;
428  IDDATA((idhdl)u->data) = (char*) zf;
429  gfan::deinitializeCddlibIfRequired();
430  return FALSE;
431  }
432  }
433  WerrorS("insertCone: unexpected parameters");
434  return TRUE;
435 }
436 
437 bool containsInCollection(gfan::ZFan* zf, gfan::ZCone* zc)
438 {
439  gfan::ZVector zv=zc->getRelativeInteriorPoint();
440  for (int d=0; d<=zf->getAmbientDimension(); d++)
441  {
442  for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
443  {
444  gfan::ZCone zd = zf->getCone(d,i,0,1);
445  zd.canonicalize();
446  if (zd.containsRelatively(zv))
447  {
448  gfan::ZCone temp = *zc;
449  temp.canonicalize();
450  return (!(zd != temp));
451  }
452  }
453  }
454  return 0;
455 }
456 
458 {
459  leftv u=args;
460  if ((u != NULL) && (u->Typ() == fanID))
461  {
462  leftv v=u->next;
463  if ((v != NULL) && (v->Typ() == coneID))
464  {
465  gfan::initializeCddlibIfRequired();
466  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
467  gfan::ZCone* zc = (gfan::ZCone*)v->Data();
468  if((zf->getAmbientDimension() == zc->ambientDimension()))
469  {
470  res->rtyp = INT_CMD;
471  res->data = (void*) (long) (int) containsInCollection(zf,zc);
472  gfan::deinitializeCddlibIfRequired();
473  return FALSE;
474  }
475  gfan::deinitializeCddlibIfRequired();
476  WerrorS("containsInCollection: mismatching ambient dimensions");
477  return TRUE;
478  }
479  }
480  WerrorS("containsInCollection: unexpected parameters");
481  return TRUE;
482 }
483 
484 // BOOLEAN coneContaining(leftv res, leftv args)
485 // {
486 // leftv u=args;
487 // if ((u != NULL) && (u->Typ() == fanID))
488 // {
489 // leftv v=u->next;
490 // if ((v != NULL) && ((v->Typ() == BIGINTMAT_CMD) || (v->Typ() == INTVEC_CMD)))
491 // {
492 // gfan::ZFan* zf = (gfan::ZFan*)u->Data();
493 // gfan::ZVector* point;
494 // if (v->Typ() == INTVEC_CMD)
495 // {
496 // intvec* w0 = (intvec*) v->Data();
497 // bigintmat* w1 = iv2bim(w0,coeffs_BIGINT);
498 // w1->inpTranspose();
499 // point = bigintmatToZVector(*w1);
500 // delete w1;
501 // }
502 // else
503 // {
504 // bigintmat* w1 = (bigintmat*) v->Data();
505 // point = bigintmatToZVector(*w1);
506 // }
507 // lists L = (lists)omAllocBin(slists_bin);
508 // res->rtyp = LIST_CMD;
509 // res->data = (void*) L;
510 // delete point;
511 // return FALSE;
512 // }
513 // }
514 // WerrorS("coneContaining: unexpected parameters");
515 // return TRUE;
516 // }
517 
519 {
520  leftv u=args;
521  if ((u != NULL) && (u->Typ() == fanID))
522  {
523  leftv v=u->next;
524  if ((v != NULL) && (v->Typ() == coneID))
525  {
526  gfan::initializeCddlibIfRequired();
527  gfan::ZFan* zf = (gfan::ZFan*)u->Data();
528  gfan::ZCone* zc = (gfan::ZCone*)v->Data();
529  zc->canonicalize();
530 
531  leftv w=v->next; int n = 1;
532  if ((w != NULL) && (w->Typ() == INT_CMD))
533  n = (int)(long) w;
534 
535  if (n != 0)
536  {
537  if (!containsInCollection(zf,zc))
538  {
539  WerrorS("removeCone: cone not contained in fan");
540  gfan::deinitializeCddlibIfRequired();
541  return TRUE;
542  }
543  }
544 
545  zf->remove(*zc);
546  res->rtyp = NONE;
547  res->data = NULL;
548  IDDATA((idhdl)u->data) = (char*) zf;
549  gfan::deinitializeCddlibIfRequired();
550  return FALSE;
551  }
552  }
553  WerrorS("removeCone: unexpected parameters");
554  return TRUE;
555 }
556 
558 {
559  leftv u=args;
560  if ((u != NULL) && (u->Typ() == fanID))
561  {
562  leftv v=u->next;
563  if ((v != NULL) && (v->Typ() == INT_CMD))
564  {
565  leftv w=v->next;
566  if ((w != NULL) && (w->Typ() == INT_CMD))
567  {
568  gfan::initializeCddlibIfRequired();
569  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
570  int d = (int)(long)v->Data();
571  int i = (int)(long)w->Data();
572  int o = -1;
573  int m = -1;
574  leftv x=w->next;
575  if ((x != NULL) && (x->Typ() == INT_CMD))
576  {
577  o = (int)(long)x->Data();
578  leftv y=x->next;
579  if ((y != NULL) && (y->Typ() == INT_CMD))
580  {
581  m = (int)(long)y->Data();
582  }
583  }
584  if (o == -1) o = 0;
585  if (m == -1) m = 0;
586  if (((o == 0) || (o == 1)) && ((m == 0) || (m == 1)))
587  {
588  bool oo = (bool) o;
589  bool mm = (bool) m;
590  if (0<=d && d<=zf->getAmbientDimension())
591  {
592  int ld = zf->getLinealityDimension();
593  if (0<i && i<=zf->numberOfConesOfDimension(d-ld,oo,mm))
594  {
595  i=i-1;
596  if (d-ld>=0)
597  {
598  gfan::ZCone zc = zf->getCone(d-ld,i,oo,mm);
599  res->rtyp = coneID;
600  res->data = (void*)new gfan::ZCone(zc);
601  gfan::deinitializeCddlibIfRequired();
602  return FALSE;
603  }
604  else
605  {
606  WerrorS("getCone: invalid dimension; no cones in this dimension");
607  gfan::deinitializeCddlibIfRequired();
608  return TRUE;
609  }
610  }
611  else
612  {
613  WerrorS("getCone: invalid index");
614  gfan::deinitializeCddlibIfRequired();
615  return TRUE;
616  }
617  }
618  else
619  {
620  WerrorS("getCone: invalid dimension");
621  gfan::deinitializeCddlibIfRequired();
622  return TRUE;
623  }
624  }
625  else
626  {
627  WerrorS("getCone: invalid specifier for orbit or maximal");
628  gfan::deinitializeCddlibIfRequired();
629  return TRUE;
630  }
631  }
632  }
633  }
634  WerrorS("getCone: unexpected parameters");
635  return TRUE;
636 }
637 
639 {
640  leftv u=args;
641  if ((u != NULL) && (u->Typ() == fanID))
642  {
643  leftv v=u->next;
644  if ((v != NULL) && (v->Typ() == INT_CMD))
645  {
646  gfan::initializeCddlibIfRequired();
647  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
648  int d = (int)(long)v->Data();
649  int o = -1;
650  int m = -1;
651  leftv w=v->next;
652  if ((w != NULL) && (w->Typ() == INT_CMD))
653  {
654  o = (int)(long)w->Data();
655  leftv x=w->next;
656  if ((x != NULL) && (x->Typ() == INT_CMD))
657  {
658  m = (int)(long)x->Data();
659  }
660  }
661  if (o == -1) o = 0;
662  if (m == -1) m = 0;
663  if (((o == 0) || (o == 1)) && ((m == 0) || (m == 1)))
664  {
665  bool oo = (bool) o;
666  bool mm = (bool) m;
667  if (0<=d && d<=zf->getAmbientDimension())
668  {
669  int ld = zf->getLinealityDimension();
670  if (d-ld>=0)
671  {
673  int n = zf->numberOfConesOfDimension(d-ld,oo,mm);
674  L->Init(n);
675  for (int i=0; i<n; i++)
676  {
677  gfan::ZCone zc = zf->getCone(d-ld,i,oo,mm);
678  L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(zc);
679  }
680  res->rtyp = LIST_CMD;
681  res->data = (void*) L;
682  gfan::deinitializeCddlibIfRequired();
683  return FALSE;
684  }
685  else
686  {
687  WerrorS("getCones: invalid dimension; no cones in this dimension");
688  gfan::deinitializeCddlibIfRequired();
689  return TRUE;
690  }
691  }
692  else
693  {
694  WerrorS("getCones: invalid dimension");
695  gfan::deinitializeCddlibIfRequired();
696  return TRUE;
697  }
698  }
699  else
700  {
701  WerrorS("getCones: invalid specifier for orbit or maximal");
702  gfan::deinitializeCddlibIfRequired();
703  return TRUE;
704  }
705  }
706  }
707  WerrorS("getCones: unexpected parameters");
708  return TRUE;
709 }
710 
711 int isSimplicial(gfan::ZFan* zf)
712 {
713  int i = zf->isSimplicial() ? 1 : 0;
714  return i;
715 }
716 
718 {
719  leftv u=args;
720  if ((u != NULL) && (u->Typ() == fanID))
721  {
722  gfan::initializeCddlibIfRequired();
723  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
724  int b = zf->isPure();
725  res->rtyp = INT_CMD;
726  res->data = (void*) (long) b;
727  gfan::deinitializeCddlibIfRequired();
728  return FALSE;
729  }
730  WerrorS("isPure: unexpected parameters");
731  return TRUE;
732 }
733 
734 // BOOLEAN isComplete(leftv res, leftv args)
735 // {
736 // leftv u=args;
737 // if ((u != NULL) && (u->Typ() == fanID))
738 // {
739 // gfan::ZFan* zf = (gfan::ZFan*) u->Data();
740 // int b = zf->isComplete();
741 // res->rtyp = INT_CMD;
742 // res->data = (void*) (long) b;
743 // return FALSE;
744 // }
745 // WerrorS("isComplete: unexpected parameters");
746 // return TRUE;
747 // }
748 
750 {
751  leftv u=args;
752  if ((u != NULL) && (u->Typ() == fanID))
753  {
754  gfan::initializeCddlibIfRequired();
755  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
756  gfan::ZVector zv=zf->getFVector();
757  res->rtyp = BIGINTMAT_CMD;
758  res->data = (void*) zVectorToBigintmat(zv);
759  gfan::deinitializeCddlibIfRequired();
760  return FALSE;
761  }
762  WerrorS("fVector: unexpected parameters");
763  return TRUE;
764 }
765 
766 gfan::ZMatrix rays(const gfan::ZFan* const zf)
767 {
768  gfan::ZMatrix rays(0,zf->getAmbientDimension());
769  for (int i=0; i<zf->numberOfConesOfDimension(1,0,0); i++)
770  {
771  gfan::ZCone zc = zf->getCone(1, i, 0, 0);
772  rays.append(zc.extremeRays());
773  }
774  return rays;
775 }
776 
777 int numberOfConesWithVector(gfan::ZFan* zf, gfan::ZVector* v)
778 {
779  int count = 0;
780  int ambientDim = zf->getAmbientDimension();
781  for (int i=0; i<zf->numberOfConesOfDimension(ambientDim, 0, 0); i++)
782  {
783  gfan::ZCone zc = zf->getCone(ambientDim, i, 0, 0);
784  if (zc.contains(*v))
785  {
786  count = count +1;
787  if (count > 1)
788  return count;
789  }
790  }
791  return count;
792 }
793 
795 {
796  leftv u=args;
797  if ((u != NULL) && (u->Typ() == fanID))
798  {
799  leftv v=u->next;
800  if ((v != NULL) && (v->Typ() == BIGINTMAT_CMD))
801  {
802  gfan::initializeCddlibIfRequired();
803  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
804  bigintmat* v0 = (bigintmat*) v->Data();
805  int ambientDim = zf->getAmbientDimension();
806  if (ambientDim != v0->cols())
807  {
808  WerrorS("numberOfConesWithVector: mismatching dimensions");
809  gfan::deinitializeCddlibIfRequired();
810  return TRUE;
811  }
812  gfan::ZVector* v1 = bigintmatToZVector(*v0);
813  int count = numberOfConesWithVector(zf, v1);
814  delete v1;
815  res->rtyp = INT_CMD;
816  res->data = (void*) (long) count;
817  gfan::deinitializeCddlibIfRequired();
818  return FALSE;
819  }
820  }
821  WerrorS("numberOfConesWithVector: unexpected parameters");
822  return TRUE;
823 }
824 
826 {
827  leftv u=args;
828  if ((u != NULL) && (u->Typ() == STRING_CMD))
829  {
830  gfan::initializeCddlibIfRequired();
831  std::string fanInString = (char*) u->Data();
832  std::istringstream s(fanInString);
833  gfan::ZFan* zf = new gfan::ZFan(s);
834  res->rtyp = fanID;
835  res->data = (void*) zf;
836  gfan::deinitializeCddlibIfRequired();
837  return FALSE;
838  }
839  WerrorS("fanFromString: unexpected parameters");
840  return TRUE;
841 }
842 
844 {
845  leftv u=args;
846  if ((u != NULL) && (u->Typ() == LIST_CMD))
847  {
848  lists L = (lists) u->Data();
849  if (lSize(L)>-1)
850  {
851  gfan::initializeCddlibIfRequired();
852  if (L->m[0].Typ() != coneID)
853  {
854  WerrorS("fanViaCones: list contains entries of wrong type");
855  return TRUE;
856  }
857  gfan::ZCone* zc = (gfan::ZCone*) L->m[0].Data();
858  gfan::ZFan* zf = new gfan::ZFan(zc->ambientDimension());
859  zf->insert(*zc);
860  for (int i=1; i<=lSize(L); i++)
861  {
862  if (L->m[i].Typ() != coneID)
863  {
864  WerrorS("fanViaCones: entries of wrong type in list");
865  gfan::deinitializeCddlibIfRequired();
866  return TRUE;
867  }
868  gfan::ZCone* zc = (gfan::ZCone*) L->m[i].Data();
869  if (zc->ambientDimension() != zf->getAmbientDimension())
870  {
871  WerrorS("fanViaCones: inconsistent ambient dimensions amongst cones in list");
872  gfan::deinitializeCddlibIfRequired();
873  return TRUE;
874  }
875  zf->insert(*zc);
876  }
877  res->rtyp = fanID;
878  res->data = (void*) zf;
879  gfan::deinitializeCddlibIfRequired();
880  return FALSE;
881  }
882  res->rtyp = fanID;
883  res->data = (void*) new gfan::ZFan(0);
884  return FALSE;
885  }
886  if ((u != NULL) && (u->Typ() == coneID))
887  {
888  gfan::initializeCddlibIfRequired();
889  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
890  gfan::ZFan* zf = new gfan::ZFan(zc->ambientDimension());
891  zf->insert(*zc);
892  while (u->next != NULL)
893  {
894  u = u->next;
895  if (u->Typ() != coneID)
896  {
897  WerrorS("fanViaCones: arguments of wrong type");
898  gfan::deinitializeCddlibIfRequired();
899  delete zf;
900  return TRUE;
901  }
902  gfan::ZCone* zc = (gfan::ZCone*) u->Data();
903  if (zc->ambientDimension() != zf->getAmbientDimension())
904  {
905  WerrorS("fanViaCones: inconsistent ambient dimensions amongst input cones");
906  gfan::deinitializeCddlibIfRequired();
907  delete zf;
908  return TRUE;
909  }
910  zf->insert(*zc);
911  }
912  res->rtyp = fanID;
913  res->data = (void*) zf;
914  gfan::deinitializeCddlibIfRequired();
915  return FALSE;
916  }
917  if (u == NULL)
918  {
919  res->rtyp = fanID;
920  res->data = (void*) new gfan::ZFan(0);
921  return FALSE;
922  }
923  WerrorS("fanViaCones: unexpected parameters");
924  return TRUE;
925 }
926 
927 
928 // BOOLEAN tropicalVariety(leftv res, leftv args)
929 // {
930 // leftv u=args;
931 // if ((u != NULL) && (u->Typ() == POLY_CMD))
932 // {
933 // int n = rVar(currRing);
934 // gfan::ZFan* zf = new gfan::ZFan(n);
935 // int* expv1 = (int*)omAlloc((n+1)*sizeof(int));
936 // int* expv2 = (int*)omAlloc((n+1)*sizeof(int));
937 // int* expvr = (int*)omAlloc((n+1)*sizeof(int));
938 // gfan::ZVector expw1 = gfan::ZVector(n);
939 // gfan::ZVector expw2 = gfan::ZVector(n);
940 // gfan::ZVector expwr = gfan::ZVector(n);
941 // gfan::ZMatrix eq, ineq;
942 // for (poly s1=(poly)u->Data(); s1!=NULL; pIter(s1))
943 // {
944 // pGetExpV(s1,expv1);
945 // expw1 = intStar2ZVector(n,expv1);
946 // for (poly s2=pNext(s1); s2!=NULL; pIter(s2))
947 // {
948 // pGetExpV(s2,expv2);
949 // expw2 = intStar2ZVector(n,expv2);
950 // eq = gfan::ZMatrix(0,n);
951 // eq.appendRow(expw1-expw2);
952 // ineq = gfan::ZMatrix(0,n);
953 // for (poly r=(poly)u->Data(); r!=NULL; pIter(r))
954 // {
955 // pGetExpV(r,expvr);
956 // expwr = intStar2ZVector(n,expvr);
957 // if ((r!=s1) && (r!=s2))
958 // {
959 // ineq.appendRow(expw1-expwr);
960 // }
961 // }
962 // gfan::ZCone zc = gfan::ZCone(ineq,eq);
963 // zf->insert(zc);
964 // }
965 // }
966 // omFreeSize(expv1,(n+1)*sizeof(int));
967 // omFreeSize(expv2,(n+1)*sizeof(int));
968 // omFreeSize(expvr,(n+1)*sizeof(int));
969 // res->rtyp = fanID;
970 // res->data = (void*) zf;
971 // return FALSE;
972 // }
973 // WerrorS("tropicalVariety: unexpected parameters");
974 // return TRUE;
975 // }
976 
977 gfan::ZFan commonRefinement(gfan::ZFan zf, gfan::ZFan zg)
978 {
979  assume(zf.getAmbientDimension() == zg.getAmbientDimension());
980 
981  // gather all maximal cones of f and g
982  std::list<gfan::ZCone> maximalConesOfF;
983  for (int d=0; d<=zf.getAmbientDimension(); d++)
984  for (int i=0; i<zf.numberOfConesOfDimension(d,0,1); i++)
985  maximalConesOfF.push_back(zf.getCone(d,i,0,1));
986 
987  std::list<gfan::ZCone> maximalConesOfG;
988  for (int d=0; d<=zg.getAmbientDimension(); d++)
989  for (int i=0; i<zg.numberOfConesOfDimension(d,0,1); i++)
990  maximalConesOfG.push_back(zg.getCone(d,i,0,1));
991 
992  // construct a new fan out of their intersections
993  gfan::ZFan zr = gfan::ZFan(zf.getAmbientDimension());
994  for (std::list<gfan::ZCone>::iterator itf=maximalConesOfF.begin();
995  itf != maximalConesOfF.end(); itf++)
996  for (std::list<gfan::ZCone>::iterator itg=maximalConesOfG.begin();
997  itg != maximalConesOfG.end(); itg++)
998  zr.insert(intersection(*itf,*itg));
999 
1000  return zr;
1001 }
1002 
1004 {
1005  leftv u=args;
1006  if ((u != NULL) && (u->Typ() == fanID))
1007  {
1008  leftv v=u->next;
1009  if ((v != NULL) && (v->Typ() == fanID))
1010  {
1011  gfan::initializeCddlibIfRequired();
1012  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
1013  gfan::ZFan* zg = (gfan::ZFan*) v->Data();
1014  gfan::ZFan* zr = new gfan::ZFan(commonRefinement(*zf,*zg));
1015  res->rtyp = fanID;
1016  res->data = (void*) zr;
1017  gfan::deinitializeCddlibIfRequired();
1018  return FALSE;
1019  }
1020  }
1021  WerrorS("commonRefinement: unexpected parameters");
1022  return TRUE;
1023 }
1024 
1025 // BOOLEAN grFan(leftv res, leftv h)
1026 // {
1027 // /*======== GFAN ==============*/
1028 // /*
1029 // WILL HAVE TO CHANGE RETURN TYPE TO LIST_CMD
1030 // */
1031 // /*
1032 // heuristic:
1033 // 0 = keep all Groebner bases in memory
1034 // 1 = write all Groebner bases to disk and read whenever necessary
1035 // 2 = use a mixed heuristic, based on length of Groebner bases
1036 // */
1037 // if( h!=NULL && h->Typ()==IDEAL_CMD && h->next!=NULL && h->next->Typ()==INT_CMD)
1038 // {
1039 // int heuristic;
1040 // heuristic=(int)(long)h->next->Data();
1041 // ideal I=((ideal)h->Data());
1042 // #ifndef USE_ZFAN
1043 // #define USE_ZFAN
1044 // #endif
1045 // #ifndef USE_ZFAN
1046 // res->rtyp=LIST_CMD; //res->rtyp=coneID; res->data(void*)zcone;
1047 // res->data=(lists) grfan(I,heuristic,FALSE);
1048 // #else
1049 // res->rtyp=fanID;
1050 // res->data=(void*)(grfan(I,heuristic,FALSE));
1051 // #endif
1052 // return FALSE;
1053 // }
1054 // else
1055 // {
1056 // WerrorS("Usage: grfan(<ideal>,<int>)");
1057 // return TRUE;
1058 // }
1059 // }
1060  //Possibility to have only one Groebner cone computed by specifying a weight vector FROM THE RELATIVE INTERIOR!
1061  //Needs wp as ordering!
1062 // if(strcmp(sys_cmd,"grcone")==0)
1063 // {
1064 // if(h!=NULL && h->Typ()==IDEAL_CMD && h->next!=NULL && h->next->Typ()==INT_CMD)
1065 // {
1066 // ideal I=((ideal)h->Data());
1067 // res->rtyp=LIST_CMD;
1068 // res->data=(lists)grcone_by_intvec(I);
1069 // }
1070 // }
1071 
1072 
1073 BOOLEAN bbfan_serialize(blackbox *b, void *d, si_link f)
1074 {
1075  ssiInfo *dd = (ssiInfo *)f->data;
1076 
1077  sleftv l;
1078  memset(&l,0,sizeof(l));
1079  l.rtyp=STRING_CMD;
1080  l.data=(void*)"fan";
1081  f->m->Write(f, &l);
1082 
1083  gfan::ZFan* zf = (gfan::ZFan*) d;
1084  std::string s = zf->toString(2+4+8+128);
1085 
1086  fprintf(dd->f_write,"%d %s ",(int)s.size(),s.c_str());
1087 
1088  return FALSE;
1089 }
1090 
1091 
1092 BOOLEAN bbfan_deserialize(blackbox **b, void **d, si_link f)
1093 {
1094  ssiInfo *dd = (ssiInfo *)f->data;
1095 
1096  int l = s_readint(dd->f_read);
1097  char* buf = (char*) omAlloc0(l+1);
1098  (void) s_getc(dd->f_read); // skip whitespace
1099  (void) s_readbytes(buf,l,dd->f_read);
1100  buf[l]='\0';
1101 
1102  std::istringstream fanInString(std::string(buf,l));
1103  gfan::ZFan* zf = new gfan::ZFan(fanInString);
1104  *d=zf;
1105 
1106  omFree(buf);
1107  return FALSE;
1108 }
1109 
1110 
1112 {
1113  blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
1114  // all undefined entries will be set to default in setBlackboxStuff
1115  // the default Print is quite usefule,
1116  // all other are simply error messages
1117  b->blackbox_destroy=bbfan_destroy;
1118  b->blackbox_String=bbfan_String;
1119  //b->blackbox_Print=blackbox_default_Print;
1120  b->blackbox_Init=bbfan_Init;
1121  b->blackbox_Copy=bbfan_Copy;
1122  b->blackbox_Assign=bbfan_Assign;
1123  b->blackbox_serialize=bbfan_serialize;
1124  b->blackbox_deserialize=bbfan_deserialize;
1125  p->iiAddCproc("gfan.lib","emptyFan",FALSE,emptyFan);
1126  p->iiAddCproc("gfan.lib","fullFan",FALSE,fullFan);
1127  /* the following functions are implemented in bbcone.cc */
1128  // iiAddCproc("gfan.lib","containsInSupport",FALSE,containsInSupport);
1129  // iiAddCproc("gfan.lib","getAmbientDimension",FALSE,getAmbientDimension);
1130  // iiAddCproc("gfan.lib","getCodimension",FALSE,getDimension);
1131  // iiAddCproc("gfan.lib","getDimension",FALSE,getDimension);
1132  // iiAddCproc("gfan.lib","getLinealityDimension",FALSE,getLinealityDimension);
1133  // iiAddCproc("gfan.lib","isSimplicial",FALSE,isSimplicial);
1134  /********************************************************/
1135  p->iiAddCproc("gfan.lib","isCompatible",FALSE,isCompatible);
1136  p->iiAddCproc("gfan.lib","numberOfConesOfDimension",FALSE,numberOfConesOfDimension);
1137  p->iiAddCproc("gfan.lib","ncones",FALSE,ncones);
1138  p->iiAddCproc("gfan.lib","nmaxcones",FALSE,nmaxcones);
1139  p->iiAddCproc("gfan.lib","insertCone",FALSE,insertCone);
1140  p->iiAddCproc("gfan.lib","removeCone",FALSE,removeCone);
1141  p->iiAddCproc("gfan.lib","getCone",FALSE,getCone);
1142  p->iiAddCproc("gfan.lib","getCones",FALSE,getCones);
1143  p->iiAddCproc("gfan.lib","isPure",FALSE,isPure);
1144  p->iiAddCproc("gfan.lib","fanFromString",FALSE,fanFromString);
1145  p->iiAddCproc("gfan.lib","fanViaCones",FALSE,fanViaCones);
1146  p->iiAddCproc("gfan.lib","numberOfConesWithVector",FALSE,numberOfConesWithVector);
1147  // iiAddCproc("gfan.lib","isComplete",FALSE,isComplete); not working as expected, should leave this to polymake
1148  p->iiAddCproc("gfan.lib","fVector",FALSE,fVector);
1149  p->iiAddCproc("gfan.lib","containsInCollection",FALSE,containsInCollection);
1150  // p->iiAddCproc("gfan.lib","tropicalVariety",FALSE,tropicalVariety);
1151  p->iiAddCproc("gfan.lib","commonRefinement",FALSE,commonRefinement);
1152  // iiAddCproc("gfan.lib","grFan",FALSE,grFan);
1153  fanID=setBlackboxStuff(b,"fan");
1154  //Print("created type %d (fan)\n",fanID);
1155 }
1156 
1157 #endif
1158 // gfan::ZFan commonRefinementCompleteFans(const gfan::ZFan &zf, const gfan::ZFan &zg)
1159 // {
1160 // assume(zf->getAmbientDimension() == zg->getAmbientDimension());
1161 
1162 // gfan::ZFan zfg = gfan::ZFan(zf->getAmbientDimension());
1163 // int d = zf->getAmbientDimension();
1164 // for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
1165 // for (int j=0; j<zg->numberOfConesOfDimension(d,0,1); j++)
1166 // {
1167 // gfan::ZCone zc = intersection(zf->getCone(d,i,0,1),zg->getCone(d,j,0,1));
1168 // if (zc.dimension()==d) zgf.insert(zc);
1169 // }
1170 
1171 // return zfg;
1172 // }
int BOOLEAN
Definition: auxiliary.h:85
#define TRUE
Definition: auxiliary.h:98
#define FALSE
Definition: auxiliary.h:94
int coneID
Definition: bbcone.cc:25
BOOLEAN nmaxcones(leftv res, leftv args)
Definition: bbfan.cc:335
int getDimension(gfan::ZFan *zf)
Definition: bbfan.cc:256
BOOLEAN numberOfConesOfDimension(leftv res, leftv args)
Definition: bbfan.cc:266
BOOLEAN emptyFan(leftv res, leftv args)
Definition: bbfan.cc:176
BOOLEAN fanViaCones(leftv res, leftv args)
Definition: bbfan.cc:843
bool containsInCollection(gfan::ZFan *zf, gfan::ZCone *zc)
Definition: bbfan.cc:437
BOOLEAN fullFan(leftv res, leftv args)
Definition: bbfan.cc:228
static BOOLEAN jjFANFULL_I(leftv res, leftv v)
Definition: bbfan.cc:197
int fanID
Definition: bbfan.cc:19
BOOLEAN getCones(leftv res, leftv args)
Definition: bbfan.cc:638
char * bbfan_String(blackbox *, void *d)
Definition: bbfan.cc:35
BOOLEAN fanFromString(leftv res, leftv args)
Definition: bbfan.cc:825
BOOLEAN isPure(leftv res, leftv args)
Definition: bbfan.cc:717
int numberOfConesWithVector(gfan::ZFan *zf, gfan::ZVector *v)
Definition: bbfan.cc:777
BOOLEAN ncones(leftv res, leftv args)
Definition: bbfan.cc:313
void * bbfan_Copy(blackbox *, void *d)
Definition: bbfan.cc:64
BOOLEAN bbfan_deserialize(blackbox **b, void **d, si_link f)
Definition: bbfan.cc:1092
int isSimplicial(gfan::ZFan *zf)
Definition: bbfan.cc:711
static BOOLEAN jjFANEMPTY_I(leftv res, leftv v)
Definition: bbfan.cc:146
BOOLEAN removeCone(leftv res, leftv args)
Definition: bbfan.cc:518
int getCodimension(gfan::ZFan *zf)
Definition: bbfan.cc:251
void bbfan_destroy(blackbox *, void *d)
Definition: bbfan.cc:26
gfan::ZFan commonRefinement(gfan::ZFan zf, gfan::ZFan zg)
Definition: bbfan.cc:977
void * bbfan_Init(blackbox *)
Definition: bbfan.cc:21
BOOLEAN getCone(leftv res, leftv args)
Definition: bbfan.cc:557
BOOLEAN bbfan_Assign(leftv l, leftv r)
Definition: bbfan.cc:71
void bbfan_setup(SModulFunctions *p)
Definition: bbfan.cc:1111
static BOOLEAN jjFANFULL_IM(leftv res, leftv v)
Definition: bbfan.cc:210
BOOLEAN bbfan_serialize(blackbox *b, void *d, si_link f)
Definition: bbfan.cc:1073
gfan::ZMatrix rays(const gfan::ZFan *const zf)
Definition: bbfan.cc:766
static BOOLEAN jjFANEMPTY_IM(leftv res, leftv v)
Definition: bbfan.cc:159
int getLinealityDimension(gfan::ZFan *zf)
Definition: bbfan.cc:261
bool isCompatible(const gfan::ZFan *zf, const gfan::ZCone *zc)
Definition: bbfan.cc:356
BOOLEAN insertCone(leftv res, leftv args)
Definition: bbfan.cc:397
static gfan::IntMatrix permutationIntMatrix(const bigintmat *iv)
Definition: bbfan.cc:127
int getAmbientDimension(gfan::ZFan *zf)
Definition: bbfan.cc:246
BOOLEAN fVector(leftv res, leftv args)
Definition: bbfan.cc:749
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition: blackbox.cc:126
gfan::ZMatrix * bigintmatToZMatrix(const bigintmat &bim)
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int l
Definition: cfEzgcd.cc:93
int m
Definition: cfEzgcd.cc:121
int i
Definition: cfEzgcd.cc:125
Variable x
Definition: cfModGcd.cc:4023
int p
Definition: cfModGcd.cc:4019
CanonicalForm b
Definition: cfModGcd.cc:4044
FILE * f
Definition: checklibs.c:9
Variable next() const
Definition: factory.h:137
Matrices of numbers.
Definition: bigintmat.h:52
int cols() const
Definition: bigintmat.h:145
int rows() const
Definition: bigintmat.h:146
Definition: idrec.h:35
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void * CopyD(int t)
Definition: subexpr.cc:745
int Typ()
Definition: subexpr.cc:1039
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1182
leftv next
Definition: subexpr.h:86
void * data
Definition: subexpr.h:88
Subexpr e
Definition: subexpr.h:105
Definition: lists.h:23
sleftv * m
Definition: lists.h:45
INLINE_THIS void Init(int l=0)
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
Definition: coeffs.h:669
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:538
const CanonicalForm int s
Definition: facAbsFact.cc:55
const CanonicalForm int const CFList const Variable & y
Definition: facAbsFact.cc:57
CanonicalForm res
Definition: facAbsFact.cc:64
const CanonicalForm & w
Definition: facAbsFact.cc:55
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
void WerrorS(const char *s)
Definition: feFopen.cc:24
@ BIGINTMAT_CMD
Definition: grammar.cc:278
#define IMATELEM(M, I, J)
Definition: intvec.h:83
intvec * ivCopy(const intvec *o)
Definition: intvec.h:133
coeffs coeffs_BIGINT
Definition: ipid.cc:52
#define IDDATA(a)
Definition: ipid.h:121
#define string
Definition: libparse.cc:1250
omBin slists_bin
Definition: lists.cc:23
int lSize(lists L)
Definition: lists.cc:25
#define assume(x)
Definition: mod2.h:390
slists * lists
Definition: mpr_numeric.h:146
#define omStrDup(s)
Definition: omAllocDecl.h:263
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define NULL
Definition: omList.c:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int s_getc(s_buff F)
Definition: s_buff.cc:56
int s_readint(s_buff F)
Definition: s_buff.cc:110
int s_readbytes(char *buff, int len, s_buff F)
Definition: s_buff.cc:166
s_buff f_read
Definition: s_buff.h:22
FILE * f_write
Definition: s_buff.h:23
Definition: s_buff.h:21
int status int void size_t count
Definition: si_signals.h:59
int status int void * buf
Definition: si_signals.h:59
#define IDHDL
Definition: tok.h:31
@ LIST_CMD
Definition: tok.h:118
@ STRING_CMD
Definition: tok.h:183
@ INT_CMD
Definition: tok.h:96
#define NONE
Definition: tok.h:219