CoCoALib-0.9905 date: 23 May 2007


CoCoA::DistrMPolyInlPP Class Reference

Implementation of polynomials for RingDistrMPolyInlPP. More...

#include <DistrMPolyInlPP.H>

Collaboration diagram for CoCoA::DistrMPolyInlPP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DistrMPolyInlPP (const ring &, const PPMonoid &, const OrdvArith::reference &, MemPool &)
 DistrMPolyInlPP (const DistrMPolyInlPP &copy)
 ~DistrMPolyInlPP ()
DistrMPolyInlPPoperator= (const DistrMPolyInlPP &rhs)
DistrMPolyInlPPoperator= (long rhs)
DistrMPolyInlPPoperator= (const ZZ &rhs)
summandmyCopySummand (const summand *original) const
void myAssignZero ()
bool IsEqual (const summand *const lhs, const summand *const rhs) const
void myDeleteLM ()
void myAddMul (const DistrMPolyInlPP &h, const DistrMPolyInlPP &g, bool SkipLMg)
void WeylAddMul (const DistrMPolyInlPP &h, const DistrMPolyInlPP &g)
void myReductionStep (const DistrMPolyInlPP &g)
void myReductionStepGCD (const DistrMPolyInlPP &g, RefRingElem fscale)
void myAddClear (DistrMPolyInlPP &g)
void myAppendClear (DistrMPolyInlPP &g)
void myMulByCoeff (RingElemConstRawPtr rawc)
 EXCEPTION SAFE.
void myDivByCoeff (RingElemConstRawPtr rawc)
 EXCEPTION SAFE.
void myMulByPP (PPMonoidElemConstRawPtr rawpp)
void WeylMul (PPMonoidElemConstRawPtr rawpp)
void myPushFront (RingElemConstRawPtr rawc, const std::vector< long > &expv)
void myPushBack (RingElemConstRawPtr rawc, const std::vector< long > &expv)
void myPushFront (summand *t)
void myPushBack (summand *t)
void RemoveSummand (summand **prev_link)
void InsertSummand (summand *s, summand **prev_link)
void myNegate ()
 MIGHT THROW????

Static Public Member Functions

static std::size_t SummandSize (const ring &, const OrdvArith::reference &OA)
static void ourSwap (DistrMPolyInlPP &, DistrMPolyInlPP &)

Private Member Functions

summandNewSummand (const DistrMPolyInlPP &f)
void myAddMulSummand (const summand *s, const DistrMPolyInlPP &g, bool SkipLMg)
void myWeylAddMulSummand (const summand *s, const DistrMPolyInlPP &g, bool SkipLMg)

Static Private Member Functions

static void ourDeleteSummands (summand *ptr, const ring &R, MemPool &MemMgr)

Private Attributes

const ring myCoeffRing
const PPMonoid myPPM
OrdvArith::reference myOrdvArith
MemPoolmySummandMemory
summand ** myEnd
summandmySummands

Friends

const ringCoeffRing (const DistrMPolyInlPP &f)
const PPMonoidPPM (const DistrMPolyInlPP &f)
bool IsCompatible (const DistrMPolyInlPP &f, const DistrMPolyInlPP &g)
std::size_t NumTerms (const DistrMPolyInlPP &f)
ConstRefRingElem LC (const DistrMPolyInlPP &f)
RingElemRawPtrRawLC (DistrMPolyInlPP &f)
const RingElemRawPtrRawLC (const DistrMPolyInlPP &f)
ConstRefPPMonoidElem LPP (const DistrMPolyInlPP &f)
int CmpLPP (const DistrMPolyInlPP &f, const DistrMPolyInlPP &g)
void MoveLM (DistrMPolyInlPP &f, DistrMPolyInlPP &g)
void DivLM (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &f, const DistrMPolyInlPP &g)
bool IsZeroAddLCs (DistrMPolyInlPP &f, DistrMPolyInlPP &g)
void add (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)
void sub (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)
bool div (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)
void gcd (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)
void output (std::ostream &out, const DistrMPolyInlPP &f)
bool IsZero (const DistrMPolyInlPP &f)
bool IsMonomial (const DistrMPolyInlPP &f)
bool IsEqual (const DistrMPolyInlPP &f, const DistrMPolyInlPP &g)
void deriv (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &, std::size_t IndetIndex)
void deriv (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &f, ConstRefPPMonoidElem x)
void WeylMul (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)
void WeylDiv (DistrMPolyInlPP &lhs, const DistrMPolyInlPP &g, const DistrMPolyInlPP &h)

Classes

class  AutoPtrSummand
class  iter
struct  summand

Detailed Description

Implementation of polynomials for RingDistrMPolyInlPP.

      Copyright (c)  2005 John Abbott
      Permission is granted to copy, distribute and/or modify this document
      under the terms of the GNU Free Documentation License, Version 1.2;
      with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
      A copy of the licence is included in the file COPYING in this directory.




