My Project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types
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_typeiterator
 

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)
 
PolyBaseoperator+= (const PolyBase &p2)
 
PolyBaseoperator*= (const Poly &p2)
 
PolyBaseoperator*= (Number n)
 
virtual ~PolyBase ()
 
 PolyBase (poly p, ring r)
 
 PolyBase (poly p, ring r, int)
 
PolyInputIterator< create_typebegin ()
 
PolyInputIterator< create_typeend ()
 
ring getRing () const
 
int lmTotalDegree () const
 
Number leadCoef ()
 
create_type operator- ()
 

Protected Member Functions

 PolyBase (PolyImpl &impl)
 
poly getInternalReference ()
 

Protected Attributes

shared_ptr< PolyImplptr
 

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.

378 :ptr(new PolyImpl((poly) NULL,r))
379 { }
shared_ptr< PolyImpl > ptr
Definition: Poly.h:451
Definition: Poly.h:45
#define NULL
Definition: omList.c:12

◆ 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.

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

◆ 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.

388 :ptr(p.ptr){
389 }
int p
Definition: cfModGcd.cc:4078

◆ ~PolyBase()

template<poly_variant variant, class create_type_input , class error_handle_traits >
virtual PolyBase< variant, create_type_input, error_handle_traits >::~PolyBase ( )
inlinevirtual

Definition at line 412 of file Poly.h.

412{}

◆ 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.

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

◆ 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.

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

◆ 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)
inlineprotected

Definition at line 443 of file Poly.h.

443 :ptr(&impl){
444
445 }

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.

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

◆ 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.

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

◆ 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.

375 {
376 return p_String(ptr->p,ptr->getRing(),ptr->getRing());
377 }
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.

339 {
340 if (error_handle_traits::handleErrors)
341 {
342 if (p.getRing()!=this->getRing())
343 {
344 error_handle_traits::handleDifferentRing(this->getRing(),
345 p.getRing()
346 );
347 }
348 }
349 }
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.

363 {
364 if (!ptr.unique())
365 {
366 ptr.reset(new PolyImpl(*ptr));
367 }
368 }

◆ 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.

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

◆ getInternalReference()

template<poly_variant variant, class create_type_input , class error_handle_traits >
poly PolyBase< variant, create_type_input, error_handle_traits >::getInternalReference ( )
inlineprotected

Definition at line 446 of file Poly.h.

446 {
447 return ptr->getInternalReference();
448 }

◆ 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.

427 {
428 return ptr->getRing();
429 }

◆ 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.

433 {
434 return ptr->leadCoef();
435 }

◆ 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.

353 {
354 int nvars=rVar(ptr->r.get());
355 Intvec res(nvars);
356 for(int i=0;i<nvars;i++)
357 {
358 res[i]=p_GetExp(ptr->p,i+1,ptr->getRing());
359 }
360 return res;
361 }
int i
Definition: cfEzgcd.cc:132
Definition: IIntvec.h:6
CanonicalForm res
Definition: facAbsFact.cc:60
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:467
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:592

◆ 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.

430 {
431 return pTotaldegree(ptr->p);
432 }
static long pTotaldegree(poly p)
Definition: polys.h:282

◆ 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.

643 {
645 *ptr *= *p2.ptr;
646
647 return *this;
648 }
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.

401 {
403 *ptr *=n;
404
405 return *this;
406 }

◆ 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.

393 {
394 checkIsSameRing(p2);
396 *ptr += *p2.ptr;
397
398 return *this;
399 }
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.

436 {
437 create_type erg(*this);
438 erg*=Number(-1,ptr->getRing());
439 return erg;
440 }
Definition: Number.h:34
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.

370 {
371 ptr->print();
372 }

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: