polys.cc
Go to the documentation of this file.
1 #include <kernel/mod2.h>
2 
3 #include <omalloc/omalloc.h>
4 #include <misc/options.h>
5 
6 #include "polys.h"
7 
8 /// Widely used global variable which specifies the current polynomial ring for Singular interpreter and legacy implementatins.
9 /// @Note: one should avoid using it in newer designs, for example due to possible problems in parallelization with threads.
10 ring currRing = NULL;
11 
12 void rChangeCurrRing(ring r)
13 {
14  #if 0
15  if ((currRing!=NULL)&&(currRing!=r))
16  {
18  }
19  #endif
20  if( r != NULL )
21  {
22  rTest(r);
23 
24  //------------ set global ring vars --------------------------------
25  currRing = r;
26  //------------ global variables related to coefficients ------------
27  assume( r->cf!= NULL );
28  nSetChar(r->cf);
29  //------------ global variables related to polys
30  p_SetGlobals(r);
31  //------------ global variables related to factory -----------------
32  }
33  else
34  {
35  currRing = NULL;
36  }
37 }
38 /*
39 /// internally changes the gloabl ring and resets the relevant
40 /// global variables:
41 /// SHOULD BE DEPRECATED NOW...?
42 void rChangeCurrRing(ring r)
43 {
44  // if (!rMinpolyIsNULL(currRing))
45  // {
46  // omCheckAddr(currRing->cf->minpoly);
47  // }
48  //------------ set global ring vars --------------------------------
49  //currRing = r;
50  if (r != NULL)
51  {
52  rTest(r);
53  //------------ set global ring vars --------------------------------
54 
55  //------------ global variables related to coefficients ------------
56  nSetChar(r->cf);
57 
58  //------------ global variables related to polys -------------------
59  p_SetGlobals(r);
60  //------------ global variables related to factory -----------------
61  }
62 }
63 */
unsigned si_opt_1
Definition: options.c:5
Compatiblity layer for legacy polynomial operations (over currRing)
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition: coeffs.h:440
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
#define rTest(r)
Definition: ring.h:775
void rChangeCurrRing(ring r)
Definition: polys.cc:12
#define NULL
Definition: omList.c:10
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define TEST_RINGDEP_OPTS
Definition: options.h:95
void p_SetGlobals(const ring r, BOOLEAN complete)
set all properties of a new ring - also called by rComplete
Definition: ring.cc:3400