PolyBoRi
pbori_routines_dd.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_routines_pbori_routines_dd_h_
17 #define polybori_routines_pbori_routines_dd_h_
18 
19 // include basic definitions
20 #include <polybori/pbori_defs.h>
21 
22 // get addition definitions
25 #include <set>
26 #include <vector>
27 
29 
31 template<class DDType, class OutputType>
32 OutputType
34 
35  typedef typename DDType::idx_type idx_type;
36  typedef typename DDType::size_type size_type;
37  typedef OutputType term_type;
38 
39  term_type result(dd.ring());
40 
41  PBORI_ASSERT(!dd.isZero());
42 
43  size_type nlen = std::distance(dd.lastBegin(), dd.lastEnd());
44 
45  // store indices in list
46  std::vector<idx_type> indices(nlen);
47 
48  // iterator, which uses changeAssign to insert variable
49  // wrt. given indices to a monomial
51  outiter(result);
52 
53  // insert backward (for efficiency reasons)
54  reversed_inter_copy(dd.lastBegin(), dd.lastEnd(), indices, outiter);
55 
56  return result;
57 }
58 
59 
61 
62 #endif
OutputIterator reversed_inter_copy(InputIterator start, InputIterator finish, Intermediate &inter, OutputIterator output)
Function templates doing a reversed copy using intermediate storage.
Definition: pbori_algo.h:156
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
This class marks a given type.
Definition: pbori_func.h:613
#define PBORI_ASSERT(arg)
Definition: pbori_defs.h:118
OutputType dd_last_lexicographical_term(const DDType &dd, type_tag< OutputType >)
Get last term (wrt. lexicographical order).
Definition: pbori_routines_dd.h:33
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
This template class defines an output iterator which interprets assignments of indices as a change of...
Definition: PBoRiOutIter.h:31