Static Public Member Functions | Static Private Attributes
CFFactory Class Reference

#include <cf_factory.h>

Static Public Member Functions

static int gettype ()
 
static void settype (int type)
 
static InternalCFbasic (long value)
 
static InternalCFbasic (int type, long value)
 
static InternalCFbasic (const char *str)
 
static InternalCFbasic (const char *str, int base)
 
static InternalCFbasic (int type, const char *const str)
 
static InternalCFbasic (int type, long value, bool nonimm)
 
static InternalCFbasic (const mpz_ptr num)
 
static InternalCFrational (long num, long den)
 
static InternalCFrational (const mpz_ptr num, const mpz_ptr den, bool normalize)
 
static InternalCFpoly (const Variable &v, int exp, const CanonicalForm &c)
 
static InternalCFpoly (const Variable &v, int exp=1)
 

Static Private Attributes

static int currenttype = IntegerDomain
 

Detailed Description

Definition at line 22 of file cf_factory.h.

Member Function Documentation

InternalCF * CFFactory::basic ( long  value)
static

Definition at line 28 of file cf_factory.cc.

29 {
30  if ( currenttype == IntegerDomain )
31  if ( value >= MINIMMEDIATE && value <= MAXIMMEDIATE )
32  return int2imm( value );
33  else
34  return new InternalInteger( value );
35 // else if ( currenttype == RationalDomain )
36 // if ( value >= MINIMMEDIATE && value <= MAXIMMEDIATE )
37 // return int2imm( value );
38 // else
39 // return new InternalRational( value );
40  else if ( currenttype == FiniteFieldDomain )
41  return int2imm_p( ff_norm( value ) );
42  else if ( currenttype == GaloisFieldDomain )
43  return int2imm_gf( gf_int2gf( value ) );
44  else {
45  ASSERT( 0, "illegal basic domain!" );
46  return 0;
47  }
48 }
const long MINIMMEDIATE
Definition: imm.h:50
InternalCF * int2imm(long i)
Definition: imm.h:71
InternalCF * int2imm_p(long i)
Definition: imm.h:97
int ff_norm(const int a)
Definition: ffops.h:35
#define IntegerDomain
Definition: cf_defs.h:25
static int currenttype
Definition: cf_factory.h:25
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
const long MAXIMMEDIATE
Definition: imm.h:51
#define GaloisFieldDomain
Definition: cf_defs.h:22
int gf_int2gf(int i)
Definition: gfops.h:65
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory&#39;s class for integers
Definition: int_int.h:44
#define FiniteFieldDomain
Definition: cf_defs.h:23
InternalCF * CFFactory::basic ( int  type,
long  value 
)
static

Definition at line 51 of file cf_factory.cc.

52 {
53  if ( type == IntegerDomain )
54  if ( value >= MINIMMEDIATE && value <= MAXIMMEDIATE )
55  return int2imm( value );
56  else
57  return new InternalInteger( value );
58 // else if ( type == RationalDomain )
59 // if ( value >= MINIMMEDIATE && value <= MAXIMMEDIATE )
60 // return int2imm( value );
61 // else
62 // return new InternalRational( value );
63  else if ( type == FiniteFieldDomain )
64  return int2imm_p( ff_norm( value ) );
65  else if ( type == GaloisFieldDomain )
66  return int2imm_gf( gf_int2gf( value ) );
67  else {
68  ASSERT1( 0, "illegal basic domain (type = %d)!", type );
69  return 0;
70  }
71 }
const long MINIMMEDIATE
Definition: imm.h:50
InternalCF * int2imm(long i)
Definition: imm.h:71
InternalCF * int2imm_p(long i)
Definition: imm.h:97
int ff_norm(const int a)
Definition: ffops.h:35
#define IntegerDomain
Definition: cf_defs.h:25
#define ASSERT1(expression, message, parameter1)
Definition: cf_assert.h:101
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
const long MAXIMMEDIATE
Definition: imm.h:51
#define GaloisFieldDomain
Definition: cf_defs.h:22
int gf_int2gf(int i)
Definition: gfops.h:65
factory&#39;s class for integers
Definition: int_int.h:44
#define FiniteFieldDomain
Definition: cf_defs.h:23
InternalCF * CFFactory::basic ( const char *  str)
static

