CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Friends
poly< T > Class Template Reference

#include <poly.h>

Inheritance diagram for poly< T >:

Classes

class  const_iterator
 

Public Types

typedef std::list< std::set< T > >::iterator column_iterator
 
typedef std::list< std::set< T > >::const_iterator const_column_iterator
 
typedef T value_type
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
auto & getColumns ()
 
auto const & getColumns () const
 
poly operator*= (const poly &R)
 
poly operator*= (const T &r)
 
poly operator++ ()
 
poly operator+= (const poly &R)
 
poly operator+= (const T &r)
 
bool operator< (const poly &R) const
 
 poly ()
 
 poly (const T &t)
 
size_t size () const
 

Private Attributes

std::list< std::set< T > > columns
 

Friends

poly< Toperator+ (const char *, const poly< T > &)
 
poly< Toperator+ (const poly< T > &, const char *)
 

Detailed Description

template<class T>
class poly< T >

Definition at line 11 of file poly.h.

Member Typedef Documentation

◆ column_iterator

template<class T>
typedef std::list<std::set<T> >::iterator poly< T >::column_iterator

Definition at line 29 of file poly.h.

◆ const_column_iterator

template<class T>
typedef std::list<std::set<T> >::const_iterator poly< T >::const_column_iterator

Definition at line 30 of file poly.h.

◆ value_type

template<class T>
typedef T poly< T >::value_type

Definition at line 27 of file poly.h.

Constructor & Destructor Documentation

◆ poly() [1/2]

template<class T>
poly< T >::poly ( )
inline

Definition at line 31 of file poly.h.

31 {}

◆ poly() [2/2]

template<class T>
poly< T >::poly ( const T t)
inline

Definition at line 32 of file poly.h.

32 { operator+=(t); }

References poly< T >::operator+=(), and OrderedSet::t.

Member Function Documentation

◆ begin()

template<class T>
const_iterator poly< T >::begin ( ) const
inline

Definition at line 65 of file poly.h.

65 { return const_iterator(*this); }

◆ end()

template<class T>
const_iterator poly< T >::end ( ) const
inline

Definition at line 66 of file poly.h.

66 { return const_iterator::end_of(*this); }

References poly< T >::const_iterator::end_of().

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

◆ getColumns() [1/2]

template<class T>
auto& poly< T >::getColumns ( )
inline

Definition at line 69 of file poly.h.

69 { return columns; }

References poly< T >::columns.

◆ getColumns() [2/2]

template<class T>
auto const& poly< T >::getColumns ( ) const
inline

Definition at line 68 of file poly.h.

68 { return columns; }

References poly< T >::columns.

◆ operator*=() [1/2]

template<class T>
poly poly< T >::operator*= ( const poly< T > &  R)
inline

Definition at line 58 of file poly.h.

58  {
59  columns.back().insert(R.begin(), R.end());
60  return *this;
61  }

References poly< T >::columns, and dttmaxenums::R.

◆ operator*=() [2/2]

template<class T>
poly poly< T >::operator*= ( const T r)
inline

Definition at line 54 of file poly.h.

54  {
55  columns.back().insert(r);
56  return *this;
57  }

References poly< T >::columns, and alignCSCRings::r.

Referenced by poly< T >::operator+=().

◆ operator++()

template<class T>
poly poly< T >::operator++ ( )
inline

Definition at line 42 of file poly.h.

42  {
43  columns.push_back(std::set<T>());
44  return *this;
45  }

References poly< T >::columns.

Referenced by poly< T >::operator+=().

◆ operator+=() [1/2]

template<class T>
poly poly< T >::operator+= ( const poly< T > &  R)
inline

Definition at line 46 of file poly.h.

46  {
47  columns.insert(columns.end(), R.columns.begin(), R.columns.end());
48  return *this;
49  }

References poly< T >::columns, and dttmaxenums::R.

Referenced by poly< T >::poly().

◆ operator+=() [2/2]

template<class T>
poly poly< T >::operator+= ( const T r)
inline

Definition at line 50 of file poly.h.

50  {
51  operator++();
52  return operator*=(r);
53  }

References poly< T >::operator*=(), poly< T >::operator++(), and alignCSCRings::r.

◆ operator<()

template<class T>
bool poly< T >::operator< ( const poly< T > &  R) const
inline

Definition at line 34 of file poly.h.

34  {
35  const_column_iterator column(columns.begin()), Rcolumn(R.columns.begin());
36  while (column != columns.end() && Rcolumn != R.columns.end() && *column == *Rcolumn) {
37  ++column;
38  ++Rcolumn;
39  }
40  return column != columns.end() && Rcolumn != R.columns.end() && *column < *Rcolumn;
41  }

References poly< T >::columns, and dttmaxenums::R.

◆ size()

template<class T>
size_t poly< T >::size ( void  ) const
inline

Definition at line 71 of file poly.h.

71  {
72  if (columns.empty())
73  return 0;
74  size_t size = 1;
75  for (const_column_iterator column = columns.begin(); column != columns.end(); ++column)
76  size *= column->size();
77  return size;
78  }

References poly< T >::columns.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Friends And Related Function Documentation

◆ operator+ [1/2]

template<class T>
poly<T> operator+ ( const char *  lhs,
const poly< T > &  rhs 
)
friend

Definition at line 148 of file poly.h.

148  {
149  return poly<T>(lhs) + rhs;
150 }

◆ operator+ [2/2]

template<class T>
poly<T> operator+ ( const poly< T > &  lhs,
const char *  rhs 
)
friend

Definition at line 144 of file poly.h.

144  {
145  return lhs + poly<T>(rhs);
146 }

Member Data Documentation

◆ columns

template<class T>
std::list<std::set<T> > poly< T >::columns
private
poly::columns
std::list< std::set< T > > columns
Definition: poly.h:24
poly::const_column_iterator
std::list< std::set< T > >::const_iterator const_column_iterator
Definition: poly.h:30
poly::operator++
poly operator++()
Definition: poly.h:42
OrderedSet.t
t
Definition: OrderedSet.py:90
poly::size
size_t size() const
Definition: poly.h:71
alignCSCRings.r
r
Definition: alignCSCRings.py:93
poly
Definition: poly.h:11
poly::const_iterator::end_of
static const_iterator end_of(const poly &p)
Definition: poly.h:134
poly::operator+=
poly operator+=(const poly &R)
Definition: poly.h:46
poly::operator*=
poly operator*=(const T &r)
Definition: poly.h:54
dttmaxenums::R
Definition: DTTMax.h:29