GiNaCRA  0.6.4
GiNaCRA::SampleList Struct Reference

Type for a sorted list of RealAlgebraicNumberPtr. More...

#include <CAD.h>

Inheritance diagram for GiNaCRA::SampleList:
Collaboration diagram for GiNaCRA::SampleList:

Public Member Functions

pair< iterator, bool > insert (const RealAlgebraicNumberPtr &r)
 Inserts an element into the sorted list at the correct position according to the order.
template<class InputIterator >
void insert (InputIterator first, InputIterator last)
 Inserts a range of elements into the sorted list.
void insert (const SampleList &l)
 Inserts another sampleList.
SampleList::iterator remove (SampleList::iterator position)
 Safely remove the element at position.
const RealAlgebraicNumberPtr next ()
 Determines the next sample in the order of insertion with no particular preference.
const RealAlgebraicNumberPtr nextNR ()
 Determines the next sample in the order of insertion, preferring the numerically represented samples.
const RealAlgebraicNumberPtr nextNonroot ()
 Determines the next sample in the order of insertion, preferring the non-root samples.
const RealAlgebraicNumberPtr nextRoot ()
 Determines the next sample in the order of insertion, preferring the non-root samples.
void pop ()
 Removes the element returned by next() from the list.
void popNR ()
 Removes the element returned by nextNR() from the list.
void popNonroot ()
 Removes the element returned by nextNonroot() from the list.
void popRoot ()
 Removes the element returned by nextRoot() from the list.
pair< SampleSimplification, bool > simplify ()
 Traverse all interval-represented samples and determine whether they could be simplified by numeric representations.
bool contains (RealAlgebraicNumberPtr r) const
 Determines containment of r in the list.
bool emptyNR () const
 Answers whether there are numerically represented samples left.
bool emptyIR () const
 Answers whether there are interval-represented samples left.
bool emptyNonroot () const
 Answers whether there are non-root represented samples left.
bool emptyRoot () const
 Answers whether there are root samples left.

Data Fields

elements
 STL member.

Private Member Functions

void removeFromNonrootRoot (RealAlgebraicNumberPtr r)
void removeFromQueue (RealAlgebraicNumberPtr r)
void removeFromNRIR (RealAlgebraicNumberPtr r)

Private Attributes

list< RealAlgebraicNumberPtrmQueue
 Queue containing all samples in the order of their insertion.
pair< list
< RealAlgebraicNumberNRPtr >
, list
< RealAlgebraicNumberIRPtr > > 
mNRsIRs
 Pair having in the first component one queue containing all numerically represented samples in the order of their insertion, and in the second component one queue containing all interval-represented samples in the order of their insertion.
pair< list
< RealAlgebraicNumberPtr >
, list< RealAlgebraicNumberPtr > > 
mNonrootsRoots
 Pair having in the first component one queue containing all non-root samples in the order of their insertion, and in the second component one queue containing all root samples in the order of their insertion.

Detailed Description

Type for a sorted list of RealAlgebraicNumberPtr.

Author:
Ulrich Loup
Since:
2011-12-19

Definition at line 59 of file CAD.h.


Member Function Documentation

Determines containment of r in the list.

Returns:
true if r is contained in the list, false otherwise

Definition at line 375 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less().

bool GiNaCRA::SampleList::emptyIR ( ) const [inline]

Answers whether there are interval-represented samples left.

Returns:
true if there is no IR sample left in the list, false otherwise

Definition at line 394 of file CAD.h.

References mNRsIRs.

bool GiNaCRA::SampleList::emptyNonroot ( ) const [inline]

Answers whether there are non-root represented samples left.

Returns:
true if there is no non-root sample left in the list, false otherwise

Definition at line 403 of file CAD.h.

References mNonrootsRoots.

bool GiNaCRA::SampleList::emptyNR ( ) const [inline]

Answers whether there are numerically represented samples left.

Returns:
true if there is no NR sample left in the list, false otherwise

Definition at line 385 of file CAD.h.

References mNRsIRs.

bool GiNaCRA::SampleList::emptyRoot ( ) const [inline]

Answers whether there are root samples left.

Returns:
true if there is no root sample left in the list, false otherwise

Definition at line 412 of file CAD.h.

References mNonrootsRoots.

pair<iterator, bool> GiNaCRA::SampleList::insert ( const RealAlgebraicNumberPtr r) [inline]

Inserts an element into the sorted list at the correct position according to the order.

Parameters:
rRealAlgebraicNumberPtr to be inserted
Returns:
a pair, with its member pair::first set to an iterator pointing to either the newly inserted element or to the element that already had its same value in the set. The pair::second element in the pair is set to true if a new element was inserted or false if an element with the same value existed. If a numeric representation is inserted, the method replaces a possibly existing interval representation.
Runtime complexity:
at most logarithmic in the size of the list

Definition at line 82 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::equal(), GiNaCRA::RealAlgebraicNumberFactory::less(), mNonrootsRoots, mNRsIRs, and mQueue.