Definition at line 74 of file cf_factory.cc.

75 {
76  if ( currenttype == IntegerDomain ) {
77  InternalInteger * dummy = new InternalInteger( str );
78  if ( dummy->is_imm() ) {
79  InternalCF * res = int2imm( dummy->intval() );
80  delete dummy;
81  return res;
82  }
83  else
84  return dummy;
85  }
86 // else if ( currenttype == RationalDomain ) {
87 // InternalRational * dummy = new InternalRational( str );
88 // if ( dummy->is_imm() ) {
89 // InternalCF * res = int2imm( dummy->intval() );
90 // delete dummy;
91 // return res;
92 // }
93 // else
94 // return dummy;
95 // }
96  else if ( currenttype == FiniteFieldDomain ) {
97  InternalInteger * dummy = new InternalInteger( str );
98  InternalCF * res = int2imm_p( dummy->intmod( ff_prime ) );
99  delete dummy;
100  return res;
101  }
102  else if ( currenttype == GaloisFieldDomain ) {
103  InternalInteger * dummy = new InternalInteger( str );
104  InternalCF * res = int2imm_gf( gf_int2gf( dummy->intmod( ff_prime ) ) );
105  delete dummy;
106  return res;
107  }
108  else {
109  ASSERT( 0, "illegal basic domain!" );
110  return 0;
111  }
112 }
bool is_imm() const
Definition: int_int.cc:68
InternalCF * int2imm(long i)
Definition: imm.h:71
InternalCF * int2imm_p(long i)
Definition: imm.h:97
virtual class for internal CanonicalForm&#39;s
Definition: int_cf.h:39
#define IntegerDomain
Definition: cf_defs.h:25
poly res
Definition: myNF.cc:322
static int currenttype
Definition: cf_factory.h:25
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
long intval() const
Definition: int_int.cc:533
#define GaloisFieldDomain
Definition: cf_defs.h:22
int gf_int2gf(int i)
Definition: gfops.h:65
#define ASSERT(expression, message)
Definition: cf_assert.h:99
int ff_prime
Definition: ffops.cc:14
factory&#39;s class for integers
Definition: int_int.h:44
int intmod(int p) const
Definition: int_int.cc:538
#define FiniteFieldDomain
Definition: cf_defs.h:23
InternalCF * CFFactory::basic ( const char *  str,
int  base 
)
static

Definition at line 115 of file cf_factory.cc.

116 {
117  if ( currenttype == IntegerDomain ) {
118  InternalInteger * dummy = new InternalInteger( str, base );
119  if ( dummy->is_imm() ) {
120  InternalCF * res = int2imm( dummy->intval() );
121  delete dummy;
122  return res;
123  }
124  else
125  return dummy;
126  }
127 // else if ( currenttype == RationalDomain ) {
128 // InternalRational * dummy = new InternalRational( str );
129 // if ( dummy->is_imm() ) {
130 // InternalCF * res = int2imm( dummy->intval() );
131 // delete dummy;
132 // return res;
133 // }
134 // else
135 // return dummy;
136 // }
137  else if ( currenttype == FiniteFieldDomain ) {
138  InternalInteger * dummy = new InternalInteger( str, base );
139  InternalCF * res = int2imm_p( dummy->intmod( ff_prime ) );
140  delete dummy;
141  return res;
142  }
143  else if ( currenttype == GaloisFieldDomain ) {
144  InternalInteger * dummy = new InternalInteger( str, base );
145  InternalCF * res = int2imm_gf( gf_int2gf( dummy->intmod( ff_prime ) ) );
146  delete dummy;
147  return res;
148  }
149  else {
150  ASSERT( 0, "illegal basic domain!" );
151  return 0;
152  }
153 }
bool is_imm() const
Definition: int_int.cc:68
InternalCF * int2imm(long i)
Definition: imm.h:71
char N base
Definition: ValueTraits.h:144
InternalCF * int2imm_p(long i)
Definition: imm.h:97
virtual class for internal CanonicalForm&#39;s
Definition: int_cf.h:39
#define IntegerDomain
Definition: cf_defs.h:25
poly res
Definition: myNF.cc:322
static int currenttype
Definition: cf_factory.h:25
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
long intval() const
Definition: int_int.cc:533
#define GaloisFieldDomain
Definition: cf_defs.h:22
int gf_int2gf(int i)
Definition: gfops.h:65
#define ASSERT(expression, message)
Definition: cf_assert.h:99
int ff_prime
Definition: ffops.cc:14
factory&#39;s class for integers
Definition: int_int.h:44
int intmod(int p) const
Definition: int_int.cc:538
#define FiniteFieldDomain
Definition: cf_defs.h:23
InternalCF * CFFactory::basic ( int  type,
const char *const  str 
)
static

