Loading...
Searching...
No Matches
PolyImpl Class Reference

`#include <Poly.h>`

## Public Member Functions

ring | getRing () const
Number | leadCoef ()
PolyImpl & | operator= (const PolyImpl &p2)
PolyImpl | operator- ()
PolyImpl & | operator+= (const PolyImpl &p2)
PolyImpl & | operator*= (const PolyImpl &p2)
PolyImpl & | operator*= (const Number &n)
PolyImpl & | operator-= (const PolyImpl &p2)
PolyImpl & | operator= (int n)
| PolyImpl ()
| PolyImpl (const PolyImpl &p)
| PolyImpl (poly p, intrusive_ptr< ip_sring > r)
| PolyImpl (poly p, intrusive_ptr< ip_sring > r, int)
| PolyImpl (int n, intrusive_ptr< ip_sring > r)
| PolyImpl (const Number &n)
| PolyImpl (int n)
void | print ()
virtual | ~PolyImpl ()

## Protected Member Functions

poly | getInternalReference () const

## Protected Attributes

poly | p
intrusive_ptr< ip_sring > | r

## Friends

template<poly_variant, class, class>
class | PolyBase
class | Poly
class | Vector
bool | operator== (const Poly &p1, const Poly &p2)
bool | operator== (const Vector &p1, const Vector &p2)
PolyImpl | operator+ (const PolyImpl &p1, const PolyImpl &n2)
PolyImpl | operator- (const PolyImpl &p1, const PolyImpl &n2)
PolyImpl | operator/ (const PolyImpl &p1, const PolyImpl &n2)
PolyImpl | operator* (const PolyImpl &p1, const PolyImpl &n2)
bool | operator== (const PolyImpl &p1, const PolyImpl &n2)
PolyImpl | operator+ (const PolyImpl &p1, int n2)
PolyImpl | operator- (const PolyImpl &p1, int n2)
PolyImpl | operator/ (const PolyImpl &p1, int n2)
PolyImpl | operator* (const PolyImpl &p1, int n2)
bool | operator== (const PolyImpl &p1, int n2)

## Detailed Description

Definition at line 44 of file Poly.h.

## Constructor & Destructor Documentation

## PolyImpl() [1/7]

PolyImpl::PolyImpl | ( |  | ) |

inline

Definition at line 164 of file Poly.h.

{
r=currRing;
p=NULL;
}
PolyImpl::r
intrusive_ptr< ip_sring > r
Definition Poly.h:210
PolyImpl::p
poly p
Definition Poly.h:209
NULL
#define NULL
Definition omList.c:12
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13

## PolyImpl() [2/7]

PolyImpl::PolyImpl | ( | const PolyImpl & | p | ) |

inline

Definition at line 169 of file Poly.h.

{
r=p.r;
this->p=p_Copy(p.p,r.get());
}
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## PolyImpl() [3/7]

PolyImpl::PolyImpl | ( | poly | p,
|  | intrusive_ptr< ip_sring > | r )

inline

Definition at line 174 of file Poly.h.

{
this->p=p_Copy(p,r.get());
this->r=r;
}

## PolyImpl() [4/7]

PolyImpl::PolyImpl | ( | poly | p,
|  | intrusive_ptr< ip_sring > | r,
|  | int | )

inline

Definition at line 179 of file Poly.h.

{
this->p=p;
this->r=r;
}

## PolyImpl() [5/7]

PolyImpl::PolyImpl | ( | int | n,
|  | intrusive_ptr< ip_sring > | r )

inline

Definition at line 184 of file Poly.h.

{
this->p=p_ISet(n,r.get());
this->r=r;
}
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition p_polys.cc:1298

## PolyImpl() [6/7]

PolyImpl::PolyImpl | ( | const Number & | n | ) |

inline

Definition at line 189 of file Poly.h.

{
r=n.r.get();
this->p=p_NSet(n_Copy(n.n,r.get()->cf),r.get());
}
Number::r
intrusive_ptr< ip_sring > r
Definition Number.h:218
Number::n
number n
Definition Number.h:217
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition p_polys.cc:1474

## PolyImpl() [7/7]

PolyImpl::PolyImpl | ( | int | n | ) |

inline explicit

Definition at line 194 of file Poly.h.

{
r=currRing;
this->p=p_ISet(n,r.get());
}

## ~PolyImpl()

virtual PolyImpl::~PolyImpl | ( |  | ) |

inline virtual

Definition at line 203 of file Poly.h.

{
if (r!=NULL)
p_Delete(&p,r.get());
}
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903

## Member Function Documentation

## getInternalReference()

poly PolyImpl::getInternalReference | ( |  | ) | const

inline protected

Definition at line 54 of file Poly.h.

{
return p;
}

## getRing()

ring PolyImpl::getRing | ( |  | ) | const

inline

Definition at line 59 of file Poly.h.

{
return r.get();
}

## leadCoef()

Number PolyImpl::leadCoef | ( |  | ) |

inline

Definition at line 75 of file Poly.h.

{
return Number(p->coef,r.get());
}

## operator*=() [1/2]

PolyImpl & PolyImpl::operator*= | ( | const Number & | n | ) |

inline

Definition at line 130 of file Poly.h.

{
if (r!=n.r)
{
WerrorS("not the same ring");
return *this;
}
p=p_Mult_nn(p,n.n,r.get());
return *this;
}
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
p_Mult_nn
static poly p_Mult_nn(poly p, number n, const ring r)
Definition p_polys.h:960

## operator*=() [2/2]

PolyImpl & PolyImpl::operator*= | ( | const PolyImpl & | p2 | ) |

inline

Definition at line 114 of file Poly.h.

{
if (r!=p2.r)
{
WerrorS("not the same ring");
return *this;
}
if (this==&p2)
{
poly pc=p_Copy(p,r.get());
p=p_Mult_q(p,p2.p,r.get());
return *this;
}
p=p_Mult_q(p,p_Copy(p2.p,p2.r.get()),r.get());
return *this;
}
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition p_polys.h:1125

## operator+=()

PolyImpl & PolyImpl::operator+= | ( | const PolyImpl & | p2 | ) |

inline

Definition at line 97 of file Poly.h.

{
if (r!=p2.r)
{
WerrorS("not the same ring");
return *this;
}
if (this==&p2)
{
number two=n_Init(2,r.get()->cf);
p_Mult_nn(p,two,r.get());
return *this;
}
p=p_Add_q(p,p_Copy(p2.p,p2.r.get()),r.get());
return *this;
}
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938

## operator-()

PolyImpl PolyImpl::operator- | ( |  | ) |

inline

Definition at line 90 of file Poly.h.

{
PolyImpl t(*this);
t.p=p_Copy(p,r.get());
t.p=p_Neg(t.p,r.get());
return t;
}
PolyImpl::PolyImpl
PolyImpl()
Definition Poly.h:164
p_Neg
static poly p_Neg(poly p, const ring r)
Definition p_polys.h:1114

## operator-=()

PolyImpl & PolyImpl::operator-= | ( | const PolyImpl & | p2 | ) |

inline

Definition at line 140 of file Poly.h.

{
if (r!=p2.r)
{
WerrorS("not the same ring");
return *this;
}
if (this==&p2)
{
p_Delete(&p,r.get());
p=NULL;
return *this;
}
poly pc=p_Copy(p2.p,p2.r.get());
pc=p_Neg(pc,r.get());
p=p_Add_q(p,pc,r.get());
return *this;
}

## operator=() [1/2]

PolyImpl & PolyImpl::operator= | ( | const PolyImpl & | p2 | ) |

inline

Definition at line 79 of file Poly.h.

{
//durch Reihenfolge Selbstzuweisungen berücksichtigt
if (this==&p2) return *this;
poly pc=p_Copy(p2.p,p2.r.get());
if(r!=NULL)
p_Delete(&p,r.get());
r=p2.r;
p=pc;
return *this;
}

## operator=() [2/2]

PolyImpl & PolyImpl::operator= | ( | int | n | ) |

inline

