38 template<
unsigned int Dim>
46 template<
unsigned int Dim>
57 template<
unsigned int Dim>
59 : Layout(si.Layout),
Offset(si.
Offset), IndexList(si.IndexList),
60 BoundingBox(si.BoundingBox)
74 template<
unsigned int Dim>
76 : Layout(si.Layout),
Offset(si.
Offset), IndexList(si.IndexList),
77 BoundingBox(si.BoundingBox)
94 template<
unsigned int Dim>
96 : Layout(si.Layout),
Offset(si.
Offset), IndexList(si.IndexList),
97 BoundingBox(si.BoundingBox)
112 template<
unsigned int Dim>
116 Layout->checkout(*
this);
123 template<
unsigned int Dim>
136 template<
unsigned int Dim>
141 Layout->checkin(*
this);
144 IndexList.reserve(Layout->size_iv());
148 for ( ; locvn != Layout->
end_iv(); ++locvn)
149 IndexList.push_back(std::make_shared<
LSIndex<Dim>>((*locvn).second.get()));
152 BoundingBox = Layout->getDomain();
159 template<
unsigned int Dim>
166 for (
iterator_iv curr = begin_iv(); curr != end_iv(); ++curr) {
167 if (addIndex(curr, so)) {
181 template<
unsigned int Dim>
188 if ((*curr)->contains(so) && ! (*curr)->hasIndex(so)) {
189 (*curr)->addIndex(so);
202 template<
unsigned int Dim>
211 unsigned int d, totalnum = ndi.
size();
213 for (d=0; d <
Dim; ++d)
214 counter[d] = ndi[d].
begin();
216 while (totalnum-- > 0) {
219 for (d=0; d <
Dim; ++d)
220 newpoint[d] = *(counter[d]);
224 unsigned int chkdim = 0;
225 while(chkdim <
Dim) {
227 if (counter[chkdim] == ndi[chkdim].
end()) {
228 counter[chkdim] = ndi[chkdim].begin();
241 template<
unsigned int Dim>
248 for (
iterator_iv curr = begin_iv(); curr != end_iv(); ++curr)
249 if (removeIndex(curr, so))
261 template<
unsigned int Dim>
266 if ((*curr)->hasIndex(so)) {
267 (*curr)->removeIndex(so);
278 template<
unsigned int Dim>
287 unsigned int d, totalnum = ndi.
size();
289 for (d=0; d <
Dim; ++d)
290 counter[d] = ndi[d].
begin();
292 while (totalnum-- > 0) {
295 for (d=0; d <
Dim; ++d)
296 newpoint[d] = *(counter[d]);
297 removeIndex(newpoint);
300 unsigned int chkdim = 0;
301 while(chkdim <
Dim) {
303 if (counter[chkdim] == ndi[chkdim].
end()) {
304 counter[chkdim] = ndi[chkdim].begin();
317 template<
unsigned int Dim>
321 if (fraction < 0.9999 && fraction > 0.0)
323 static_cast<double>(newcapacity));
324 (*a)->reserve(newcapacity);
331 template<
unsigned int Dim>
344 template<
unsigned int Dim>
350 if ((*a)->hasIndex(so))
359 template<
unsigned int Dim>
367 if (Layout == 0 || Layout != si.
Layout) {
369 Layout->checkout(*
this);
371 Layout->checkin(*
this);
388 template<
unsigned int Dim>
398 toNDIndex(so, BoundingBox);
407 template<
unsigned int Dim>
426 template<
unsigned int Dim>
437 for ( ;
a != ea; ++
a, ++na) {
440 for ( ; ls_i != ls_e ; ++ls_i) {
451 BoundingBox = BoundingBox.intersect(si.
BoundingBox);
460 template<
unsigned int Dim>
465 bool found = hasIndex(so);
469 toNDIndex(so, BoundingBox);
477 template<
unsigned int Dim>
487 for ( ;
a != ea; ++
a, ++na) {
490 for ( ; ls_i != ls_e ; ++ls_i) {
491 if ((*ls_i).inside(ndi))
498 BoundingBox = BoundingBox.intersect(ndi);
510 template<
unsigned int Dim>
519 for ( ;
a != ea; ++
a, ++na) {
522 for ( ; ls_i != ls_e ; ++ls_i)
527 BoundingBox = Layout->getDomain();
537 template<
unsigned int Dim>
545 BoundingBox = Layout->getDomain();
554 template<
unsigned int Dim>
562 BoundingBox = Layout->getDomain();
572 template<
unsigned int Dim>
581 template<
unsigned int Dim>
589 template<
unsigned int Dim>
598 template<
unsigned int Dim>
607 template<
unsigned int Dim>
616 template<
unsigned int Dim>
626 template<
unsigned int Dim>
634 template<
unsigned int Dim>
648 template<
unsigned int Dim>
663 template<
unsigned int Dim>
668 for (
unsigned int d=0; d <
Dim; ++d) {
669 int m = val[d] +
Offset[d];
670 NDI[d] =
Index(m, m);
677 template<
unsigned int Dim>
684 retval += (*a)->size();
694 template<
unsigned int Dim>
712 template<
unsigned int Dim>
717 if (Layout != 0 && userlist->
getUserListID() == Layout->get_Id()) {
721 setFieldLayout(*Layout);
728 template<
unsigned int Dim>
733 if (Layout != 0 && userlist->
getUserListID() == Layout->get_Id())
740 template<
unsigned int Dim>
745 o <<
"vnodes = " << si.
size_iv();
747 o <<
", bounding box = " << si.
getDomain();
748 o <<
", points in each LField (w/offset):" <<
std::endl;
750 o <<
" In LField w/domain=" << (*a)->getDomain() <<
":" <<
std::endl;
751 o <<
" compressed = " << (*a)->IsCompressed() <<
std::endl;
752 unsigned int lsize = (*a)->size();
753 for (
unsigned int i=0; i < lsize; ++i)
763 template<
unsigned int Dim>
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
std::ostream & operator<<(std::ostream &o, const SIndex< Dim > &si)
Inform & endl(Inform &inf)
ac_id_vnodes::iterator iterator_iv
container_t::const_iterator const_iterator
container_t::size_type size_type
container_t::iterator iterator_iv
size_type_iv size_iv() const
bool addIndex(const SOffset< Dim > &)
void initialize(FieldLayout< Dim > &)
SIndex< Dim > & operator=(const PETE_Expr< T1 > &rhs)
container_t::size_type size_type_iv
FieldLayout< Dim > * Layout
size_type_iv size() const
bool removeIndex(const SOffset< Dim > &)
void printDebug(Inform &) const
SOffset< Dim > & getOffset()
const NDIndex< Dim > & getDomain() const
bool hasIndex(const SOffset< Dim > &) const
virtual void notifyUserOfDelete(UserList *)
container_t::const_iterator const_iterator_iv
IndexedSIndex< Dim, 1 > operator[](const Index &)
virtual void Repartition(UserList *)
SIndex< Dim > operator()(int)
SIndex< Dim > & operator&=(const SIndex< Dim > &)
NDIndex< Dim > BoundingBox
void setFieldLayout(FieldLayout< Dim > &)
void toNDIndex(const SOffset< Dim > &, NDIndex< Dim > &)
SIndex< Dim > & operator|=(const SIndex< Dim > &)
ID_t getUserListID() const