Definition at line 156 of file cf_factory.cc.

157 {
158  if ( type == IntegerDomain ) {
159  InternalInteger * dummy = new InternalInteger( str );
160  if ( dummy->is_imm() ) {
161  InternalCF * res = int2imm( dummy->intval() );
162  delete dummy;
163  return res;
164  }
165  else
166  return dummy;
167  }
168 // else if ( type == RationalDomain ) {
169 // InternalRational * dummy = new InternalRational( str );
170 // if ( dummy->is_imm() ) {
171 // InternalCF * res = int2imm( dummy->intval() );
172 // delete dummy;
173 // return res;
174 // }
175 // else
176 // return dummy;
177 // }
178  else if ( type == FiniteFieldDomain ) {
179  InternalInteger * dummy = new InternalInteger( str );
180  InternalCF * res = int2imm( dummy->intmod( ff_prime ) );
181  delete dummy;
182  return res;
183  }
184  else if ( type == GaloisFieldDomain ) {
185  InternalInteger * dummy = new InternalInteger( str );
186  InternalCF * res = int2imm_gf( gf_int2gf( dummy->intmod( ff_prime ) ) );
187  delete dummy;
188  return res;
189  }
190  else {
191  ASSERT( 0, "illegal basic domain!" );
192  return 0;
193  }
194 }
bool is_imm() const
Definition: int_int.cc:68
InternalCF * int2imm(long i)
Definition: imm.h:71
virtual class for internal CanonicalForm&#39;s
Definition: int_cf.h:39
#define IntegerDomain
Definition: cf_defs.h:25
poly res
Definition: myNF.cc:322
InternalCF * int2imm_gf(long i)
Definition: imm.h:102
long intval() const
Definition: int_int.cc:533
#define GaloisFieldDomain
Definition: cf_defs.h:22
int gf_int2gf(int i)
Definition: gfops.h:65
#define ASSERT(expression, message)
Definition: cf_assert.h:99
int ff_prime
Definition: ffops.cc:14
factory&#39;s class for integers
Definition: int_int.h:44
int intmod(int p) const
Definition: int_int.cc:538
#define FiniteFieldDomain
Definition: cf_defs.h:23
InternalCF * CFFactory::basic ( int  type,
long  value,
bool  nonimm 
)
static

Definition at line 197 of file cf_factory.cc.

198 {
199  if ( nonimm )
200  if ( type == IntegerDomain )
201  return new InternalInteger( value );
202  else if ( type == RationalDomain )
203  return new InternalRational( value );
204  else {
205  ASSERT( 0, "illegal basic domain!" );
206  return 0;
207  }
208  else
209  return CFFactory::basic( type, value );
210 }
#define IntegerDomain
Definition: cf_defs.h:25
static InternalCF * basic(long value)
Definition: cf_factory.cc:28
#define RationalDomain
Definition: cf_defs.h:24
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory&#39;s class for integers
Definition: int_int.h:44
factory&#39;s class for rationals
Definition: int_rat.h:39
InternalCF * CFFactory::basic ( const mpz_ptr  num)
static

