source: git/Singular/ring.h @ 7df2ef

spielwiese
Last change on this file since 7df2ef was 7df2ef, checked in by Olaf Bachmann <obachman@…>, 25 years ago
* reimplemented rInit * added top-level command leadmonom * re-added mmTestList git-svn-id: file:///usr/local/Singular/svn/trunk@2961 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[0e1846]1#ifndef RING_H
2#define RING_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
[6ae4f5]7* ABSTRACT - the interpreter related ring operations
[0e1846]8*/
[7df2ef]9/* $Id: ring.h,v 1.23 1999-03-19 14:18:06 obachman Exp $ */
[0e1846]10
11/* includes */
12#include "structs.h"
[51c163]13#include "polys-impl.h"
[0e1846]14
[311499]15#ifdef DRING
16void   rChangeCurrRing(ring r, BOOLEAN complete = TRUE, idhdl h = NULL);
17#else
[47faf56]18void   rChangeCurrRing(ring r, BOOLEAN complete = TRUE);
[311499]19#endif
[7df2ef]20void   rSetHdl(idhdl h, BOOLEAN complete = TRUE);
[0e1846]21idhdl  rInit(char *s, sleftv* pn, sleftv* rv, sleftv* ord,
22  BOOLEAN isDRing);
23idhdl  rDefault(char *s);
24int    rIsRingVar(char *n);
25char * RingVar(short);
26void   rWrite(ring r);
27void   rKill(idhdl h);
28void   rKill(ring r);
29ring   rCopy(ring r);
[6d281ac]30idhdl  rFindHdl(ring r, idhdl n, idhdl w);
[0e1846]31#ifdef DRING
32void rDSet();
33#endif
34void   rDInit();
35int rOrderName(char * ordername);
36char * rOrdStr(ring r);
37char * rVarStr(ring r);
38char * rCharStr(ring r);
[8d1d137]39char * rString(ring r);
[0e1846]40int    rChar(ring r=currRing);
41#define rPar(r) (r->P)
42char * rParStr(ring r);
43int    rIsExtension(ring r);
44int    rIsExtension();
45int    rSum(ring r1, ring r2, ring &sum);
[7df2ef]46BOOLEAN   rComplete(ring r, int force = 0);
[8fefd9]47void   rUnComplete(ring r);
[50abaf2]48int    rBlocks(ring r);
[e78cce]49
[be0d84]50#define  rInternalChar(r) ((r)->ch)
[2a10547]51#ifndef ABS
52#define ABS(x) ((x) < 0 ? (-(x)) : (x))
53#endif
[be0d84]54inline BOOLEAN rField_is_Zp(ring r=currRing)
[2a10547]55{ return (r->ch > 1) && (r->parameter==NULL); }
56inline BOOLEAN rField_is_Zp(ring r, int p)
57{ return (r->ch > 1 && r->ch == ABS(p) && r->parameter==NULL); }
[be0d84]58inline BOOLEAN rField_is_Q(ring r=currRing)
[2a10547]59{ return (r->ch == 0) && (r->parameter==NULL); }
[be0d84]60inline BOOLEAN rField_is_R(ring r=currRing)
[2a10547]61{ return (r->ch == -1); }
[be0d84]62inline BOOLEAN rField_is_GF(ring r=currRing)
[2a10547]63{ return (r->ch > 1) && (r->parameter!=NULL); }
[be0d84]64inline BOOLEAN rField_is_Zp_a(ring r=currRing)
[2a10547]65{ return (r->ch < -1); }
66inline BOOLEAN rField_is_Zp_a(ring r, int p)
67{ return (r->ch < -1 ) && (-(r->ch) == ABS(p)); }
[be0d84]68inline BOOLEAN rField_is_Q_a(ring r=currRing)
[2a10547]69{ return (r->ch == 1); }
[be0d84]70inline BOOLEAN rField_has_simple_inverse(ring r=currRing)
71{ return (r->ch>1); } /* Z/p and GF(p,n) */
[0e1846]72
73enum
74{
75  ringorder_no = 0,
76  ringorder_a,
77  ringorder_c,
78  ringorder_C,
79  ringorder_M,
80  ringorder_lp,
81  ringorder_dp,
82  ringorder_Dp,
83  ringorder_wp,
84  ringorder_Wp,
85  ringorder_ls,
86  ringorder_ds,
87  ringorder_Ds,
88  ringorder_ws,
89  ringorder_Ws,
90  ringorder_unspec
91};
92
[f92fa13]93typedef enum rOrderType_t
94{
95  rOrderType_General = 0, // non-simple ordering as specified by currRing
[e9ad8a6]96  rOrderType_CompExp,     // simple ordering, component has priority
[f92fa13]97  rOrderType_ExpComp,     // simple ordering, exponent vector has priority
[18255d]98                          // component not compatible with exp-vector order
99  rOrderType_Exp,         // simple ordering, exponent vector has priority
100                          // component is compatible with exp-vector order
[f92fa13]101  rOrderType_Syz,         // syzygy ordering
102  rOrderType_Schreyer     // Schreyer ordering
103} rOrderType_t;
104
[f003a9]105BOOLEAN rHasSimpleOrder(ring r);
106// returns TRUE, if simple lp or ls ordering
107BOOLEAN rHasSimpleLexOrder(ring r);
108rOrderType_t    rGetOrderType(ring r);
[f7ac05]109BOOLEAN rIsPolyVar(int i); /* returns TRUE if var(i) belongs to p-block */
[f92fa13]110
[84db5bf]111void rOptimizeOrder(ring r);
112
[0e1846]113#ifdef RDEBUG
[fca547]114extern short rNumber; /* current ring id (r->no) */
[e06ef94]115#define rTest(r)    rDBTest(r, __FILE__, __LINE__)
116extern BOOLEAN rDBTest(ring r, char* fn, int l);
117#else
118#define rTest(r)
[0e1846]119#endif
120
121#endif
122
Note: See TracBrowser for help on using the repository browser.