source: git/kernel/polys.cc @ cc94f7e

fieker-DuValspielwiese
Last change on this file since cc94f7e was 52e6ef, checked in by Hans Schoenemann <hannes@…>, 8 years ago
chg: use misc/auxiliary.h in libpolys and kernel/mod2.h in Singular for config
  • Property mode set to 100644
File size: 1.6 KB
Line 
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.
10ring  currRing = NULL;
11
12void rChangeCurrRing(ring r)
13{
14  #if 0
15  if ((currRing!=NULL)&&(currRing!=r))
16  {
17    currRing->options=si_opt_1 & TEST_RINGDEP_OPTS;
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...?
42void 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*/
Note: See TracBrowser for help on using the repository browser.