Definition at line 213 of file cf_factory.cc.

214 {
215  ASSERT (currenttype == IntegerDomain, "Integer domain expected");
216  return new InternalInteger( num );
217 }
CanonicalForm num(const CanonicalForm &f)
#define IntegerDomain
Definition: cf_defs.h:25
static int currenttype
Definition: cf_factory.h:25
#define ASSERT(expression, message)
Definition: cf_assert.h:99
factory&#39;s class for integers
Definition: int_int.h:44
static int CFFactory::gettype ( )
inlinestatic

Definition at line 27 of file cf_factory.h.

27 { return currenttype; }
static int currenttype
Definition: cf_factory.h:25
InternalCF * CFFactory::poly ( const Variable v,
int  exp,
const CanonicalForm c 
)
static

Definition at line 238 of file cf_factory.cc.

239 {
240  if ( v.level() == LEVELBASE )
241  return c.getval();
242  else
243  return new InternalPoly( v, exp, c );
244 }
int level() const
Definition: variable.h:49
#define LEVELBASE
Definition: cf_defs.h:16
factory&#39;s class for polynomials
Definition: int_poly.h:74
InternalCF * getval() const
p exp[i]
Definition: DebugPrint.cc:39
InternalCF * CFFactory::poly ( const Variable v,
int  exp = 1 
)
static

Definition at line 247 of file cf_factory.cc.

248 {
249  if ( v.level() == LEVELBASE )
250  return CFFactory::basic( 1L );
251  else
252  return new InternalPoly( v, exp, 1 );
253 }
int level() const
Definition: variable.h:49
#define LEVELBASE
Definition: cf_defs.h:16
factory&#39;s class for polynomials
Definition: int_poly.h:74
static InternalCF * basic(long value)
Definition: cf_factory.cc:28
p exp[i]
Definition: DebugPrint.cc:39
InternalCF * CFFactory::rational ( long  num,
long  den 
)
static

Definition at line 220 of file cf_factory.cc.

221 {
223  return res->normalize_myself();
224 }
InternalCF * normalize_myself()
reduce InternalRational to lowest terms
Definition: int_rat.cc:859
CanonicalForm num(const CanonicalForm &f)
poly res
Definition: myNF.cc:322
CanonicalForm den(const CanonicalForm &f)
factory&#39;s class for rationals
Definition: int_rat.h:39
InternalCF * CFFactory::rational ( const mpz_ptr  num,
const mpz_ptr  den,
bool  normalize 
)
static

Definition at line 227 of file cf_factory.cc.

228 {
229  if ( normalize ) {
231  return result->normalize_myself();
232  }
233  else
234  return new InternalRational( num, den );
235 }
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
Definition: syz3.cc:1028
InternalCF * normalize_myself()
reduce InternalRational to lowest terms
Definition: int_rat.cc:859
CanonicalForm num(const CanonicalForm &f)
CanonicalForm den(const CanonicalForm &f)
factory&#39;s class for rationals
Definition: int_rat.h:39
return result
Definition: facAbsBiFact.cc:76
void CFFactory::settype ( int  type)
static

Definition at line 21 of file cf_factory.cc.

22 {
23  ASSERT( type==FiniteFieldDomain || type==GaloisFieldDomain || type==IntegerDomain || type==RationalDomain, "illegal basic domain!" );
24  currenttype = type;
25 }
#define IntegerDomain
Definition: cf_defs.h:25
static int currenttype
Definition: cf_factory.h:25
#define RationalDomain
Definition: cf_defs.h:24
#define GaloisFieldDomain
Definition: cf_defs.h:22
#define ASSERT(expression, message)
Definition: cf_assert.h:99
#define FiniteFieldDomain
Definition: cf_defs.h:23

Field Documentation

int CFFactory::currenttype = IntegerDomain
staticprivate

Definition at line 25 of file cf_factory.h.


The documentation for this class was generated from the following files: