Loading...
Searching...
No Matches
ftmpl_list.h
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
#ifndef INCL_LIST_H
#define INCL_LIST_H
#ifndef NOSTREAMIO
#ifdef HAVE_IOSTREAM
#include <iostream>
#define OSTREAM std::ostream
#elif defined(HAVE_IOSTREAM_H)
#include <iostream.h>
#define OSTREAM ostream
#endif
#endif /* NOSTREAMIO */
template <class T>
class ListIterator;
template <class T>
class List;
#ifndef NOSTREAMIO
template <class T>
OSTREAM& operator<< ( OSTREAM &, const List<T> &);
#endif
template <class T>
class ListItem
{
private:
ListItem * next;
ListItem * prev;
T * item;
public:
ListItem( const ListItem<T>& );
ListItem( const T&, ListItem<T>*, ListItem<T>* );
ListItem( T* , ListItem<T>* , ListItem<T>* );
~ListItem();
ListItem<T>& operator= ( const ListItem<T>& );
ListItem<T>* getNext();
ListItem<T>* getPrev();
T& getItem();
#ifndef NOSTREAMIO
void print ( OSTREAM& );
#endif /* NOSTREAMIO */
friend class ListIterator<T>;
friend class List<T>;
};
template <class T>
class FACTORY_PUBLIC List
{
private:
ListItem<T> *first;
ListItem<T> *last;
int _length;
public:
List();
List( const List<T>& );
List( const T& );
~List();
List<T>& operator= ( const List<T>& );
void insert ( const T& );
void insert ( const T&, int (*cmpf)( const T&, const T& ) );
void insert ( const T&, int (*cmpf)( const T&, const T& ), void (*insf)( T&, const T& ) );
void append ( const T& );
int isEmpty() const;
int length() const;
T getFirst() const;
void removeFirst();
T getLast() const;
void removeLast();
void sort ( int (*) ( const T&, const T& ) );
#ifndef NOSTREAMIO
void print ( OSTREAM & ) const;
friend OSTREAM& operator<< <T>( OSTREAM & os, const List<T> & l );
#endif /* NOSTREAMIO */
friend class ListIterator<T>;
};
#ifndef NOSTREAMIO
template <class T>
OSTREAM& operator<< ( OSTREAM & os, const List<T> & l );
#endif /* NOSTREAMIO */
template <class T>
class FACTORY_PUBLIC ListIterator {
private:
List<T> *theList;
ListItem<T> *current;
public:
ListIterator();
ListIterator( const ListIterator<T>& );
ListIterator( const List<T>& );
~ListIterator();
ListIterator<T>& operator = ( const ListIterator<T>& );
ListIterator<T>& operator = ( const List<T>& );
T& getItem() const;
int hasItem();
void operator++();
void operator--();
void operator++( int );
void operator--( int );
void firstItem();
void lastItem();
void insert( const T& );
void append( const T& );
void remove( int moveright );
};
template <class T>
int operator== (const List<T>&, const List<T>& );
template <class T>
List<T> Union ( const List<T>&, const List<T>& );
template <class T>
List<T> Difference ( const List<T>&, const List<T>& );
template <class T>
List<T> Union ( const List<T> &, const List<T> & , int (*ecmpf)( const T&, const T& ));
template <class T>
List<T> Difference ( const List<T> &, const List<T> & , int (*ecmpf)( const T&, const T& ));
template <class T>
List<T> Difference ( const List<T> & F, const T & G);
template <class T>
List<T> Difference ( const List<T> & F, const T & G, int (*ecmpf)( const T&, const T& ));
template <class T>
List<T> Union ( const List<T>&, const List<T>&, int (*cmpf)( const T&, const T& ), void (*insf)( T&, const T& ) );
template <class T>
T prod ( const List<T>& );
template <class T>
bool find (const List<T>&, const T& t);
template <class T>
bool find (const List<T> & F, const T& t, int (*ecmpf)( const T&, const T& ));
#endif /* ! INCL_LIST_H */
OSTREAM
#define OSTREAM
Definition canonicalform.h:16
l
int l
Definition cfEzgcd.cc:100
ListItem
Definition ftmpl_list.h:29
ListItem::getNext
ListItem< T > * getNext()
Definition ftmpl_list.cc:53
ListItem::getItem
T & getItem()
Definition ftmpl_list.cc:67
ListItem::next
ListItem * next
Definition ftmpl_list.h:31
ListItem::~ListItem
~ListItem()
Definition ftmpl_list.cc:33
ListItem::prev
ListItem * prev
Definition ftmpl_list.h:32
ListItem::item
T * item
Definition ftmpl_list.h:33
ListItem::operator=
ListItem< T > & operator=(const ListItem< T > &)
Definition ftmpl_list.cc:40
ListItem::ListItem
ListItem(const ListItem< T > &)
Definition ftmpl_list.cc:6
ListItem::print
void print(OSTREAM &)
Definition ftmpl_list.cc:74
ListItem::getPrev
ListItem< T > * getPrev()
Definition ftmpl_list.cc:60
ListIterator
Definition ftmpl_list.h:87
ListIterator::lastItem
void lastItem()
Definition ftmpl_list.cc:485
ListIterator::firstItem
void firstItem()
Definition ftmpl_list.cc:478
ListIterator::ListIterator
ListIterator(const List< T > &)
Definition ftmpl_list.cc:398
ListIterator::ListIterator
ListIterator()
Definition ftmpl_list.cc:382
ListIterator::remove
void remove(int moveright)
Definition ftmpl_list.cc:526
ListIterator::operator--
void operator--(int)
Definition ftmpl_list.cc:470
ListIterator::operator--
void operator--()
Definition ftmpl_list.cc:454
ListIterator::ListIterator
ListIterator(const ListIterator< T > &)
Definition ftmpl_list.cc:390
ListIterator< CFAFactor >::theList
List< CFAFactor > * theList
Definition ftmpl_list.h:89
ListIterator::append
void append(const T &)
Definition ftmpl_list.cc:509
ListIterator::~ListIterator
~ListIterator()
Definition ftmpl_list.cc:406
ListIterator::operator++
void operator++()
Definition ftmpl_list.cc:446
ListIterator::hasItem
int hasItem()
Definition ftmpl_list.cc:439
ListIterator::operator++
void operator++(int)
Definition ftmpl_list.cc:462
ListIterator::getItem
T & getItem() const
Definition ftmpl_list.cc:431
ListIterator< CFAFactor >::current
ListItem< CFAFactor > * current
Definition ftmpl_list.h:90
ListIterator::insert
void insert(const T &)
Definition ftmpl_list.cc:492
List
Definition ftmpl_list.h:52
List::getFirst
T getFirst() const
Definition ftmpl_list.cc:279
List< CFAFactor >::first
ListItem< CFAFactor > * first
Definition ftmpl_list.h:54
List::~List
~List()
Definition ftmpl_list.cc:127
List::removeFirst
void removeFirst()
Definition ftmpl_list.cc:287
List::sort
void sort(int(*)(const T &, const T &))
Definition ftmpl_list.cc:339
List::List
List()
Definition ftmpl_list.cc:86
List::length
int length() const
Definition ftmpl_list.cc:273
List::append
void append(const T &)
Definition ftmpl_list.cc:256
List::insert
void insert(const T &, int(*cmpf)(const T &, const T &))
Definition ftmpl_list.cc:204
List::getLast
T getLast() const
Definition ftmpl_list.cc:309
List::insert
void insert(const T &)
Definition ftmpl_list.cc:193
List< CFAFactor >::_length
int _length
Definition ftmpl_list.h:56
List::isEmpty
int isEmpty() const
Definition ftmpl_list.cc:267
List< CFAFactor >::last
ListItem< CFAFactor > * last
Definition ftmpl_list.h:55
List::insert
void insert(const T &, int(*cmpf)(const T &, const T &), void(*insf)(T &, const T &))
Definition ftmpl_list.cc:230
List::print
void print(OSTREAM &) const
Definition ftmpl_list.cc:366
List::List
List(const T &)
Definition ftmpl_list.cc:119
List::removeLast
void removeLast()
Definition ftmpl_list.cc:317
List::List
List(const List< T > &)
Definition ftmpl_list.cc:94
prod
fq_nmod_poly_t prod
Definition facHensel.cc:100
OSTREAM
#define OSTREAM
Definition ftmpl_list.h:9
Difference
List< T > Difference(const List< T > &, const List< T > &)
Definition ftmpl_list.cc:622
Union
List< T > Union(const List< T > &, const List< T > &)
Definition ftmpl_list.cc:563
operator==
int operator==(const List< T > &, const List< T > &)
Definition ftmpl_list.cc:176
find
bool find(const List< T > &, const T &t)
Definition ftmpl_list.cc:700
operator<<
OSTREAM & operator<<(OSTREAM &, const List< T > &)
Definition ftmpl_list.cc:555
FACTORY_PUBLIC
#define FACTORY_PUBLIC
Definition globaldefs.h:25
T
STATIC_VAR jList * T
Definition janet.cc:30
G
STATIC_VAR TreeM * G
Definition janet.cc:31