Definition at line 158 of file Poly.h.

{
p_Delete(&p,r.get());
p=p_ISet(n,r.get());
return *this;
}

## print()

void PolyImpl::print | ( |  | ) |

inline

Definition at line 199 of file Poly.h.

{
p_Write(p,r.get(),r.get());
}
p_Write
void p_Write(poly p, ring lmRing, ring tailRing)
Definition polys0.cc:342

## Friends And Related Symbol Documentation

## operator* [1/2]

PolyImpl operator* | ( | const PolyImpl & | p1,
|  | const PolyImpl & | n2 )

friend

Definition at line 219 of file Poly.h.

{
PolyImpl erg(p1);
erg*=p2;
return erg;
}

## operator* [2/2]

PolyImpl operator* | ( | const PolyImpl & | p1,
|  | int | n2 )

friend

Definition at line 237 of file Poly.h.

{
PolyImpl erg(p1);
erg*=PolyImpl(p2,p1.r.get());
return erg;
}

## operator+ [1/2]

PolyImpl operator+ | ( | const PolyImpl & | p1,
|  | const PolyImpl & | n2 )

friend

Definition at line 213 of file Poly.h.

{
PolyImpl erg(p1);
erg+=p2;
return erg;
}

## operator+ [2/2]

PolyImpl operator+ | ( | const PolyImpl & | p1,
|  | int | n2 )

friend

Definition at line 231 of file Poly.h.

{
PolyImpl erg(p1);
erg+=PolyImpl(p2,p1.r.get());
return erg;
}

## operator- [1/2]

PolyImpl operator- | ( | const PolyImpl & | p1,
|  | const PolyImpl & | n2 )

friend

Definition at line 225 of file Poly.h.

{
PolyImpl erg(p1);
erg-=p2;
return erg;
}

## operator- [2/2]

PolyImpl operator- | ( | const PolyImpl & | p1,
|  | int | n2 )

friend

Definition at line 243 of file Poly.h.

{
PolyImpl erg(p1);
erg-=PolyImpl(p2,p1.r);
return erg;
}

## operator/ [1/2]

PolyImpl operator/ | ( | const PolyImpl & | p1,
|  | const PolyImpl & | n2 )

friend

## operator/ [2/2]

PolyImpl operator/ | ( | const PolyImpl & | p1,
|  | int | n2 )

friend

## operator== [1/4]

bool operator== | ( | const Poly & | p1,
|  | const Poly & | p2 )

friend

Definition at line 608 of file Poly.h.

{
ring r1=p1.getRing();
ring r2=p2.getRing();
if (r1!=r2) return false;
return p_EqualPolys(p1.ptr->p,p2.ptr->p,r1);
}
PolyBase::getRing
ring getRing() const
Definition Poly.h:427
PolyBase::ptr
shared_ptr< PolyImpl > ptr
Definition Poly.h:451
p_EqualPolys
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition p_polys.cc:4666

## operator== [2/4]

bool operator== | ( | const PolyImpl & | p1,
|  | const PolyImpl & | n2 )

friend

## operator== [3/4]

bool operator== | ( | const PolyImpl & | p1,
|  | int | n2 )

friend

## operator== [4/4]

bool operator== | ( | const Vector & | p1,
|  | const Vector & | p2 )

friend

Definition at line 614 of file Poly.h.

{
ring r1=p1.getRing();
ring r2=p2.getRing();
if (r1!=r2) return false;
return p_EqualPolys(p1.ptr->p,p2.ptr->p,r1);
}

## Poly

friend class Poly

friend

Definition at line 50 of file Poly.h.

## PolyBase

template<poly_variant, class, class>

friend class PolyBase

friend

Definition at line 46 of file Poly.h.

## Vector

friend class Vector

friend

Definition at line 51 of file Poly.h.

## Field Documentation

## p

poly PolyImpl::p

protected

Definition at line 209 of file Poly.h.

## r

intrusive_ptr<ip_sring> PolyImpl::r

protected

Definition at line 210 of file Poly.h.

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

- Singular/dyn_modules/python/Poly.h