source: git/Singular/dyn_modules/gfanlib/tropicalVariety.cc @ eacb781

spielwiese
Last change on this file since eacb781 was eacb781, checked in by Yue Ren <ren@…>, 10 years ago
chg: status update 23.08.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1#include <callgfanlib_conversion.h>
2#include <bbfan.h>
3#include <groebnerCone.h>
4#include <tropicalVarietyOfIdeals.h>
5#include <libpolys/coeffs/numbers.h>
6#include <libpolys/misc/options.h>
7#include <kernel/structs.h>
8
9
10BITSET bitsetSave1, bitsetSave2;
11
12/***
13 * sets option(redSB)
14 **/
15static void setOptionRedSB()
16{
17  SI_SAVE_OPT(bitsetSave1,bitsetSave2);
18  si_opt_1|=Sy_bit(OPT_REDSB);
19}
20
21/***
22 * sets option(noredSB);
23 **/
24static void undoSetOptionRedSB()
25{
26  SI_RESTORE_OPT(bitsetSave1,bitsetSave2);
27}
28
29BOOLEAN tropicalVariety(leftv res, leftv args)
30{
31  leftv u = args;
32  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
33  {
34    ideal I = (ideal) u->CopyD();
35    leftv v = u->next;
36    if (v==NULL)
37    {
38      tropicalStrategy currentStrategy(I,currRing);
39      setOptionRedSB();
40      gfan::ZFan* tropI = tropicalVariety(currentStrategy);
41      undoSetOptionRedSB();
42      res->rtyp = fanID;
43      res->data = (char*) tropI;
44      return FALSE;
45    }
46    if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
47    {
48      number p = (number) v->CopyD();
49      tropicalStrategy currentStrategy(I,p,currRing);
50      gfan::ZFan* tropI = tropicalVariety(currentStrategy);
51      res->rtyp = fanID;
52      res->data = (char*) tropI;
53      return FALSE;
54    }
55    return FALSE;
56  }
57  WerrorS("tropicalVariety: unexpected parameters");
58  return TRUE;
59}
Note: See TracBrowser for help on using the repository browser.