PolyBoRi
pbori_routines_dd.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
52 //*****************************************************************************
53 
54 // include basic definitions
55 #include "pbori_defs.h"
56 
57 // get addition definitions
58 #include "CTermIter.h"
59 #include "PBoRiOutIter.h"
60 #include <set>
61 #include <vector>
62 
63 
65 
68 template<class DDType, class OutputType>
69 OutputType
71 
72  typedef typename DDType::idx_type idx_type;
73  typedef typename DDType::size_type size_type;
74  typedef OutputType term_type;
75 
76  term_type result(dd.ring());
77 
78  assert(!dd.emptiness());
79 
80  size_type nlen = std::distance(dd.lastBegin(), dd.lastEnd());
81 
82  // store indices in list
83  std::vector<idx_type> indices(nlen);
84 
85  // iterator, which uses changeAssign to insert variable
86  // wrt. given indices to a monomial
88  outiter(result);
89 
90  // insert backward (for efficiency reasons)
91  reversed_inter_copy(dd.lastBegin(), dd.lastEnd(), indices, outiter);
92 
93  return result;
94 }
95 
96