 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the documentation of this file.
11 #include <boost/shared_ptr.hpp>
17 #define BOOST_DISABLE_THREADS
46 template <poly_variant,
class,
class>
friend class PolyBase;
82 if (
this==&p2)
return *
this;
106 number two=
n_Init(2,
r.get()->cf);
210 intrusive_ptr<ip_sring>
r;
260 using namespace boost;
284 public std::iterator<std::input_iterator_tag,T,int, shared_ptr<const T>,ConstTermReference<T> >
325 return shared_ptr<const T>(
new T(
p_Head(t,r),r,0));
329 template<poly_variant variant,
class create_type_input,
class error_handle_traits>
class PolyBase
336 return p_Copy(ptr->p,ptr->getRing());
340 if (error_handle_traits::handleErrors)
342 if (
p.getRing()!=this->getRing())
344 error_handle_traits::handleDifferentRing(this->getRing(),
354 int nvars=
rVar(ptr->r.get());
356 for(
int i=0;
i<nvars;
i++)
376 return p_String(ptr->p,ptr->getRing(),ptr->getRing());
383 char* cp=(
char*)
omAlloc((strlen(c)+1)*
sizeof(char));
428 return ptr->getRing();
434 return ptr->leadCoef();
438 erg*=
Number(-1,ptr->getRing());
447 return ptr->getInternalReference();
455 class Poly:
public PolyBase<POLY_VARIANT_RING, Poly, MyErrorHandler>{
485 for(
i=0;
i<
v.size();
i++){
535 for(
i=0;
i<
v.size();
i++){
587 template <poly_variant variant,
class create_type,
class error_traits>
609 ring r1=p1.getRing();
610 ring r2=p2.getRing();
611 if (r1!=r2)
return false;
617 if (r1!=r2)
return false;
620 template <poly_variant variant,
class create_type,
class error_traits>
640 template <poly_variant variant,
class create_type,
class error_traits>
PolyBase< POLY_VARIANT_RING, Poly, MyErrorHandler > Base
Poly & operator+=(const Poly &p)
bool operator==(const Poly &p1, const Poly &p2)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
PolyBase< POLY_VARIANT_MODUL, Vector, MyErrorHandler > Base
PolyImpl operator+(const PolyImpl &p1, const PolyImpl &p2)
poly getInternalReference()
void checkIsSameRing(T &p)
PolyImpl operator-(const PolyImpl &p1, const PolyImpl &p2)
Poly & operator+=(const Base &p)
PolyBase< variant, create_type_input, error_handle_traits > ThisType
static poly p_Head(poly p, const ring r)
friend PolyImpl operator+(const PolyImpl &p1, const PolyImpl &n2)
PolyImpl & operator=(const PolyImpl &p2)
PolyImpl & operator*=(const PolyImpl &p2)
static poly p_Neg(poly p, const ring r)
PolyInputIterator< create_type > end()
static const bool handleErrors
PolyBase & operator*=(const Poly &p2)
friend bool operator==(const PolyImpl &p1, int n2)
friend bool operator==(const PolyImpl &p1, const PolyImpl &n2)
friend PolyImpl operator/(const PolyImpl &p1, const PolyImpl &n2)
PolyImpl & operator-=(const PolyImpl &p2)
Vector(const char *c, ring r=currRing)
ConstTermReference(poly p, ring r)
Vector(std::vector< int > v, ring r=currRing)
static void handleDifferentRing(ring r, ring s)
PolyImpl & operator=(int n)
static long pTotaldegree(poly p)
create_type_input create_type
PolyBase & operator*=(Number n)
int lmTotalDegree() const
static poly p_Copy(poly p, const ring r)
returns a copy of p
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
PolyBase(const char *c, ring r=currRing)
void PrintS(const char *s)
Vector(int n, ring r=currRing)
PolyBase & operator+=(const PolyBase &p2)
PolyImpl(poly p, intrusive_ptr< ip_sring > r, int)
char * p_String(poly p, ring lmRing, ring tailRing)
PolyInputIterator< create_type > iterator
TrivialErrorHandler MyErrorHandler
friend PolyImpl operator*(const PolyImpl &p1, const PolyImpl &n2)
void p_Write(poly p, ring lmRing, ring tailRing)
PolyImpl operator*(const PolyImpl &p1, const PolyImpl &p2)
PolyImpl(const PolyImpl &p)
Vector & operator+=(const Base &p)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Vector unitVector(int i, ring r=currRing)
const char * p_Read(const char *st, poly &rc, const ring r)
Vector & operator+=(const Vector &p)
PolyBase(ring r=currRing)
PolyImpl(poly p, intrusive_ptr< ip_sring > r)
PolyBase(const PolyBase &p)
static const bool handleErrors
PolyBase(poly p, ring r, int)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
intrusive_ptr< ip_sring > r
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
friend bool operator==(const Poly &p1, const Poly &p2)
PolyImpl & operator+=(const PolyImpl &p2)
PolyImpl(const Number &n)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
friend PolyImpl operator/(const PolyImpl &p1, int n2)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void WerrorS(const char *s)
PolyImpl & operator*=(const Number &n)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
poly getInternalReference() const
PolyInputIterator< create_type > begin()
const Variable & v
< [in] a sqrfree bivariate poly
Poly(poly p, ring r, int)
const CanonicalForm int s
intrusive_ptr< ip_sring > r
Poly(int n, ring r=currRing)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
Vector(poly p, ring r, int)
PolyImpl(int n, intrusive_ptr< ip_sring > r)
static void handleDifferentRing(ring r, ring s)
static poly p_Mult_nn(poly p, number n, const ring r)
Poly(const std::vector< int > &v, ring r=currRing)
Poly(const char *c, ring r=currRing)
shared_ptr< PolyImpl > ptr
static BOOLEAN p_LmIsConstant(const poly p, const ring r)