User documentation for the class DistrMPolyInlPP
------------------------------------------------

If you are not a CoCoA library developer then most likely you should not
be considering using this class -- use a polynomial ring instead.  That
way you will gain ease of use and safety with only a small performance
penalty.

This class should be seen and used only by CoCoA library implementors;
normal users should use the polynomial rings (which internally may well
use DMPIs to represent their elements).

The class DistrMPolyInlPP implements multivariate polynomials
represented as ordered linked lists of summands, each summand is made up
of a coefficient (RingBase::RawValue) and a power product represented as
an order vector.

The implementation is oriented towards speed rather than safety or ease
of use.  To this end argument sanity checks (and other types too) should
normally use CoCoA_ASSERT rather than CoCoAError.


Maintainer documentation for the class DistrMPolyInlPP
------------------------------------------------------

NO DOCUMENTATION YET WRITTEN.

This code is very ugly, and I am far from happy with it.  I hope it will
eventually become much cleaner while maintaining the speed.


Bugs and Shortcomings
---------------------

The biggest bug is the definition of the struct summand which is NOT
PORTABLE since C++ compilers do not guarantee to respect the order of
fields in a structure.  I do not yet know how best to avoid this without
incurring a run-time penalty.

This code is apparently stable but surprisingly ugly and awkward to use.
I continue to hope that the same speed can be achieved with cleaner
code.  As an example of how bad the code is just take a look at the
function deriv (which computes derivatives) -- it is far too long and
incomprehensible.  There must be better way!

The classes DistrMPolyInlPP, PPMonoid and PPOrdering are more closely
tied together than I would really like.

Iterators are giving me headaches -- we need them, but they seem to
expose implementation details.

Definition at line 49 of file DistrMPolyInlPP.H.


Constructor & Destructor Documentation

CoCoA::DistrMPolyInlPP::DistrMPolyInlPP const ring ,
const PPMonoid ,
const OrdvArith::reference ,
MemPool
 

CoCoA::DistrMPolyInlPP::DistrMPolyInlPP const DistrMPolyInlPP copy  ) 
 

CoCoA::DistrMPolyInlPP::~DistrMPolyInlPP  ) 
 


Member Function Documentation

summand* CoCoA::DistrMPolyInlPP::NewSummand const DistrMPolyInlPP f  )  [private]
 

static void CoCoA::DistrMPolyInlPP::ourDeleteSummands summand ptr,
const ring R,
MemPool MemMgr
[static, private]
 

DistrMPolyInlPP& CoCoA::DistrMPolyInlPP::operator= const DistrMPolyInlPP rhs  ) 
 

DistrMPolyInlPP& CoCoA::DistrMPolyInlPP::operator= long  rhs  ) 
 

DistrMPolyInlPP& CoCoA::DistrMPolyInlPP::operator= const ZZ rhs  ) 
 

std::size_t CoCoA::DistrMPolyInlPP::SummandSize const ring ,
const OrdvArith::reference OA
[inline, static]
 

Definition at line 248 of file DistrMPolyInlPP.H.

References CoCoA::OrdvArith::OrdvWords().

static void CoCoA::DistrMPolyInlPP::ourSwap DistrMPolyInlPP ,
DistrMPolyInlPP
[static]
 

Referenced by CoCoA::swap().

summand* CoCoA::DistrMPolyInlPP::myCopySummand const summand original  )  const
 

void CoCoA::DistrMPolyInlPP::myAssignZero  ) 
 

bool CoCoA::DistrMPolyInlPP::IsEqual const summand *const   lhs,
const summand *const   rhs
const
 

void CoCoA::DistrMPolyInlPP::myDeleteLM  ) 
 

void CoCoA::DistrMPolyInlPP::myAddMul const DistrMPolyInlPP h,
const DistrMPolyInlPP g,
bool  SkipLMg
 

void CoCoA::DistrMPolyInlPP::WeylAddMul const DistrMPolyInlPP h,
const DistrMPolyInlPP g
 

void CoCoA::DistrMPolyInlPP::myReductionStep const DistrMPolyInlPP g  ) 
 

void CoCoA::DistrMPolyInlPP::myReductionStepGCD const DistrMPolyInlPP g,
RefRingElem  fscale
 

void CoCoA::DistrMPolyInlPP::myAddClear DistrMPolyInlPP g  ) 
 

void CoCoA::DistrMPolyInlPP::myAppendClear DistrMPolyInlPP g  ) 
 

void CoCoA::DistrMPolyInlPP::myMulByCoeff RingElemConstRawPtr  rawc  ) 
 

EXCEPTION SAFE.

void CoCoA::DistrMPolyInlPP::myDivByCoeff RingElemConstRawPtr  rawc  ) 
 

EXCEPTION SAFE.

