CoCoALib-0.9905 date: 23 May 2007

CoCoA::ideal Class Reference

#include <ideal.H>

List of all members.

Public Member Functions

 ideal (IdealBase *IPtr)
 ideal (const ring &R)
 ideal (const ring &R, ConstRefRingElem r)
 ideal (const ring &R, const ZZ &N)
 ideal (const ring &R, long n)
 ideal (const ring &R, const std::vector< RingElem > &gens)
 ideal (const ideal &copy)
idealoperator= (const ideal &rhs)
 ~ideal ()
const IdealBasemyIdealPtr () const
const IdealBaseoperator-> () const


IdealBaseMakeUnique (ideal &I)

Detailed Description

      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 ideal

The class ideal is for representing values which are ideals of some
ring.  There are three ways to create an ideal (note that the ring
containing the ideal must ALWAYS be specified):

  ideal I(R)       I is the zero ideal of the ring R

  ideal I(R, r)    I is the principal ideal of R generated by r
                   (r must be a RingElem belonging to R)

  ideal I(R, gens) I is the ideal of R generated by the RingElems
                   in the C++ vector<> gens, all the generators must
                   belong to R

The permitted operations on ideals are:
[let I and J be two ideals of the same ring]

  I+J              the sum of two ideals

  I += J           equivalent to I = I+J

  intersection(I, J)  intersection of two ideals

  colon(I, J)      the quotient of two ideals

We may also enquire about certain properties of an ideal:

  IsZero(I)        true iff the ideal is a zero ideal

  IsOne(I)         true iff the ideal is the whole ring

  IsMaximal(I)     true iff the ideal is maximal in its ring
                   (i.e. iff the quotient ring is a field)

  IsPrime(I)       true iff the ideal is prime
                   (i.e. quotient ring has no zero-divisors)

  IsContained(I, J) true iff the ideal I is a subset of the ideal J

  IsElem(r, I)     true iff r is an element of the ideal I

  I == J           true iff the ideals are equal
                   (their generating sets may be different)

  AmbientRing(I)   the ring in which the ideal I resides

  gens(I)          a C++ vector<> of RingElems which generate I

  TidyGens(I)      a C++ vector<> of RingElems which generate I
                   (this generating set is in some way "reduced",
                    and will never contain a zero element)

It is also possible to give some information about an ideal:

 I->UserAssertsIsPrime()       to specify that I is known to be prime
 I->UserAssertsIsNotPrime()    to specify that I is known not to be prime
 I->UserAssertsIsMaximal()     to specify that I is known to be maximal
 I->UserAssertsIsNotMaximal()  to specify that I is known not to be maximal

Making an incorrect assertion using these functions may lead to a
program crash, or at least to poorer run-time performance.

Writing new types of ideal

Anyone who writes a new type of ring class will have to consider writing
a new type of ideal class to go with that ring.  The ideal class must be
derived from the abstract class IdealBase (and to be instantiable must
offer implementations of all pure virtual functions).  Be especially
careful to update the data members IamPrime and IamMaximal in the
non-const member functions (add, intersection, and colon).

Some guidance may be obtained from looking at the FieldIdealImpl class which
implements ideals in a field (there are only two: ideal(0) and ideal(1)).
See the file FieldIdeal.txt

Maintainer documentation for the classes ideal, IdealBase

The class ideal is little more than a reference counting smart pointer
class pointing to an object of type derived from IdealBase.  This
approach allows many different implementations of ideals to be
manipulated in a convenient and transparent manner using a common
abstract interface.

The abstract class IdealBase specifies the interface which every
concrete ideal class must offer.  It is more complicated than one might
expect partly because we want to allow the advanced user to tell the
ideal whether it has certain important properties (which might be
computationally expensive to determine automatically).

Bugs, Shortcomings and other ideas

The maintainer documentation is still quite incomplete.

Shouldn't ideals be created by a function called NewIdeal???

I am not at all sure about the wisdom of having implemented "IamPrime"
and "IamMaximal".  It seems to be terribly easy to forget to update
these values when ideal values are modified (e.g. in IdealBase::add).
It has also led to rather more complication that I would have liked.
BUT I don't see how to allow the user to state that an ideal is
maximal/prime without incurring such complication.

Functions to examine the bool3 flags could be handy for "heuristic"
short-cuts when an ideal is already known to have a certain property.

Is it worth having a constructor for principal ideals generated by
a number rather than a RingElem?  e.g.  NewIdeal(R,5) or NewIdeal(R,ZZ(5)).

Several member functions have names not in accordance with the coding

Definition at line 46 of file ideal.H.

Constructor & Destructor Documentation

CoCoA::ideal::ideal IdealBase IPtr  )  [explicit]

CoCoA::ideal::ideal const ring R  )  [explicit]

CoCoA::ideal::ideal const ring R,
ConstRefRingElem  r

CoCoA::ideal::ideal const ring R,
const ZZ N

CoCoA::ideal::ideal const ring R,
long  n

CoCoA::ideal::ideal const ring R,
const std::vector< RingElem > &  gens

CoCoA::ideal::ideal const ideal copy  ) 

CoCoA::ideal::~ideal  ) 

Member Function Documentation

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

const IdealBase * CoCoA::ideal::myIdealPtr  )  const [inline]

Definition at line 142 of file ideal.H.

const IdealBase * CoCoA::ideal::operator->  )  const [inline]

Definition at line 153 of file ideal.H.

Friends And Related Function Documentation

IdealBase* MakeUnique ideal I  )  [friend]

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