Loading...
Searching...
No Matches
PolyBase< variant, create_type_input, error_handle_traits > Class Template Reference

`#include <Poly.h>`

## Public Types

typedef create_type_input | create_type
typedef PolyInputIterator< create_type > | iterator

## Public Member Functions

poly | as_poly () const
template<class T>
void | checkIsSameRing (T &p)
Intvec | leadExp ()
void | copy_on_write ()
void | print () const
char * | c_string () const
| PolyBase (ring r=currRing)
| PolyBase (const char *c, ring r=currRing)
| PolyBase (const PolyBase &p)
PolyBase & | operator+= (const PolyBase &p2)
PolyBase & | operator*= (const Poly &p2)
PolyBase & | operator*= (Number n)
virtual | ~PolyBase ()
| PolyBase (poly p, ring r)
| PolyBase (poly p, ring r, int)
PolyInputIterator< create_type > | begin ()
PolyInputIterator< create_type > | end ()
ring | getRing () const
int | lmTotalDegree () const
Number | leadCoef ()
create_type | operator- ()

## Protected Member Functions

| PolyBase (PolyImpl &impl)
poly | getInternalReference ()

## Protected Attributes

shared_ptr< PolyImpl > | ptr

## Private Types

typedef PolyBase< variant, create_type_input, error_handle_traits > | ThisType

## Detailed Description

template<poly_variant variant, class create_type_input, class error_handle_traits>
class PolyBase< variant, create_type_input, error_handle_traits >

Definition at line 329 of file Poly.h.

## Member Typedef Documentation

## create_type

template<poly_variant variant, class create_type_input, class error_handle_traits>

typedef create_type_input PolyBase< variant, create_type_input, error_handle_traits >::create_type

Definition at line 350 of file Poly.h.

## iterator

template<poly_variant variant, class create_type_input, class error_handle_traits>

typedef PolyInputIterator<create_type> PolyBase< variant, create_type_input, error_handle_traits >::iterator

Definition at line 351 of file Poly.h.

## ThisType

template<poly_variant variant, class create_type_input, class error_handle_traits>

typedef PolyBase<variant,create_type_input,error_handle_traits> PolyBase< variant, create_type_input, error_handle_traits >::ThisType

private

Definition at line 332 of file Poly.h.

## Constructor & Destructor Documentation

## PolyBase() [1/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | ring | r = currRing | ) |

inline

Definition at line 378 of file Poly.h.

:ptr(new PolyImpl((poly) NULL,r))
{ }
PolyBase
Definition Poly.h:330
PolyBase::ptr
shared_ptr< PolyImpl > ptr
Definition Poly.h:451

## PolyBase() [2/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | const char * | c,
|  | ring | r = currRing )

inline

Definition at line 380 of file Poly.h.

:ptr(new PolyImpl((poly)NULL,r))
{
//p_Read takes no const so do
char* cp=(char*) omAlloc((strlen(c)+1)*sizeof(char));
strcpy(cp,c);
p_Read(cp,ptr->p,r);
omfree(cp);
}
omfree
#define omfree(addr)
Definition omAllocDecl.h:237
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
p_Read
const char * p_Read(const char *st, poly &rc, const ring r)
Definition p_polys.cc:1371

## PolyBase() [3/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | const PolyBase< variant, create_type_input, error_handle_traits > & | p | ) |

inline

Definition at line 388 of file Poly.h.

:ptr(p.ptr){
}

## ~PolyBase()

template<poly_variant variant, class create_type_input, class error_handle_traits>

virtual PolyBase< variant, create_type_input, error_handle_traits >::~PolyBase | ( |  | ) |

inline virtual

Definition at line 412 of file Poly.h.

{}

## PolyBase() [4/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | poly | p,
|  | ring | r )

inline

Definition at line 413 of file Poly.h.

:ptr(new PolyImpl(p_Copy(p,r),r)){
}
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## PolyBase() [5/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | poly | p,
|  | ring | r,
|  | int | )

inline

Definition at line 415 of file Poly.h.

:ptr(new PolyImpl(p,r,0)){
}

## PolyBase() [6/6]

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase< variant, create_type_input, error_handle_traits >::PolyBase | ( | PolyImpl & | impl | ) |

inline protected

Definition at line 443 of file Poly.h.

:ptr(&impl){
}

## Member Function Documentation

## as_poly()

template<poly_variant variant, class create_type_input, class error_handle_traits>

poly PolyBase< variant, create_type_input, error_handle_traits >::as_poly | ( |  | ) | const

inline

Definition at line 334 of file Poly.h.

{
return p_Copy(ptr->p,ptr->getRing());
}

## begin()

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyInputIterator< create_type > PolyBase< variant, create_type_input, error_handle_traits >::begin | ( |  | ) |

inline

Definition at line 421 of file Poly.h.

{
return PolyInputIterator<create_type>(ptr->p,ptr->getRing());
}

## c_string()

template<poly_variant variant, class create_type_input, class error_handle_traits>

char * PolyBase< variant, create_type_input, error_handle_traits >::c_string | ( |  | ) | const

inline

Definition at line 374 of file Poly.h.

