// equality
// (Be careful: This is not well-defined for polynomials with
// floating-point coefficients.)
- cl_boolean (* equal) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
+ bool (* equal) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
};
struct _cl_univpoly_addops /* cf. _cl_ring_addops */ {
// 0
const _cl_UP (* zero) (cl_heap_univpoly_ring* R);
- cl_boolean (* zerop) (cl_heap_univpoly_ring* R, const _cl_UP& x);
+ bool (* zerop) (cl_heap_univpoly_ring* R, const _cl_UP& x);
// x+y
const _cl_UP (* plus) (cl_heap_univpoly_ring* R, const _cl_UP& x, const _cl_UP& y);
// x-y
// Low-level operations.
void _fprint (std::ostream& stream, const _cl_UP& x)
{ setops->fprint(this,stream,x); }
- cl_boolean _equal (const _cl_UP& x, const _cl_UP& y)
+ bool _equal (const _cl_UP& x, const _cl_UP& y)
{ return setops->equal(this,x,y); }
const _cl_UP _zero ()
{ return addops->zero(this); }
- cl_boolean _zerop (const _cl_UP& x)
+ bool _zerop (const _cl_UP& x)
{ return addops->zerop(this,x); }
const _cl_UP _plus (const _cl_UP& x, const _cl_UP& y)
{ return addops->plus(this,x,y); }
if (!(x.ring() == this)) throw runtime_exception();
_fprint(stream,x);
}
- cl_boolean equal (const cl_UP& x, const cl_UP& y)
+ bool equal (const cl_UP& x, const cl_UP& y)
{
if (!(x.ring() == this)) throw runtime_exception();
if (!(y.ring() == this)) throw runtime_exception();
{
return cl_UP(this,_zero());
}
- cl_boolean zerop (const cl_UP& x)
+ bool zerop (const cl_UP& x)
{
if (!(x.ring() == this)) throw runtime_exception();
return _zerop(x);
// Lookup or create the "standard" univariate polynomial ring over a ring r.
extern const cl_univpoly_ring find_univpoly_ring (const cl_ring& r);
-//CL_REQUIRE(cl_UP_unnamed)
// Lookup or create a univariate polynomial ring with a named variable over r.
extern const cl_univpoly_ring find_univpoly_ring (const cl_ring& r, const cl_symbol& varname);
-//CL_REQUIRE(cl_UP_named)
-CL_REQUIRE(cl_UP)
+class cl_UP_init_helper
+{
+ static int count;
+public:
+ cl_UP_init_helper();
+ ~cl_UP_init_helper();
+};
+static cl_UP_init_helper cl_UP_init_helper_instance;
// Operations on polynomials.
{ return !x.ring()->equal(x,y); }
// Compare against 0.
-inline cl_boolean zerop (const cl_UP& x)
+inline bool zerop (const cl_UP& x)
{ return x.ring()->zerop(x); }
// Multiply.
extern const cl_univpoly_ring cl_no_univpoly_ring;
extern cl_class cl_class_no_univpoly_ring;
-CL_REQUIRE(cl_UP_no_ring)
+
+class cl_UP_no_ring_init_helper
+{
+ static int count;
+public:
+ cl_UP_no_ring_init_helper();
+ ~cl_UP_no_ring_init_helper();
+};
+static cl_UP_no_ring_init_helper cl_UP_no_ring_init_helper_instance;
inline cl_univpoly_ring::cl_univpoly_ring ()
: cl_ring (as_cl_private_thing(cl_no_univpoly_ring)) {}
{
cl_heap_univpoly_ring::fprint(stream,x);
}
- cl_boolean equal (const cl_UP_specialized<T>& x, const cl_UP_specialized<T>& y)
+ bool equal (const cl_UP_specialized<T>& x, const cl_UP_specialized<T>& y)
{
return cl_heap_univpoly_ring::equal(x,y);
}
{
return The2(cl_UP_specialized<T>)(cl_heap_univpoly_ring::zero());
}
- cl_boolean zerop (const cl_UP_specialized<T>& x)
+ bool zerop (const cl_UP_specialized<T>& x)
{
return cl_heap_univpoly_ring::zerop(x);
}