Referenced by insert(), GiNaCRA::CAD::liftCheck(), and GiNaCRA::CAD::samples().

template<class InputIterator >
void GiNaCRA::SampleList::insert ( InputIterator  first,
InputIterator  last 
) [inline]

Inserts a range of elements into the sorted list.

Parameters:
firstdefining the first position to be inserted
lastdefining the last position up to which all elements, but *last, are inserted
Runtime complexity:
at most logarithmic in the size of the list

Definition at line 112 of file CAD.h.

References insert().

void GiNaCRA::SampleList::insert ( const SampleList l) [inline]

Inserts another sampleList.

Parameters:
lother sampleList
Runtime complexity:
at most logarithmic in the size of this list and linear in the size of l

Definition at line 123 of file CAD.h.

References insert().

Determines the next sample in the order of insertion with no particular preference.

Returns:
next sample in the order of insertion

Definition at line 147 of file CAD.h.

References mQueue.

Referenced by pop().

Determines the next sample in the order of insertion, preferring the non-root samples.

Returns:
next sample in the order of insertion, preferring the non-root samples

Definition at line 175 of file CAD.h.

References mNonrootsRoots.

Referenced by popNonroot().

Determines the next sample in the order of insertion, preferring the numerically represented samples.

Before returning an interval-represented sample, the method tries to simplify the sample.

Returns:
next sample in the order of insertion, preferring the numerically represented samples

Definition at line 161 of file CAD.h.

References mNRsIRs.

Referenced by popNR().

Determines the next sample in the order of insertion, preferring the non-root samples.

Returns:
next sample in the order of insertion, preferring the non-root samples

Definition at line 189 of file CAD.h.

References mNonrootsRoots.

Referenced by popRoot().

void GiNaCRA::SampleList::pop ( ) [inline]

Removes the element returned by next() from the list.

Runtime complexity:
at most linear in the size of the list

Definition at line 202 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less(), mQueue, next(), removeFromNonrootRoot(), and removeFromNRIR().

Removes the element returned by nextNonroot() from the list.

The method does nothing if there is no non-root.

Runtime complexity:
at most linear in the size of the list

Definition at line 250 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less(), mNonrootsRoots, nextNonroot(), removeFromNRIR(), and removeFromQueue().

void GiNaCRA::SampleList::popNR ( ) [inline]

Removes the element returned by nextNR() from the list.

Runtime complexity:
at most logarithmic in the size of the list and linear in the number of roots in the list

Definition at line 224 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less(), mNRsIRs, nextNR(), removeFromNonrootRoot(), and removeFromQueue().

void GiNaCRA::SampleList::popRoot ( ) [inline]

Removes the element returned by nextRoot() from the list.

The method does nothing if there is no root.

Runtime complexity:
at most linear in the size of the list

Definition at line 276 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less(), mNonrootsRoots, nextRoot(), removeFromNRIR(), and removeFromQueue().

SampleList::iterator GiNaCRA::SampleList::remove ( SampleList::iterator  position) [inline]

Safely remove the element at position.

Parameters:
position
Returns:
the iterator to the next position in the container

Definition at line 133 of file CAD.h.

References removeFromNonrootRoot(), removeFromNRIR(), and removeFromQueue().

Definition at line 423 of file CAD.h.

References mNonrootsRoots.

Referenced by pop(), popNR(), and remove().

Definition at line 453 of file CAD.h.

References mNRsIRs.

Referenced by pop(), popNonroot(), popRoot(), and remove().

Definition at line 443 of file CAD.h.

References mQueue.

Referenced by popNonroot(), popNR(), popRoot(), and remove().

Traverse all interval-represented samples and determine whether they could be simplified by numeric representations.

If so, move these samples to the NRs.

Returns:
pair whose first component is a map from unsimplified real algebraic number pointers to real algebraic number pointers which were simplified; the second component is true if there were samples found which could be simplified.
Runtime complexity:
logarithmic in the number

Definition at line 305 of file CAD.h.

References GiNaCRA::RealAlgebraicNumberFactory::less(), mNonrootsRoots, mNRsIRs, mQueue, and GiNaCRA::print().


Field Documentation

template<typename T>
T std::list< T >::elements [inherited]

STL member.

Pair having in the first component one queue containing all non-root samples in the order of their insertion, and in the second component one queue containing all root samples in the order of their insertion.

Definition at line 70 of file CAD.h.

Referenced by emptyNonroot(), emptyRoot(), insert(), nextNonroot(), nextRoot(), popNonroot(), popRoot(), removeFromNonrootRoot(), and simplify().

Pair having in the first component one queue containing all numerically represented samples in the order of their insertion, and in the second component one queue containing all interval-represented samples in the order of their insertion.

Definition at line 67 of file CAD.h.

Referenced by emptyIR(), emptyNR(), insert(), nextNR(), popNR(), removeFromNRIR(), and simplify().

Queue containing all samples in the order of their insertion.

Definition at line 64 of file CAD.h.

Referenced by insert(), next(), pop(), removeFromQueue(), and simplify().


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