{
return p_String(ptr->p,ptr->getRing(),ptr->getRing());
}
p_String
char * p_String(poly p, ring lmRing, ring tailRing)
Definition polys0.cc:322

## checkIsSameRing()

template<poly_variant variant, class create_type_input, class error_handle_traits>
template<class T>

void PolyBase< variant, create_type_input, error_handle_traits >::checkIsSameRing | ( | T & | p | ) |

inline

Definition at line 338 of file Poly.h.

{
if (error_handle_traits::handleErrors)
{
if (p.getRing()!=this->getRing())
{
error_handle_traits::handleDifferentRing(this->getRing(),
p.getRing()
);
}
}
}
PolyBase::getRing
ring getRing() const
Definition Poly.h:427

## copy_on_write()

template<poly_variant variant, class create_type_input, class error_handle_traits>

void PolyBase< variant, create_type_input, error_handle_traits >::copy_on_write | ( |  | ) |

inline

Definition at line 362 of file Poly.h.

{
if (!ptr.unique())
{
ptr.reset(new PolyImpl(*ptr));
}
}

## end()

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyInputIterator< create_type > PolyBase< variant, create_type_input, error_handle_traits >::end | ( |  | ) |

inline

Definition at line 424 of file Poly.h.

{
return PolyInputIterator<create_type>(NULL, ptr->getRing());
}

## getInternalReference()

template<poly_variant variant, class create_type_input, class error_handle_traits>

poly PolyBase< variant, create_type_input, error_handle_traits >::getInternalReference | ( |  | ) |

inline protected

Definition at line 446 of file Poly.h.

{
return ptr->getInternalReference();
}

## getRing()

template<poly_variant variant, class create_type_input, class error_handle_traits>

ring PolyBase< variant, create_type_input, error_handle_traits >::getRing | ( |  | ) | const

inline

Definition at line 427 of file Poly.h.

{
return ptr->getRing();
}

## leadCoef()

template<poly_variant variant, class create_type_input, class error_handle_traits>

Number PolyBase< variant, create_type_input, error_handle_traits >::leadCoef | ( |  | ) |

inline

Definition at line 433 of file Poly.h.

{
return ptr->leadCoef();
}

## leadExp()

template<poly_variant variant, class create_type_input, class error_handle_traits>

Intvec PolyBase< variant, create_type_input, error_handle_traits >::leadExp | ( |  | ) |

inline

Definition at line 352 of file Poly.h.

{
int nvars=rVar(ptr->r.get());
Intvec res(nvars);
for(int i=0;i<nvars;i++)
{
res[i]=p_GetExp(ptr->p,i+1,ptr->getRing());
}
return res;
}
res
CanonicalForm res
Definition facAbsFact.cc:60
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598

## lmTotalDegree()

template<poly_variant variant, class create_type_input, class error_handle_traits>

int PolyBase< variant, create_type_input, error_handle_traits >::lmTotalDegree | ( |  | ) | const

inline

Definition at line 430 of file Poly.h.

{
return pTotaldegree(ptr->p);
}
pTotaldegree
static long pTotaldegree(poly p)
Definition polys.h:283

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

template<poly_variant variant, class create_type, class error_traits>

PolyBase< variant, create_type, error_traits > & PolyBase< variant, create_type, error_traits >::operator*= | ( | const Poly & | p2 | ) |

inline

Definition at line 643 of file Poly.h.

{
copy_on_write();
*ptr *= *p2.ptr;
return *this;
}
PolyBase::copy_on_write
void copy_on_write()
Definition Poly.h:362

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

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase & PolyBase< variant, create_type_input, error_handle_traits >::operator*= | ( | Number | n | ) |

inline

Definition at line 401 of file Poly.h.

{
copy_on_write();
*ptr *=n;
return *this;
}

## operator+=()

template<poly_variant variant, class create_type_input, class error_handle_traits>

PolyBase & PolyBase< variant, create_type_input, error_handle_traits >::operator+= | ( | const PolyBase< variant, create_type_input, error_handle_traits > & | p2 | ) |

inline

Definition at line 393 of file Poly.h.

{
checkIsSameRing(p2);
copy_on_write();
*ptr += *p2.ptr;
return *this;
}
PolyBase::checkIsSameRing
void checkIsSameRing(T &p)
Definition Poly.h:338

## operator-()

template<poly_variant variant, class create_type_input, class error_handle_traits>

create_type PolyBase< variant, create_type_input, error_handle_traits >::operator- | ( |  | ) |

inline

Definition at line 436 of file Poly.h.

{
create_type erg(*this);
erg*=Number(-1,ptr->getRing());
return erg;
}
PolyBase::create_type
create_type_input create_type
Definition Poly.h:350

## print()

template<poly_variant variant, class create_type_input, class error_handle_traits>

void PolyBase< variant, create_type_input, error_handle_traits >::print | ( |  | ) | const

inline

Definition at line 369 of file Poly.h.

{
ptr->print();
}

## Field Documentation

## ptr

template<poly_variant variant, class create_type_input, class error_handle_traits>

shared_ptr<PolyImpl> PolyBase< variant, create_type_input, error_handle_traits >::ptr

protected

Definition at line 451 of file Poly.h.

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

- Singular/dyn_modules/python/Number.h
- Singular/dyn_modules/python/Poly.h