void CoCoA::DistrMPolyInlPP::myMulByPP PPMonoidElemConstRawPtr  rawpp  ) 
 

void CoCoA::DistrMPolyInlPP::WeylMul PPMonoidElemConstRawPtr  rawpp  ) 
 

void CoCoA::DistrMPolyInlPP::myPushFront RingElemConstRawPtr  rawc,
const std::vector< long > &  expv
 

void CoCoA::DistrMPolyInlPP::myPushBack RingElemConstRawPtr  rawc,
const std::vector< long > &  expv
 

void CoCoA::DistrMPolyInlPP::myPushFront summand t  ) 
 

void CoCoA::DistrMPolyInlPP::myPushBack summand t  ) 
 

void CoCoA::DistrMPolyInlPP::RemoveSummand summand **  prev_link  ) 
 

void CoCoA::DistrMPolyInlPP::InsertSummand summand s,
summand **  prev_link
 

void CoCoA::DistrMPolyInlPP::myNegate  ) 
 

MIGHT THROW????

void CoCoA::DistrMPolyInlPP::myAddMulSummand const summand s,
const DistrMPolyInlPP g,
bool  SkipLMg
[private]
 

void CoCoA::DistrMPolyInlPP::myWeylAddMulSummand const summand s,
const DistrMPolyInlPP g,
bool  SkipLMg
[private]
 


Friends And Related Function Documentation

const ring& CoeffRing const DistrMPolyInlPP f  )  [friend]
 

Referenced by CoCoA::DistrMPolyInlPP::iter::myCoeff().

const PPMonoid& PPM const DistrMPolyInlPP f  )  [friend]
 

Referenced by CoCoA::DistrMPolyInlPP::iter::myPP().

bool IsCompatible const DistrMPolyInlPP f,
const DistrMPolyInlPP g
[friend]
 

std::size_t NumTerms const DistrMPolyInlPP f  )  [friend]
 

ConstRefRingElem LC const DistrMPolyInlPP f  )  [friend]
 

RingElemRawPtr& RawLC DistrMPolyInlPP f  )  [friend]
 

const RingElemRawPtr& RawLC const DistrMPolyInlPP f  )  [friend]
 

ConstRefPPMonoidElem LPP const DistrMPolyInlPP f  )  [friend]
 

int CmpLPP const DistrMPolyInlPP f,
const DistrMPolyInlPP g
[friend]
 

void MoveLM DistrMPolyInlPP f,
DistrMPolyInlPP g
[friend]
 

void DivLM DistrMPolyInlPP lhs,
const DistrMPolyInlPP f,
const DistrMPolyInlPP g
[friend]
 

bool IsZeroAddLCs DistrMPolyInlPP f,
DistrMPolyInlPP g
[friend]
 

void add DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 

void sub DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 

bool div DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 

void gcd DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 

void output std::ostream &  out,
const DistrMPolyInlPP f
[friend]
 

bool IsZero const DistrMPolyInlPP f  )  [friend]
 

bool IsMonomial const DistrMPolyInlPP f  )  [friend]
 

bool IsEqual const DistrMPolyInlPP f,
const DistrMPolyInlPP g
[friend]
 

void deriv DistrMPolyInlPP lhs,
const DistrMPolyInlPP ,
std::size_t  IndetIndex
[friend]
 

void deriv DistrMPolyInlPP lhs,
const DistrMPolyInlPP f,
ConstRefPPMonoidElem  x
[friend]
 

void WeylMul DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 

void WeylDiv DistrMPolyInlPP lhs,
const DistrMPolyInlPP g,
const DistrMPolyInlPP h
[friend]
 


Member Data Documentation

const ring CoCoA::DistrMPolyInlPP::myCoeffRing [private]
 

Definition at line 91 of file DistrMPolyInlPP.H.

Referenced by CoCoA::CoeffRing().

const PPMonoid CoCoA::DistrMPolyInlPP::myPPM [private]
 

Definition at line 92 of file DistrMPolyInlPP.H.

Referenced by CoCoA::PPM().

OrdvArith::reference CoCoA::DistrMPolyInlPP::myOrdvArith [private]
 

Definition at line 93 of file DistrMPolyInlPP.H.

Referenced by CoCoA::CmpLPP().

MemPool& CoCoA::DistrMPolyInlPP::mySummandMemory [private]
 

Definition at line 94 of file DistrMPolyInlPP.H.

summand** CoCoA::DistrMPolyInlPP::myEnd [private]
 

Definition at line 95 of file DistrMPolyInlPP.H.

summand* CoCoA::DistrMPolyInlPP::mySummands [private]
 

Definition at line 96 of file DistrMPolyInlPP.H.

Referenced by CoCoA::CmpLPP().


The documentation for this class was generated from the following file:
Generated on Wed May 23 13:44:21 2007 for CoCoALib by  doxygen 1.4.6