SheafSystem  0.0.0.0
sec_vd_space.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/sec_vd_space.h"
22 
23 #include "SheafSystem/abstract_poset_member.impl.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/binary_section_space_schema_member.impl.h"
26 #include "SheafSystem/binary_section_space_schema_poset.h"
27 #include "SheafSystem/fiber_bundles_namespace.h"
28 #include "SheafSystem/namespace_poset.impl.h"
29 #include "SheafSystem/namespace_poset_member.h"
30 #include "SheafSystem/poset_handle_factory.h"
31 #include "SheafSystem/sec_at0.h"
32 #include "SheafSystem/sec_at0_space.h"
33 #include "SheafSystem/sec_at1.h"
34 #include "SheafSystem/sec_at1_space.h"
35 #include "SheafSystem/sec_tuple_space.impl.h"
36 #include "SheafSystem/sec_vd.h"
37 #include "SheafSystem/section_space_schema_member.impl.h"
38 #include "SheafSystem/section_space_schema_poset.h"
39 #include "SheafSystem/vd.h"
40 #include "SheafSystem/vd_space.h"
41 
42 using namespace std;
43 using namespace fiber_bundle; // Workaround for MS C++ bug.
44 
45 //#define DIAGNOSTIC_OUTPUT
46 
47 //==============================================================================
48 // SEC_VD_SPACE FACET
49 //==============================================================================
50 
51 // PUBLIC MEMBER FUNCTIONS
52 
53 bool
56  const poset_path& xschema_path,
57  const poset_path& xscalar_space_path,
58  bool xauto_access)
59 {
60  // cout << endl << "Entering sec_vd_space::same_scalar_fiber_space." << endl;
61 
62  // Preconditions:
63 
64  require(xns.state_is_auto_read_accessible(xauto_access));
65  require(xns.path_is_auto_read_accessible<section_space_schema_poset>(xschema_path, xauto_access));
66  require(xns.path_is_auto_read_accessible<scalar_type::host_type>(xscalar_space_path, xauto_access));
67 
68  // Body:
69 
70  section_space_schema_poset& lschema_host = xns.member_poset<section_space_schema_poset>(xschema_path, xauto_access);
71  scalar_type::host_type& lscalar_host = xns.member_poset<scalar_type::host_type>(xscalar_space_path, xauto_access);
72 
73  fiber_type::host_type* lfiber_space = dynamic_cast<fiber_type::host_type*>(&lschema_host.fiber_space());
74  bool result = false;
75  if(lfiber_space != 0)
76  {
77  result = lfiber_space->scalar_space_path(xauto_access) == lscalar_host.schema().fiber_space().path(xauto_access);
78  }
79 
80  // Postconditions:
81 
82 
83  // Exit:
84 
85  // cout << "Leaving sec_vd_space::same_scalar_fiber_space." << endl;
86  return result;
87 }
88 
89 
90 
93 new_table(namespace_type& xns, const poset_path& xpath,
94  const poset_path& xschema_path,
95  const poset_path& xscalar_space_path,
96  bool xauto_access)
97 {
98  // cout << endl << "Entering sec_vd_space::new_table." << endl;
99 
100  // Preconditions:
101 
102  require(xns.state_is_auto_read_write_accessible(xauto_access));
103 
104  require(!xpath.empty());
105  require(!xns.contains_path(xpath, xauto_access));
106 
107  require(xschema_path.full());
108  require(xns.path_is_auto_read_accessible<schema_type::host_type>(xschema_path, xauto_access));
109  require(fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
110 
111  require(xns.path_is_auto_read_accessible<scalar_type::host_type>(xscalar_space_path, xauto_access));
112 
113  require(same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
114 
115  // Body:
116 
117  // Create the table; have to new it because namespace keeps a pointer.
118 
119  typedef sec_vd_space table_type;
120 
121  table_type& result = *(new table_type());
122 
123  // Create a handle of the right type for the schema member.
124 
125  schema_type lschema(xns, xschema_path, xauto_access);
126 
127  if(xauto_access)
128  {
129  lschema.get_read_access();
130  }
131 
132  // Create the table dof map.
133 
134  array_poset_dof_map& lmap = *(new array_poset_dof_map(&lschema, true));
135 
136  // The table dofs are mostly the same as the fiber schema,
137  // so just copy them from the fiber schema.
138  // Can't use copy constructor because schema objects are different.
139 
140  array_poset_dof_map& lfiber_map = lschema.fiber_space().table_dof_map();
141  lmap.copy_dof_tuple(lfiber_map);
142 
143  // Replace the fiber scalar space path with the section scalar space path.
144 
145  lmap.put_dof("scalar_space_path", xscalar_space_path);
146 
147  // Create the state.
148 
149  result.new_state(xns, xpath, lschema, lmap);
150 
151  if(xauto_access)
152  {
153  lschema.release_access();
154  }
155 
156  // Postconditions:
157 
158  ensure(xns.owns(result, xauto_access));
159  ensure(result.path(true) == xpath);
160  ensure(result.state_is_not_read_accessible());
161  ensure(result.schema(true).path(xauto_access) == xschema_path);
162 
163  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
164  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
165  ensure(result.scalar_space_path(true) == xscalar_space_path);
166 
167  // Exit:
168 
169  // cout << "Leaving sec_vd_space::new_table." << endl;
170  return result;
171 }
172 
173 //==============================================================================
174 // TABLE DOFS
175 //==============================================================================
176 
177 int
179 factor_ct(int xd)
180 {
181  return xd;
182 }
183 
184 int
186 d() const
187 {
188  // Preconditions:
189 
190  require(state_is_read_accessible());
191 
192  // Body:
193 
194  int result = sheaf::table_dofs(*this).d;
195 
196  // Postconditions:
197 
198  // Exit:
199 
200  return result;
201 }
202 
203 int
205 d(bool xauto_access) const
206 {
207  // Preconditions:
208 
209  require(state_is_auto_read_accessible(xauto_access));
210 
211  // Body:
212 
213  if(xauto_access)
214  {
215  get_read_access();
216  }
217 
218  int result = d();
219 
220  if(xauto_access)
221  {
222  release_access();
223  }
224 
225  // Postconditions:
226 
227  // Exit:
228 
229  return result;
230 }
231 
232 int
234 d(const namespace_poset& xns, const poset_path& xvector_space_path, bool xauto_access)
235 {
236  // Preconditions:
237 
238  require(xns.state_is_auto_read_accessible(xauto_access));
239  require(!xvector_space_path.empty());
240  require(xns.contains_poset(xvector_space_path, xauto_access));
241  require(xns.member_poset(xvector_space_path, xauto_access).state_is_auto_read_accessible(xauto_access));
242 
243  // Body:
244 
245  sec_vd_space& lvector_space = reinterpret_cast<sec_vd_space&>(xns.member_poset(xvector_space_path, xauto_access));
246  int result = lvector_space.d(xauto_access);
247 
248  // Postconditions:
249 
250  ensure(result >= 0);
251 
252  // Exit:
253 
254  return result;
255 }
256 
260 {
261  // Preconditions:
262 
263  require(state_is_read_accessible());
264 
265  // Body:
266 
267  poset_path result(sheaf::table_dofs(*this).scalar_space_path);
268 
269  // Postconditions:
270 
271  ensure(!result.empty());
272 
273  // Exit:
274 
275  return result;
276 }
277 
280 scalar_space_path(bool xauto_access) const
281 {
282  // Preconditions:
283 
284  require(state_is_auto_read_accessible(xauto_access));
285 
286  // Body:
287 
288  if(xauto_access)
289  {
290  get_read_access();
291  }
292 
293  poset_path result(sheaf::table_dofs(*this).scalar_space_path);
294 
295  if(xauto_access)
296  {
297  release_access();
298  }
299 
300  // Postconditions:
301 
302  ensure(!result.empty());
303 
304  // Exit:
305 
306  return result;
307 }
308 
309 
312 scalar_space_path(const namespace_poset& xns, const poset_path& xvector_space_path, bool xauto_access)
313 {
314  // Preconditions:
315 
316  require(xns.state_is_auto_read_accessible(xauto_access));
317  require(!xvector_space_path.empty());
318  require(xns.contains_poset(xvector_space_path, xauto_access));
319  require(xns.member_poset(xvector_space_path, xauto_access).state_is_auto_read_accessible(xauto_access));
320 
321  // Body:
322 
323  sec_vd_space& lvector_space = reinterpret_cast<sec_vd_space&>(xns.member_poset(xvector_space_path, xauto_access));
324  poset_path result = lvector_space.scalar_space_path(xauto_access);
325 
326  // Postconditions:
327 
328  ensure(!result.empty());
329 
330  // Exit:
331 
332  return result;
333 }
334 
335 bool
337 contains_variance_subposets(bool xauto_access) const
338 {
339  // Preconditions:
340 
341  require(state_is_auto_read_accessible(xauto_access));
342 
343  // Body:
344 
345  if(xauto_access)
346  {
347  get_read_access();
348  }
349 
350  int lp = covariant_subposet_ct();
351 
352  bool result = true;
353  for(int i=0; i<lp && result; ++i)
354  {
355  result = includes_subposet(covariant_subposet_name(i), false);
356  }
357 
358  if(xauto_access)
359  {
360  release_access();
361  }
362 
363  // Postconditions:
364 
365  // Exit:
366 
367  return result;
368 }
369 
370 bool
372 is_vector(pod_index_type xmbr_id, bool xauto_access) const
373 {
374  // Preconditions:
375 
376  require(state_is_auto_read_accessible(xauto_access));
377 
378  // Body:
379 
380  if(xauto_access)
381  {
382  get_read_access();
383  }
384 
413 
417 
418  subposet lsp(this, covariant_subposet_name(0));
419  bool result = !lsp.contains_member(xmbr_id);
420  lsp.detach_from_state();
421 
422  if(xauto_access)
423  {
424  release_access();
425  }
426 
427  // Postconditions:
428 
429 
430  // Exit:
431 
432  return result;
433 }
434 
435 bool
437 is_vector(const scoped_index& xmbr_id, bool xauto_access) const
438 {
439  // Preconditions:
440 
441  require(state_is_auto_read_accessible(xauto_access));
442 
443  // Body:
444 
445  return is_vector(xmbr_id.hub_pod(), xauto_access);
446 }
447 
448 void
450 put_is_vector(pod_index_type xmbr_id, bool xauto_access)
451 {
452  // Preconditions:
453 
454  require(state_is_auto_read_write_accessible(xauto_access));
455 
456  // Body:
457 
458  if(xauto_access)
459  {
460  get_read_write_access();
461  }
462 
463  subposet lsp(this, covariant_subposet_name(0));
464  lsp.remove_member(xmbr_id);
465  lsp.detach_from_state();
466 
467  if(xauto_access)
468  {
469  release_access();
470  }
471 
472  // Postconditions:
473 
474  ensure(is_vector(xmbr_id, xauto_access));
475 
476  // Exit:
477 
478  return;
479 }
480 
481 void
483 put_is_vector(const scoped_index& xmbr_id, bool xauto_access)
484 {
485  // Preconditions:
486 
487  require(state_is_auto_read_write_accessible(xauto_access));
488 
489  // Body:
490 
491  put_is_vector(xmbr_id.hub_pod(), xauto_access);
492 
493  // Postconditions:
494 
495  ensure(is_vector(xmbr_id, xauto_access));
496 
497  // Exit:
498 
499  return;
500 }
501 
502 bool
504 is_covector(pod_index_type xmbr_id, bool xauto_access) const
505 {
506  // Preconditions:
507 
508  require(state_is_auto_read_accessible(xauto_access));
509 
510  // Body:
511 
512  if(xauto_access)
513  {
514  get_read_access();
515  }
516 
545 
549 
550  subposet lsp(this, covariant_subposet_name(0));
551  bool result = lsp.contains_member(xmbr_id);
552  lsp.detach_from_state();
553 
554  if(xauto_access)
555  {
556  release_access();
557  }
558 
559  // Postconditions:
560 
561 
562  // Exit:
563 
564  return result;
565 }
566 
567 bool
569 is_covector(const scoped_index& xmbr_id, bool xauto_access) const
570 {
571  // Preconditions:
572 
573  require(state_is_auto_read_accessible(xauto_access));
574 
575  // Body:
576 
577  return is_covector(xmbr_id.hub_pod(), xauto_access);
578 }
579 
580 void
582 put_is_covector(pod_index_type xmbr_id, bool xauto_access)
583 {
584  // Preconditions:
585 
586  require(state_is_auto_read_write_accessible(xauto_access));
587 
588  // Body:
589 
590  if(xauto_access)
591  {
592  get_read_write_access();
593  }
594 
595  subposet lsp(this, covariant_subposet_name(0));
596  lsp.insert_member(xmbr_id);
597  lsp.detach_from_state();
598 
599  if(xauto_access)
600  {
601  release_access();
602  }
603 
604  // Postconditions:
605 
606  ensure(is_covector(xmbr_id, xauto_access));
607 
608  // Exit:
609 
610  return;
611 }
612 
613 void
615 put_is_covector(const scoped_index& xmbr_id, bool xauto_access)
616 {
617  // Preconditions:
618 
619  require(state_is_auto_read_write_accessible(xauto_access));
620 
621  // Body:
622 
623  put_is_covector(xmbr_id.hub_pod(), xauto_access);
624 
625  // Postconditions:
626 
627  ensure(is_covector(xmbr_id, xauto_access));
628 
629  // Exit:
630 
631  return;
632 }
633 
634 // PROTECTED MEMBER FUNCTIONS
635 
636 std::string
639 {
640  // Preconditions:
641 
642  // Body:
643 
644  string result(poset_path::make_reserved_name("covariant", xi, ""));
645 
646  // Postconditions:
647 
648  ensure(!result.empty());
649 
650  // Exit:
651 
652  return result;
653 }
654 
657  : sec_tuple_space(new sec_vd, new sec_vd)
658 {
659  // Preconditions:
660 
661  // Body:
662 
663  // Nothing to do, handled by base class
664 
665  // Postconditions:
666 
667  ensure(postcondition_of(sec_tuple_space::sec_tuple_space()));
668 }
669 
672 {
673  // Preconditions:
674 
675  // Body:
676 
677  // Postconditions:
678 
679  // Exit
680 
681  return;
682 }
683 
685 sec_vd_space(sec_vd* xtop, sec_vd* xbottom)
686  : sec_tuple_space(xtop, xbottom)
687 {
688  // Preconditions:
689 
690  require(xtop != 0);
691  require(xbottom != 0);
692 
693  // Body:
694 
695  // Nothing to do.
696 
697  // Postconditions:
698 
699  ensure(postcondition_of(poset_state_handle::poset_state_handle(xtop, xbottom)));
700 
701  // Exit:
702 
703  return;
704 }
705 
706 void
709 {
710  // Preconditions:
711 
713 
714  // Body:
715 
716  int lp = covariant_subposet_ct();
717 
718  for(int i=0; i<lp; ++i)
719  {
720  string lname(covariant_subposet_name(i));
721  if(!includes_subposet(lname, false))
722  {
723  subposet lcovariant(this);
724  lcovariant.put_name(lname, true, false);
725  lcovariant.detach_from_state();
726  }
727  }
728 
729  // Postconditions:
730 
731  ensure(contains_variance_subposets(false));
732 
733  // Exit:
734 
735  return;
736 }
737 
741 {
742  // Preconditions:
743 
744  require(state_is_read_accessible());
745 
746  // Body:
747 
748  size_type result = 1;
749 
750  // Postconditions:
751 
752  // Exit:
753 
754  return result;
755 }
756 
757 // PRIVATE MEMBER FUNCTIONS
758 
759 
760 // ===========================================================
761 // SEC_TUPLE_SPACE FACET
762 // ===========================================================
763 
764 // PUBLIC MEMBER FUNCTIONS
765 
766 // PROTECTED MEMBER FUNCTIONS
767 
768 // PRIVATE MEMBER FUNCTIONS
769 
770 
771 // ===========================================================
772 // SEC_REP_SPACE FACET
773 // ===========================================================
774 
775 // PUBLIC MEMBER FUNCTIONS
776 
777 // PROTECTED MEMBER FUNCTIONS
778 
779 // PRIVATE MEMBER FUNCTIONS
780 
781 bool
782 fiber_bundle::sec_vd_space::
783 make_prototype()
784 {
785  bool result = false;
786 
787  // Preconditions:
788 
789  // Body:
790 
791  sec_vd_space* lproto = new sec_vd_space;
792  poset_type ltype = lproto->type_id();
793 
794  factory().insert_prototype(lproto);
795  factory().insert_prototype(ltype, lproto);
796 
797  // Postconditions:
798 
799  // Exit:
800 
801  return result;
802 }
803 
804 
805 //==============================================================================
806 // POSET_STATE_HANDLE FACET
807 //==============================================================================
808 
809 // PUBLIC MEMBER FUNCTIONS
810 
813 type_id() const
814 {
815  return SEC_VD_SPACE_ID;
816 }
817 
820 
821 const char*
823 class_name() const
824 {
825  // Preconditions:
826 
827  // Body:
828 
829  static const char* result = "sec_vd_space";
830 
831  // Postconditions:
832 
833  // Exit:
834 
835  return result;
836 }
837 
840 prereq_id(int xi) const
841 {
842  // Preconditions:
843 
844  require(state_is_read_accessible());
845  require(name_space()->state_is_read_accessible());
846 
847  // Body:
848 
849  // The result must be scoped if it is valid because
850  // namespace_poset_member::put_poset_prereq_id must be
851  // able to map it to the namespace member id space.
852  // The vector_space_index is just a pod, so we have to
853  // pick some id space for it and make sure we consistently
854  // use it. The obvious choice is the internal id space,
855  // so initialize result to internal scope.
856 
857  pod_index_type result;
858 
859  switch(xi)
860  {
861  case 0:
862 
863  // The first prerequisite is always the schema.
864 
865  result = schema().host()->index().pod();
866  break;
867 
868  case 1:
869 
870  // The scalar space over which this vector space is built.
871 
872  result = name_space()->member_id(scalar_space_path().poset_name(), false);
873  break;
874 
875  default:
876 
877  // No other prerequisites.
878 
879  result = invalid_pod_index();
880  break;
881  }
882 
883  // Postconditions:
884 
885  // Exit:
886 
887  return result;
888 }
889 
890 // PROTECTED MEMBER FUNCTIONS
891 
892 void
894 initialize_standard_subposets(const std::string& xname)
895 {
896  // Preconditions:
897 
899  require(poset_path::is_valid_name(xname));
900 
901  // Body:
902 
904 
906 
908 
909  // Postconditions:
910 
911  ensure(postcondition_of(sec_tuple_space::initialize_standard_subposets(xname)));
912  ensure(contains_variance_subposets(false));
913 
914  // Exit
915 
916  return;
917 }
918 
919 // PRIVATE MEMBER FUNCTIONS
920 
921 
922 //==============================================================================
923 // READ_WRITE_MONITOR_HANDLE FACET
924 //==============================================================================
925 
926 // PUBLIC MEMBER FUNCTIONS
927 
928 // PROTECTED MEMBER FUNCTIONS
929 
930 // PRIVATE MEMBER FUNCTIONS
931 
932 
933 //==============================================================================
934 // ANY FACET
935 //==============================================================================
936 
937 // PUBLIC MEMBER FUNCTIONS
938 
939 bool
941 is_ancestor_of(const any* xother) const
942 {
943  bool result;
944 
945  // Preconditions:
946 
947  // Body:
948 
949  result = dynamic_cast<const sec_vd_space*>(xother) != 0;
950 
951  // Postconditions:
952 
953  // Exit
954 
955  return result;
956 }
957 
960 clone() const
961 {
962  sec_vd_space* result;
963 
964  // Preconditions:
965 
966  // Body:
967 
968  result = new sec_vd_space;
969 
970  // Postconditions:
971 
972  ensure(result != 0);
973  ensure(is_same_type(result));
974  ensure(!result->is_attached());
975 
976  // Exit
977 
978  return result;
979 }
980 
981 bool
983 invariant() const
984 {
985  bool result = true;
986 
987 
988  if(invariant_check())
989  {
991 
992  invariance(sec_tuple_space::invariant());
993 
994  invariance(state_is_read_accessible() ? factor_ct() == d() : true);
995 
997  }
998 
999  return result;
1000 }
1001 
1002 // PROTECTED MEMBER FUNCTIONS
1003 
1004 // PRIVATE MEMBER FUNCTIONS
1005 
1006 
1007 // ===========================================================
1008 // NON-MEMBER FUNCTIONS
1009 // ===========================================================
1010 
1011 void
1013 print_prereq_paths(std::ostream &xos,
1014  const sec_vd_space& xspace,
1015  const std::string& xheading,
1016  const std::string& xindent,
1017  bool xauto_access)
1018 {
1019  // Preconditions:
1020 
1021  require(xspace.state_is_auto_read_accessible(xauto_access));
1022  require(xspace.name_space()->state_is_auto_read_accessible(xauto_access));
1023 
1024  // Body:
1025 
1026  const sec_tp_space* ltensor_section_space = dynamic_cast<const sec_tp_space*>(&xspace);
1027  const sec_at1_space* lvector_section_space = dynamic_cast<const sec_at1_space*>(&xspace);
1028  const sec_at0_space* lscalar_section_space = dynamic_cast<const sec_at0_space*>(&xspace);
1029 
1030  namespace_poset* lns = xspace.name_space();
1031 
1032  if(xauto_access)
1033  {
1034  xspace.get_read_access();
1035  }
1036 
1037 
1038  xos << xindent << xheading << endl;
1039 
1040  string lindent = xindent + " ";
1041 
1042  xos << lindent << "path: " << xspace.path() << endl;
1043  xos << lindent << "schema path: " << xspace.schema().path() << endl;
1044  xos << lindent << "rep path: " << xspace.schema().rep().path() << endl;
1045  xos << lindent << "base path: " << xspace.schema().base_space().path() << endl;
1046 
1047  const vd_space& lfiber_space = reinterpret_cast<const vd_space&>(xspace.schema().fiber_space());
1048  print_prereq_paths(xos, lfiber_space, "fiber space", lindent, xauto_access);
1049 
1050  if(lscalar_section_space == 0)
1051  {
1052  // Xspace must be vector or tensor space; print scalar space.
1053 
1054  sec_at0_space& lscalar_space = lns->member_poset<sec_at0_space>(xspace.scalar_space_path(), xauto_access);
1055  print_prereq_paths(xos, lscalar_space, "scalar section space", lindent, xauto_access);
1056 
1057  if((lvector_section_space == 0) && (ltensor_section_space != 0))
1058  {
1059  // Xspace is tensor; print vector space.
1060 
1061  lvector_section_space =
1062  &lns->member_poset<sec_at1_space>(ltensor_section_space->vector_space_path(), xauto_access);
1063  print_prereq_paths(xos, *lvector_section_space, "vector section space", lindent, xauto_access);
1064  }
1065  }
1066 
1067  if(xauto_access)
1068  {
1069  xspace.release_access();
1070  }
1071 
1072  // Postconditions:
1073 
1074  // Exit:
1075 
1076  return;
1077 }
1078 
1079 
virtual void put_is_vector(pod_index_type xmbr_id, bool xauto_access)
Sets is_vector true for the member with id xmbr_id.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
A client handle for a subposet.
Definition: subposet.h:86
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
section_space_schema_poset * host() const
The poset which this is a handle to a component of.
A client handle for a poset member which has been prepared for use as a schema for a section space...
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
A Cartesian product section space.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
virtual pod_index_type prereq_id(int xi) const
The id of the xi-th prerequisite poset for this.
const scoped_index & index() const
The member index of this poset within the namespace host()
A space of scalars viewed as an antisymmetric tensor section space of degree 1.
Definition: sec_at1_space.h:48
poset_path path(bool xauto_access=true) const
A path to this component.
static sec_vd_space & new_table(namespace_type &xhost, const poset_path &xpath, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
Creates a new sec_vd_space in namespace xns with path xpath, schema specified by xschema_path, and scalar space specified by xscalar_space_path.
Definition: sec_vd_space.cc:93
The default name space; a poset which contains other posets as members.
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual size_type subposet_ct() const
The number of subposets of this poset.
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
virtual void put_is_covector(pod_index_type xmbr_id, bool xauto_access)
Sets is_covector true for the member with id xmbr_id.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
virtual bool invariant() const
Class invariant.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
Definition: subposet.cc:955
STL namespace.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
An abstract vector section space of dimension d.
Definition: sec_vd_space.h:52
A Cartesian product space.
Definition: tuple_space.h:52
void create_variance_subposets()
Create covariant subposets.
virtual void get_read_access() const
Get read access to the state associated with this.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
sec_tuple_space()
Default constructor; creates a new sec_tuple_space handle not attached to any state.
void copy_dof_tuple(const poset_dof_map &xother)
Copies the dof tuple of xother into this.
static std::string covariant_subposet_name(int xi)
The name of the covariant subposet for the xi-th index.
void put_standard_subposet_ct(int xct)
Sets the number of standard subposets automatically allocated by the constructor. ...
virtual sec_vd_space * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
bool contains_variance_subposets(bool xauto_access) const
True if the variance subposets exist.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
virtual void initialize_standard_subposets(const std::string &xname)
Creates the standard subposets.
Abstract base class with useful features for all objects.
Definition: any.h:39
A space of scalars viewed as an antisymmetric tensor section space of degree 0.
Definition: sec_at0_space.h:48
poset & fiber_space()
The fiber space for section spaces on this schema.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
Definition: subposet.cc:2782
virtual const char * class_name() const
The name of this class.
virtual bool is_vector(pod_index_type xmbr_id, bool xauto_access) const
True if and only if the member with id xmbr_id is a vector (as opposed to a covector).
virtual size_type covariant_subposet_ct() const
The number of covariant subposets.
An abstract tensor section space of degree p.
Definition: sec_tp_space.h:53
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
Definition: subposet.cc:1091
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
poset_state_handle()
Default constructor.
static bool same_scalar_fiber_space(const namespace_poset &xns, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
True if and only if scalar space of fiber space == fiber space of scalar space. More precisely...
Definition: sec_vd_space.cc:55
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
sec_vd_space()
Default constructor; creates a new sec_vd_space handle not attached to any state. ...
static poset_handle_factory & factory()
The poset handle factory.
virtual void detach_from_state()
Detach this handle from its state, if any.
namespace_poset * name_space() const
The namespace this poset resides in.
virtual bool is_attached() const
True if this is attached to a state.
int factor_ct() const
The number of factors in this product.
An abstract vector space of dimension d.
Definition: vd_space.h:47
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
virtual void put_dof(pod_index_type xdof_id, const void *xdof, size_type xdof_size)
Sets the dof referred to by xdof_id to the value at xdof.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
total_poset_member & base_space()
The base space component of this (mutable version).
virtual void remove_member(pod_index_type xmbr_hub_id)
Removes the member of host() with hub id xmbr_hub_id.
Definition: subposet.cc:1209
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
poset_path scalar_space_path() const
The path of the underlying space of scalars.
virtual ~sec_vd_space()
Destructor.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
Definition: poset_path.cc:331
int d() const
The dimension.
virtual void get_read_access() const
Get read access to the state associated with this.
virtual poset_type type_id() const
Identifier for the type of this poset.
virtual bool is_covector(pod_index_type xmbr_id, bool xauto_access) const
True if and only if the member with id xmbr_id is a covector.
virtual bool invariant() const
Class invariant.
sec_rep_descriptor & rep()
The representation for section spaces on this schema (mutable version).
SHEAF_DLL_SPEC void print_prereq_paths(std::ostream &xos, const vd_space &xspace, const std::string &xheading, const std::string &xindent, bool xauto_access=true)
Print the paths for xspace and its prerequisites: schema, scalar space, etc.
Definition: vd_space.cc:962
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
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
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
virtual array_poset_dof_map & table_dof_map(bool xrequire_write_access=false)
The map from table dof client_ids to table dof values for this poset (mutable version) ...
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710