SheafSystem  0.0.0.0
ragged_array_index_space_interval.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #include "SheafSystem/abstract_product_structure.h"
22 #include "SheafSystem/ragged_array_index_space_interval.h"
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/ragged_array_implicit_index_space_iterator.h"
25 #include "SheafSystem/forwarding_index_space_handle.h"
26 #include "SheafSystem/explicit_index_space_state.h"
27 #include "SheafSystem/hub_index_space_handle.h"
28 #include "SheafSystem/index_space_family.h"
29 
30 // ===========================================================
31 // SPACE FACTORY FACET
32 // ===========================================================
33 
34 // PUBLIC MEMBER FUNCTIONS
35 
39  size_type xub,
40  ragged_array<pod_type>& xhub_ids,
41  bool xowns_hub_ids)
42 {
43  // Preconditions:
44 
45  require(xub > 0);
46  require(xhub_ids.row_ct() >= xub);
47 
48  // Body:
49 
50  define_old_variable(size_type old_id_spaces_end = xid_spaces.end());
51 
53  result_ptr->new_state(xid_spaces, xub);
54 
55  result_ptr->_owns_hub_ids = xowns_hub_ids;
56 
57  if(xowns_hub_ids)
58  {
59  // Use the assignment operator of block to copy the contents of the
60  // user input into the hub ids array.
61 
62  result_ptr->_hub_ids = new ragged_array<pod_type>();
63 
64  *(result_ptr->_hub_ids) = xhub_ids;
65  }
66  else
67  {
68  // The user is responsible for the memory management, copy the point
69  // to the user input.
70 
71  result_ptr->_hub_ids = &xhub_ids;
72  }
73 
74  const ragged_array_index_space_interval& result = *result_ptr;
75 
76  // Postconditions:
77 
78  ensure(&result.id_spaces() == &xid_spaces);
79  ensure(result.begin() == old_id_spaces_end);
80  ensure(result.end() == xid_spaces.end());
81  ensure(result.end() == result.begin() + xub);
82 
83  ensure(result.hub_ids() == xhub_ids);
84  ensure(result.owns_hub_ids() == xowns_hub_ids);
85 
86  // Exit:
87 
88  return result;
89 }
90 
91 // PROTECTED MEMBER FUNCTIONS
92 
93 // PRIVATE MEMBER FUNCTIONS
94 
95 
96 // ===========================================================
97 // RAGGED_ARRAY_INDEX_SPACE_INTERVAL FACET
98 // ===========================================================
99 
100 // PUBLIC MEMBER FUNCTIONS
101 
104 {
105  // Preconditions:
106 
107  // Body:
108 
109  if(_owns_hub_ids)
110  {
111  delete _hub_ids;
112  }
113 
114  // Postconditions:
115 
116  // Exit:
117 
118  return;
119 }
120 
123 hub_ids() const
124 {
125  // Preconditions:
126 
127  // Body:
128 
129  // Postconditions:
130 
131  ensure(is_basic_query);
132 
133  // Exit:
134 
135  return *_hub_ids;
136 }
137 
138 bool
141 {
142  // Preconditions:
143 
144  // Body:
145 
146  // Postconditions:
147 
148  ensure(is_basic_query);
149 
150  // Exit:
151 
152  return _owns_hub_ids;
153 }
154 
155 // PROTECTED MEMBER FUNCTIONS
156 
160 {
161  // Preconditions:
162 
163  // Body:
164 
165  _owns_hub_ids = false;
166  _hub_ids = 0;
167 
168  // Postconditions:
169 
170  ensure(invariant());
171 
172  // Exit:
173 
174  return;
175 }
176 
177 // PRIVATE MEMBER FUNCTIONS
178 
179 
180 // ===========================================================
181 // INDEX_SPACE_INTERVAL FACET
182 // ===========================================================
183 
184 // PUBLIC MEMBER FUNCTIONS
185 
186 // PROTECTED MEMBER FUNCTIONS
187 
188 // PRIVATE MEMBER FUNCTIONS
189 
190 
191 // ===========================================================
192 // FACTORY FACET
193 // ===========================================================
194 
195 // PUBLIC MEMBER FUNCTIONS
196 
197 const std::string&
199 class_name() const
200 {
201  static const std::string result("ragged_array_index_space_interval");
202  return result;
203 }
204 
207 clone() const
208 {
209  // Preconditions:
210 
211  // Body:
212 
215 
216  // Postconditions:
217 
218  ensure(result != 0);
219  ensure(is_same_type(result));
220 
221  // Exit:
222 
223  return result;
224 }
225 
226 // PROTECTED MEMBER FUNCTIONS
227 
228 // PRIVATE MEMBER FUNCTIONS
229 
230 bool
231 sheaf::ragged_array_index_space_interval::
232 make_prototype()
233 {
234  // Preconditions:
235 
236  // Body:
237 
239 
240  id_space_interval_factory().insert_prototype(lproto);
241 
242  // Postconditions:
243 
244  // Exit:
245 
246  return true;
247 }
248 
249 
250 // ===========================================================
251 // INDEX_SPACE_COLLECTION FACET
252 // ===========================================================
253 
254 // PUBLIC MEMBER FUNCTIONS
255 
256 bool
258 operator==(const index_space_collection& xother) const
259 {
260  // Preconditions:
261 
262  require(is_ancestor_of(&xother));
263 
264  // Body:
265 
266  const ragged_array_index_space_interval& lother =
267  dynamic_cast<const ragged_array_index_space_interval&>(xother);
268 
269  bool result = index_space_interval::operator==(xother);
270 
271  result = result && (_owns_hub_ids == _owns_hub_ids);
272  result = result && (_owns_hub_ids ? (*_hub_ids == *lother._hub_ids) : (_hub_ids == lother._hub_ids));
273 
274  // Postconditions:
275 
276  // Exit
277 
278  return result;
279 }
280 
283 deep_size(bool xinclude_shallow) const
284 {
285  // Preconditions:
286 
287  // Body:
288 
289  size_type result = sheaf::deep_size(*this, xinclude_shallow);
290 
291  // Postconditions:
292 
293  ensure(result >= 0);
294 
295  // Exit:
296 
297  return result;
298 }
299 
300 // PROTECTED MEMBER FUNCTIONS
301 
305 {
306  // Preconditions:
307 
308  require(is_ancestor_of(&xother));
309 
310  // Body:
311 
312  const ragged_array_index_space_interval& lother =
313  dynamic_cast<const ragged_array_index_space_interval&>(xother);
314 
315  _owns_hub_ids = lother._owns_hub_ids;
316 
317  if(_owns_hub_ids)
318  {
320  *_hub_ids = *lother._hub_ids;
321  }
322  else
323  {
324  _hub_ids = lother._hub_ids;
325  }
326 
328 
329  // Postconditions:
330 
331  ensure(invariant());
332  ensure((*this) == xother);
333 
334  // Exit:
335 
336  return *this;
337 }
338 
341 explicit_state(pod_type xlocal_id) const
342 {
343  // Preconditions:
344 
345  // Body:
346 
348 
349  explicit_index_space_state* result = 0;
350 
351  // Postconditions:
352 
353  ensure(is_basic_query);
354 
355  // Exit:
356 
357  return result;
358 }
359 
360 // PRIVATE MEMBER FUNCTIONS
361 
362 
363 // ===========================================================
364 // INDEX SPACE FACET
365 // ===========================================================
366 
367 // PUBLIC MEMBER FUNCTIONS
368 
369 void
371 remove(pod_type xlocal_id)
372 {
373  // Preconditions:
374 
375  // Body:
376 
378 
379  not_implemented();
380 
381  // Postconditions:
382 
383  ensure(!contains(xlocal_id));
384 
385  // Exit:
386 
387  return;
388 }
389 
392 ct(pod_type xlocal_id) const
393 {
394  // Preconditions:
395 
396  require(contains(xlocal_id));
397 
398  // Body:
399 
400  size_type result = _hub_ids->col_ct(xlocal_id);
401 
402  // Postconditions:
403 
404  ensure(is_basic_query);
405 
406  // Exit:
407 
408  return result;
409 }
410 
413 begin(pod_type xlocal_id) const
414 {
415  // Preconditions:
416 
417  require(contains(xlocal_id));
418 
419  // Body:
420 
421  pod_type result = 0;
422 
423  // Postconditions:
424 
425  ensure(is_basic_query);
426 
427  // Exit:
428 
429  return result;
430 }
431 
434 end(pod_type xlocal_id) const
435 {
436  // Preconditions:
437 
438  require(contains(xlocal_id));
439 
440  // Body:
441 
442  pod_type result = _hub_ids->col_ct(xlocal_id);
443 
444  // Postconditions:
445 
446  ensure(is_basic_query);
447 
448  // Exit:
449 
450  return result;
451 }
452 
453 bool
455 contains(pod_type xlocal_id, pod_type xid) const
456 {
457  // Preconditions:
458 
459  require(contains(xlocal_id));
460 
461  // Body:
462 
463  bool result = (0 <= xid) && (xid < _hub_ids->col_ct(xlocal_id));
464 
465  // Postconditions:
466 
467  ensure(is_basic_query);
468 
469  // Exit:
470 
471  return result;
472 }
473 
474 bool
477 {
478  // Preconditions:
479 
480  require(contains(xlocal_id));
481 
482  // Body:
483 
484  bool result = false;
485 
493 
494  pod_type lct = _hub_ids->col_ct(xlocal_id);
495  pod_type* lids = _hub_ids->row(xlocal_id);
496 
497  for(pod_type i = 0; i < lct; ++i)
498  {
499  if(lids[i] == xid)
500  {
501  result = true;
502  break;
503  }
504  }
505 
506  // Postconditions:
507 
508  ensure(is_basic_query);
509 
510  // Exit:
511 
512  return result;
513 }
514 
515 bool
517 contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
518 {
519  // Preconditions:
520 
521  require(contains(xlocal_id));
522 
523  // Body:
524 
525  bool result =
526  (0 <= xid) && (xid < _hub_ids->col_ct(xlocal_id)) &&
527  ((*_hub_ids)[xlocal_id][xid] == xhub_id);
528 
529  // Postconditions:
530 
531  ensure(is_basic_query);
532 
533  // Exit:
534 
535  return result;
536 }
537 
540 pod(pod_type xlocal_id, pod_type xid) const
541 {
542  // Preconditions:
543 
544  require(contains(xlocal_id));
545 
546  // Body:
547 
548  pod_type result = invalid_pod_index();
549 
557 
558  pod_type lct = _hub_ids->col_ct(xlocal_id);
559  pod_type* lids = _hub_ids->row(xlocal_id);
560 
561  for(pod_type i = 0; i < lct; ++i)
562  {
563  if(lids[i] == xid)
564  {
565  result = i;
566  break;
567  }
568  }
569 
570  // Postconditions:
571 
572  ensure(!is_valid(result) || contains(xlocal_id, result));
573 
574  // Exit:
575 
576  return result;
577 }
578 
581 unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
582 {
583  // Preconditions:
584 
585  require(contains(xlocal_id));
586 
587  // Body:
588 
589  pod_type result =
590  ((0 <= xid) && (xid < _hub_ids->col_ct(xlocal_id))) ?
591  (*_hub_ids)[xlocal_id][xid] :
593 
594  // Postconditions:
595 
596  ensure(!is_valid(result) || contains_unglued_hub(xlocal_id, result));
597 
598  // Exit:
599 
600  return result;
601 }
602 
603 bool
605 is_persistent(pod_type xlocal_id) const
606 {
607  // Preconditions:
608 
609  require(contains(xlocal_id));
610 
611  // Body:
612 
613  bool result = false;
614 
615  // Postconditions:
616 
617  ensure(is_basic_query);
618 
619  // Exit:
620 
621  return result;
622 }
623 
624 // PROTECTED MEMBER FUNCTIONS
625 
626 // PRIVATE MEMBER FUNCTIONS
627 
628 
629 // ===========================================================
630 // PRODUCT STRUCTURE FACET
631 // ===========================================================
632 
633 // PUBLIC MEMBER FUNCTIONS
634 
635 void
638  const abstract_product_structure& xproduct)
639 {
640  // Preconditions:
641 
642  require(contains(xlocal_id));
643 
644  // Body:
645 
647 
648  not_implemented();
649 
650  // Postconditions:
651 
652  ensure(has_product_structure(xlocal_id));
653 
654  // Exit:
655 
656  return;
657 }
658 
659 void
662 {
663  // Preconditions:
664 
665  require(contains(xlocal_id));
666 
667  // Body:
668 
670 
671  not_implemented();
672 
673  // Postconditions:
674 
675  ensure(!has_product_structure(xlocal_id));
676 
677  // Exit:
678 
679  return;
680 }
681 
684 product_structure(pod_type xlocal_id) const
685 {
686  // Preconditions:
687 
688  require(contains(xlocal_id));
689  require(has_product_structure(xlocal_id));
690 
691  // Body:
692 
694 
695  const abstract_product_structure* result = 0; // Just to silence compiler warnings.
696 
697  not_implemented();
698 
699  // Postconditions:
700 
701  ensure(is_basic_query);
702 
703  // Exit:
704 
705  return *result;
706 }
707 
711 {
712  // Preconditions:
713 
714  require(contains(xlocal_id));
715  require(has_product_structure(xlocal_id));
716 
717  // Body:
718 
720 
721  abstract_product_structure* result = 0; // Just to silence compiler warnings.
722 
723  not_implemented();
724 
725  // Postconditions:
726 
727  ensure(is_basic_query);
728 
729  // Exit:
730 
731  return *result;
732 }
733 
734 bool
737 {
738  // Preconditions:
739 
740  require(contains(xlocal_id));
741 
742  // Body:
743 
745 
746  bool result = false; // Just to silence compiler warnings.
747 
748  not_implemented();
749 
750  // Postconditions:
751 
752  ensure(is_basic_query);
753 
754  // Exit:
755 
756  return result;
757 }
758 
759 // PROTECTED MEMBER FUNCTIONS
760 
761 // PRIVATE MEMBER FUNCTIONS
762 
763 
764 // ===========================================================
765 // HANDLE POOL FACET
766 // ===========================================================
767 
768 // PUBLIC MEMBER FUNCTIONS
769 
772 get_id_space(pod_type xlocal_id) const
773 {
774  // Preconditions:
775 
776  require(contains(xlocal_id));
777 
778  // Body:
779 
780  index_space_handle& result = _handles.get();
781  result.attach_to(*this, xlocal_id);
782 
783  // Postconditions:
784 
785  ensure(result.is_attached());
786 
787  // Exit:
788 
789  return result;
790 }
791 
792 void
795 {
796  // Preconditions:
797 
798  require(allocated_id_space(xid_space));
799 
800  // Body:
801 
802  // Detach the handle.
803 
804  xid_space.detach();
805 
806  // Release the handle to the pool.
807 
808  _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
809 
810  // Postconditions:
811 
812  ensure(is_basic_query);
813 
814  // Exit:
815 
816  return;
817 }
818 
819 bool
821 allocated_id_space(const index_space_handle& xid_space) const
822 {
823  // Preconditions:
824 
825  // Body:
826 
827  const forwarding_index_space_handle* lid_space =
828  dynamic_cast<const forwarding_index_space_handle*>(&xid_space);
829 
830  bool result = (lid_space != 0) && _handles.allocated(*lid_space);
831 
832  // Postconditions:
833 
834  ensure(is_basic_query);
835 
836  // Exit:
837 
838  return result;
839 }
840 
841 // PROTECTED MEMBER FUNCTIONS
842 
843 // PRIVATE MEMBER FUNCTIONS
844 
845 
846 // ===========================================================
847 // ITERATOR POOL FACET
848 // ===========================================================
849 
850 // PUBLIC MEMBER FUNCTIONS
851 
855 {
856  // Preconditions:
857 
858  require(contains(xlocal_id));
859 
860  // Body:
861 
862  index_space_iterator& result = _iterators.get();
863  result.attach_to(*this, xlocal_id);
864 
865  // Postconditions:
866 
867  ensure(result.is_attached());
868 
869  // Exit:
870 
871  return result;
872 }
873 
874 void
877 {
878  // Preconditions:
879 
880  require(allocated_id_space_iterator(xitr));
881 
882  // Body:
883 
884  // Detach the iterator.
885 
886  xitr.detach();
887 
888  // Release the iterator to the pool.
889 
890  _iterators.release(reinterpret_cast<ragged_array_implicit_index_space_iterator&>(xitr));
891 
892  // Postconditions:
893 
894  ensure(is_basic_query);
895 
896  // Exit:
897 
898  return;
899 }
900 
901 bool
904 {
905  // Preconditions:
906 
907  // Body:
908 
910  dynamic_cast<const ragged_array_implicit_index_space_iterator*>(&xitr);
911 
912  bool result = (litr != 0) && _iterators.allocated(*litr);
913 
914  // Postconditions:
915 
916  ensure(is_basic_query);
917 
918  // Exit:
919 
920  return result;
921 }
922 
923 // PROTECTED MEMBER FUNCTIONS
924 
925 // PRIVATE MEMBER FUNCTIONS
926 
927 
928 // ===========================================================
929 // ANY FACET
930 // ===========================================================
931 
932 // PUBLIC MEMBER FUNCTIONS
933 
934 bool
936 is_ancestor_of(const any *other) const
937 {
938  // Preconditions:
939 
940  require(other != 0);
941 
942  // Body:
943 
944  // True if other conforms to this
945 
946  bool result = dynamic_cast<const ragged_array_index_space_interval*>(other) != 0;
947 
948  // Postconditions:
949 
950  // Exit:
951 
952  return result;
953 }
954 
955 bool
957 invariant() const
958 {
959  bool result = true;
960 
961  if(invariant_check())
962  {
963  // Prevent recursive calls to invariant
964 
966 
967  // Must satisfy base class invariant
968 
969  invariance(index_space_interval::invariant());
970 
971  // Invariances for this class:
972 
973  // Finished, turn invariant checking back on.
974 
976  }
977 
978  // Exit
979 
980  return result;
981 }
982 
983 // PROTECTED MEMBER FUNCTIONS
984 
985 // PRIVATE MEMBER FUNCTIONS
986 
987 
988 // ===========================================================
989 // NON-MEMBER FUNCTIONS
990 // ===========================================================
991 
992 size_t
993 sheaf::
994 deep_size(const ragged_array_index_space_interval& xn, bool xinclude_shallow)
995 {
996  // Preconditions:
997 
998  // Body:
999 
1000  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1001 
1002  // Add contributions from _hub_ids.
1003 
1004  // Add contributions from _hub_ids.
1005 
1010 
1011 // if(xn.owns_hub_ids())
1012 // {
1013 // result += deep_size(xn.hub_ids(), false);
1014 // }
1015 
1016  result += deep_size(xn.hub_ids(), false);
1017 
1018  // Add contributions for _handles.
1019 
1020  result += deep_size(xn._handles, false);
1021 
1022  // Add contributions for _iterators.
1023 
1024  result += deep_size(xn._iterators, false);
1025 
1026  // Postconditions:
1027 
1028  ensure(result >= 0);
1029 
1030  // Exit
1031 
1032  return result;
1033 }
virtual const std::string & class_name() const
The name of this class.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id...
pod_type end() const
The ending index of the id spaces.
An abstract class that defines the product structure for an id space.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract iterator over the ids of an id space.
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
ragged_array< pod_type > * _hub_ids
The ragged array of hub ids.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
T * row(const index_type xrow_index) const
The row with index xrow_index.
virtual void detach()=0
Detach this handle form its state, if any.
bool owns_hub_ids() const
True if this interval owns the ragged array of hub ids. If owns_hub_ids(), this interval is responsib...
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
pod_index_type pod_type
The "plain old data" index type for this.
virtual ragged_array_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual void detach()=0
Detach this handle form its state, if any.
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
virtual index_space_handle & get_id_space(pod_type xlocal_id) const
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
virtual explicit_index_space_state * explicit_state(pod_type xlocal_id) const
The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xloca...
virtual ragged_array_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
Abstract base class with useful features for all objects.
Definition: any.h:39
bool _owns_hub_ids
True if this interval is responsible for the memory management of _hub_ids.
An implemenation of index_space_collection that adds an interface for the interval [begin()...
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
virtual const abstract_product_structure & product_structure(pod_type xlocal_id) const
The product structure for the id space with id xlocal_id (const version).
const ragged_array< pod_type > & hub_ids() const
The ragged array of hub ids.
virtual pod_type end(pod_type xlocal_id) const
Ending id of the space with id xlocal_id.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
static const ragged_array_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, ragged_array< pod_type > &xhub_ids, bool xowns_hub_ids)
Create a new interval of id spaces with an ragged array representation in the id space family xid_spa...
list_pool< ragged_array_implicit_index_space_iterator > _iterators
The iterator pool.
An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids ...
list_pool< forwarding_index_space_handle > _handles
The handle pool.
An implementation of class index_space_handle for an forwarding_index_space_state.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
index_type row_ct() const
The number of rows.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
virtual bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of the space with id xlocal_id.
virtual void remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
Factory and container for a family of id spaces.
friend SHEAF_DLL_SPEC size_t deep_size(const ragged_array_index_space_interval &xn, bool xinclude_shallow)
The deep size of ragged_array_index_space_interval& xn.
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Definition: pod_types.cc:37
An implementation of implicit_index_space_iterator for an implicit id space in an ragged_array_index_...
pod_type begin() const
Beginning space id of this interval in the id space family scope.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
bool is_same_type(const any *other) const
True if other is the same type as this.
Definition: any.cc:79
virtual void new_product_structure(pod_type xlocal_id, const abstract_product_structure &xproduct)
Creates a new product structure for the id space with id xlocal_id by cloning the product structure...
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
index_type col_ct(const index_type xrow_index) const
The number of columns for the xrow_index-th row.