SheafSystem  0.0.0.0
vd_space.cc
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 
18 // Implementation for class vd_space.
19 
20 #include "SheafSystem/vd_space.h"
21 
22 #include "SheafSystem/abstract_poset_member.impl.h"
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/at0_space.h"
25 #include "SheafSystem/at1_space.h"
26 #include "SheafSystem/fiber_bundles_namespace.h"
27 #include "SheafSystem/namespace_poset.impl.h"
28 #include "SheafSystem/namespace_poset_member.h"
29 #include "SheafSystem/poset_handle_factory.h"
30 #include "SheafSystem/tp_space.h"
31 #include "SheafSystem/vd.h"
32 
33 using namespace std;
34 using namespace fiber_bundle; // Workaround for MS C++ bug.
35 
36 //#define DIAGNOSTIC_OUTPUT
37 
38 //==============================================================================
39 // VD_SPACE FACET
40 //==============================================================================
41 
43 const std::string&
46 {
47  // Preconditions:
48 
49 
50  // Body:
51 
52  static const string& result = vd::standard_schema_poset_name();
53 
54  // Postconditions:
55 
56  ensure(!result.empty());
57 
58  // Exit:
59 
60  return result;
61 }
62 
64 const sheaf::poset_path&
67 {
68  // Preconditions:
69 
70 
71  // Body:
72 
73  static const poset_path& result = vd::standard_schema_path();
74 
75  // Postconditions:
76 
77  ensure(result.full());
78  ensure(result.poset_name() == standard_schema_poset_name());
79 
80  // Exit:
81 
82  return result;
83 }
84 
88  const poset_path& xpath,
89  const poset_path& xschema_path,
90  const poset_path& xscalar_space_path,
91  bool xauto_access)
92 {
93  // cout << endl << "Entering vd_space::new_table." << endl;
94 
95  // Preconditions:
96 
97  require(xns.state_is_auto_read_write_accessible(xauto_access));
98 
99  require(!xpath.empty());
100  require(!xns.contains_path(xpath, xauto_access));
101 
102  require(xschema_path.full());
103  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
104  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path(), xauto_access));
105 
106  require(xns.path_is_auto_read_accessible<scalar_space_type>(xscalar_space_path, xauto_access));
107 
108  // Body:
109 
110  // Create the table; have to new it because namespace keeps a pointer.
111 
112  typedef vd_space table_type;
113 
114  table_type* ltable = new table_type();
115 
116  // Create a handle of the right type for the schema member.
117 
118  schema_poset_member lschema(&xns, xschema_path, xauto_access);
119 
120  if(xauto_access)
121  {
122  lschema.get_read_access();
123  }
124 
125  // Get the dimension (== number of row dofs) defined by the schema.
126 
127  int ld = lschema.row_dof_ct();
128 
129  // Create the table dof map and set dof values;
130  // must be newed because poset_state::_table keep a pointer to it.
131 
132  array_poset_dof_map* lmap = new array_poset_dof_map(&lschema, true);
133  lmap->put_dof("factor_ct", ld);
134  lmap->put_dof("d", ld);
135  lmap->put_dof("scalar_space_path", xscalar_space_path);
136 
137  // Create the state.
138 
139  ltable->new_state(xns, xpath, lschema, *lmap);
140 
141  if(xauto_access)
142  {
143  lschema.release_access();
144  }
145 
146  vd_space& result = *ltable;
147 
148  // Postconditions:
149 
150  ensure(xns.owns(result, xauto_access));
151  ensure(result.path(true) == xpath);
152  ensure(result.state_is_not_read_accessible());
153  ensure(result.schema(true).path(xauto_access) == xschema_path);
154 
155  ensure(result.factor_ct(true) == result.d(true));
156  ensure(result.d(true) == schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access));
157  ensure(result.scalar_space_path(true) == xscalar_space_path );
158 
159  // Exit:
160 
161  // cout << "Leaving vd_space::new_table." << endl;
162  return result;
163 }
164 
165 int
167 factor_ct(int xd)
168 {
169  return xd;
170 }
171 
172 int
174 d() const
175 {
176  // Preconditions:
177 
178  require(state_is_read_accessible());
179 
180  // Body:
181 
182  int result = sheaf::table_dofs(*this).d;
183 
184 
185  // Postconditions:
186 
187 
188  // Exit:
189 
190  return result;
191 }
192 
193 int
195 d(bool xauto_access) const
196 {
197  // Preconditions:
198 
199  require(state_is_auto_read_accessible(xauto_access));
200 
201  // Body:
202 
203  if(xauto_access)
204  {
205  get_read_access();
206  }
207 
208  int result = d();
209 
210  if(xauto_access)
211  {
212  release_access();
213  }
214 
215  // Postconditions:
216 
217 
218  // Exit:
219 
220  return result;
221 }
222 
223 int
225 d(const namespace_poset& xns, const poset_path& xvector_space_path, bool xauto_access)
226 {
227  // Preconditions:
228 
229  require(xns.state_is_auto_read_accessible(xauto_access));
230  require(!xvector_space_path.empty());
231  require(xns.contains_poset(xvector_space_path, xauto_access));
232  require(xns.member_poset(xvector_space_path, xauto_access).state_is_auto_read_accessible(xauto_access));
233 
234  // Body:
235 
236  vd_space& lvector_space = reinterpret_cast<vd_space&>(xns.member_poset(xvector_space_path, xauto_access));
237  int result = lvector_space.d(xauto_access);
238 
239  // Postconditions:
240 
241  ensure(result >= 0);
242 
243  // Exit:
244 
245  return result;
246 }
247 
251 {
252  // Preconditions:
253 
254  require(state_is_read_accessible());
255 
256  // Body:
257 
258  poset_path result(sheaf::table_dofs(*this).scalar_space_path);
259 
260  // Postconditions:
261 
262  ensure(!result.empty());
263 
264  // Exit:
265 
266  return result;
267 }
268 
271 scalar_space_path(bool xauto_access) const
272 {
273  // Preconditions:
274 
275  require(state_is_auto_read_accessible(xauto_access));
276 
277  // Body:
278 
279  if(xauto_access)
280  {
281  get_read_access();
282  }
283 
284  poset_path result(sheaf::table_dofs(*this).scalar_space_path);
285 
286  if(xauto_access)
287  {
288  release_access();
289  }
290 
291  // Postconditions:
292 
293  ensure(!result.empty());
294 
295  // Exit:
296 
297  return result;
298 }
299 
300 
303 scalar_space_path(const namespace_poset& xns, const poset_path& xvector_space_path, bool xauto_access)
304 {
305  // Preconditions:
306 
307  require(xns.state_is_auto_read_accessible(xauto_access));
308  require(!xvector_space_path.empty());
309  require(xns.contains_poset(xvector_space_path, xauto_access));
310  require(xns.member_poset(xvector_space_path, xauto_access).state_is_auto_read_accessible(xauto_access));
311 
312  // Body:
313 
314  vd_space& lvector_space = reinterpret_cast<vd_space&>(xns.member_poset(xvector_space_path, xauto_access));
315  poset_path result = lvector_space.scalar_space_path(xauto_access);
316 
317  // Postconditions:
318 
319  ensure(!result.empty());
320 
321  // Exit:
322 
323  return result;
324 }
325 
326 bool
328 contains_variance_subposets(bool xauto_access) const
329 {
330  // Preconditions:
331 
332  require(state_is_auto_read_accessible(xauto_access));
333 
334  // Body:
335 
336  if(xauto_access)
337  {
338  get_read_access();
339  }
340 
341  int lp = covariant_subposet_ct();
342 
343  bool result = true;
344  for(int i=0; i<lp && result; ++i)
345  {
346  result = includes_subposet(covariant_subposet_name(i), false);
347  }
348 
349  if(xauto_access)
350  {
351  release_access();
352  }
353 
354  // Postconditions:
355 
356  // Exit:
357 
358  return result;
359 }
360 
361 bool
363 is_vector(pod_index_type xmbr_id, bool xauto_access) const
364 {
365  // Preconditions:
366 
367  require(state_is_auto_read_accessible(xauto_access));
368 
369  // Body:
370 
371  if(xauto_access)
372  {
373  get_read_access();
374  }
375 
404 
408 
409  subposet lsp(this, covariant_subposet_name(0));
410  bool result = !lsp.contains_member(xmbr_id);
411  lsp.detach_from_state();
412 
413  if(xauto_access)
414  {
415  release_access();
416  }
417 
418  // Postconditions:
419 
420 
421  // Exit:
422 
423  return result;
424 }
425 
426 bool
428 is_vector(const scoped_index& xmbr_id, bool xauto_access) const
429 {
430  // Preconditions:
431 
432  require(state_is_auto_read_accessible(xauto_access));
433 
434  // Body:
435 
436  return is_vector(xmbr_id.hub_pod(), xauto_access);
437 }
438 
439 void
441 put_is_vector(pod_index_type xmbr_id, bool xauto_access)
442 {
443  // Preconditions:
444 
445  require(state_is_auto_read_write_accessible(xauto_access));
446 
447  // Body:
448 
449  if(xauto_access)
450  {
451  get_read_write_access();
452  }
453 
454  subposet lsp(this, covariant_subposet_name(0));
455  lsp.remove_member(xmbr_id);
456  lsp.detach_from_state();
457 
458  if(xauto_access)
459  {
460  release_access();
461  }
462 
463  // Postconditions:
464 
465  ensure(is_vector(xmbr_id, xauto_access));
466 
467  // Exit:
468 
469  return;
470 }
471 
472 void
474 put_is_vector(const scoped_index& xmbr_id, bool xauto_access)
475 {
476  // Preconditions:
477 
478  require(state_is_auto_read_write_accessible(xauto_access));
479 
480  // Body:
481 
482  put_is_vector(xmbr_id.hub_pod(), xauto_access);
483 
484  // Postconditions:
485 
486  ensure(is_vector(xmbr_id, xauto_access));
487 
488  // Exit:
489 
490  return;
491 }
492 
493 bool
495 is_covector(pod_index_type xmbr_id, bool xauto_access) const
496 {
497  // Preconditions:
498 
499  require(state_is_auto_read_accessible(xauto_access));
500 
501  // Body:
502 
503  if(xauto_access)
504  {
505  get_read_access();
506  }
507 
536 
540 
541  subposet lsp(this, covariant_subposet_name(0));
542  bool result = lsp.contains_member(xmbr_id);
543  lsp.detach_from_state();
544 
545  if(xauto_access)
546  {
547  release_access();
548  }
549 
550  // Postconditions:
551 
552 
553  // Exit:
554 
555  return result;
556 }
557 
558 bool
560 is_covector(const scoped_index& xmbr_id, bool xauto_access) const
561 {
562  // Preconditions:
563 
564  require(state_is_auto_read_accessible(xauto_access));
565 
566  // Body:
567 
568  return is_covector(xmbr_id.hub_pod(), xauto_access);
569 }
570 
571 void
573 put_is_covector(pod_index_type xmbr_id, bool xauto_access)
574 {
575  // Preconditions:
576 
577  require(state_is_auto_read_write_accessible(xauto_access));
578 
579  // Body:
580 
581  if(xauto_access)
582  {
583  get_read_write_access();
584  }
585 
586  subposet lsp(this, covariant_subposet_name(0));
587  lsp.insert_member(xmbr_id);
588  lsp.detach_from_state();
589 
590  if(xauto_access)
591  {
592  release_access();
593  }
594 
595  // Postconditions:
596 
597  ensure(is_covector(xmbr_id, xauto_access));
598 
599  // Exit:
600 
601  return;
602 }
603 
604 void
606 put_is_covector(const scoped_index& xmbr_id, bool xauto_access)
607 {
608  // Preconditions:
609 
610  require(state_is_auto_read_write_accessible(xauto_access));
611 
612  // Body:
613 
614  put_is_covector(xmbr_id.hub_pod(), xauto_access);
615 
616  // Postconditions:
617 
618  ensure(is_covector(xmbr_id, xauto_access));
619 
620  // Exit:
621 
622  return;
623 }
624 
627  : tuple_space(new vd, new vd)
628 {
629  // Preconditions:
630 
631  // Body:
632 
633  // Nothing to do, handled by base class
634 
635  // Postconditions:
636 
637  ensure(postcondition_of(tuple_space::tuple_space()));
638 }
639 
642 {
643  // Preconditions:
644 
645  // Body:
646 
647  // Postconditions:
648 
649  // Exit
650 
651  return;
652 }
653 
655 vd_space(vd* xtop, vd* xbottom)
656  : tuple_space(xtop, xbottom)
657 {
658  // Preconditions:
659 
660  require(xtop != 0);
661  require(xbottom != 0);
662 
663  // Body:
664 
665  // Nothing to do.
666 
667  // Postconditions:
668 
669  ensure(postcondition_of(poset_state_handle::poset_state_handle(xtop, xbottom)));
670 
671  // Exit:
672 
673  return;
674 }
675 
676 std::string
679 {
680  // Preconditions:
681 
682  // Body:
683 
684  string result(poset_path::make_reserved_name("covariant", xi, ""));
685 
686  // Postconditions:
687 
688  ensure(!result.empty());
689 
690  // Exit:
691 
692  return result;
693 }
694 
695 void
698 {
699  // Preconditions:
700 
702 
703  // Body:
704 
705  int lp = covariant_subposet_ct();
706 
707  for(int i=0; i<lp; ++i)
708  {
709  string lname(covariant_subposet_name(i));
710  if(!includes_subposet(lname, false))
711  {
712  subposet lcovariant(this);
713  lcovariant.put_name(lname, true, false);
714  lcovariant.detach_from_state();
715  }
716  }
717 
718  // Postconditions:
719 
720  ensure(contains_variance_subposets(false));
721 
722  // Exit:
723 
724  return;
725 }
726 
730 {
731  // Preconditions:
732 
733  require(state_is_read_accessible());
734 
735  // Body:
736 
737  size_type result = 1;
738 
739  // Postconditions:
740 
741  // Exit:
742 
743  return result;
744 }
745 
746 // ===========================================================
747 // POSET FACET
748 // ===========================================================
749 
750 bool
751 fiber_bundle::vd_space::
752 make_prototype()
753 {
754  bool result = false;
755 
756  // Preconditions:
757 
758  // Body:
759 
760 
761  vd_space* lproto = new vd_space;
762  poset_type ltype = lproto->type_id();
763 
764  factory().insert_prototype(lproto);
765  factory().insert_prototype(ltype, lproto);
766 
767  // Postconditions:
768 
769  // Exit:
770 
771  return result;
772 }
773 
774 //==============================================================================
775 // POSET_STATE_HANDLE FACET
776 //==============================================================================
777 
778 
779 
782 type_id() const
783 {
784  return VD_SPACE_ID;
785 }
786 
787 
788 
789 
790 
793 
794 const char*
796 class_name() const
797 {
798  // Preconditions:
799 
800 
801  // Body:
802 
803  static const char* result = "vd_space";
804 
805  // Postconditions:
806 
807  // Exit:
808 
809  return result;
810 }
811 
814 prereq_id(int xi) const
815 {
816  // Preconditions:
817 
818  require(state_is_read_accessible());
819  require(name_space()->state_is_read_accessible());
820 
821  // Body:
822 
823  // The result must be scoped if it is valid because
824  // namespace_poset_member::put_poset_prereq_id must be
825  // able to map it to the namespace member id space.
826  // The vector_space_index is just a pod, so we have to
827  // pick some id space for it and make sure we consistently
828  // use it. The obvious choice is the internal id space,
829  // so initialize result to internal scope.
830 
831  pod_index_type result;
832 
833  switch(xi)
834  {
835  case 0:
836 
837  // The first prerequisite is always the schema.
838 
839  result = schema().host()->index().pod();
840  break;
841 
842  case 1:
843 
844  // The scalar space over which this vector space is built.
845 
846  result = name_space()->member_id(scalar_space_path().poset_name(), false);
847  break;
848 
849  default:
850 
851  // No other prerequisites.
852 
853  result = invalid_pod_index();
854  break;
855  }
856 
857  // Postconditions:
858 
859 
860  // Exit:
861 
862  return result;
863 }
864 
865 void
867 initialize_standard_subposets(const std::string& xname)
868 {
869  // Preconditions:
870 
872  require(poset_path::is_valid_name(xname));
873 
874  // Body:
875 
877 
879 
880  // Postconditions:
881 
882  ensure(postcondition_of(tuple_space::initialize_standard_subposets(xname)));
883  ensure(contains_variance_subposets(false));
884 
885  // Exit
886 
887  return;
888 }
889 
890 //==============================================================================
891 // ANY FACET
892 //==============================================================================
893 
894 bool
896 is_ancestor_of(const any* xother) const
897 {
898  bool result;
899 
900  // Preconditions:
901 
902  // Body:
903 
904  result = dynamic_cast<const vd_space*>(xother) != 0;
905 
906  // Postconditions:
907 
908  // Exit
909 
910  return result;
911 }
912 
915 clone() const
916 {
917  vd_space* result;
918 
919  // Preconditions:
920 
921  // Body:
922 
923  result = new vd_space;
924 
925  // Postconditions:
926 
927  ensure(result != 0);
928  ensure(is_same_type(result));
929  ensure(!result->is_attached());
930 
931  // Exit
932 
933  return result;
934 }
935 
936 bool
938 invariant() const
939 {
940  bool result = true;
941 
942 
943  if(invariant_check())
944  {
946 
947  invariance(tuple_space::invariant());
948 
949  invariance(state_is_read_accessible() ? factor_ct() == d() : true);
950 
952  }
953 
954  return result;
955 }
956 
957 // ===========================================================
958 // NON-MEMBER FUNCTIONS
959 // ===========================================================
960 
961 void
963  const vd_space& xspace,
964  const std::string& xheading,
965  const std::string& xindent,
966  bool xauto_access)
967 {
968  // Preconditions:
969 
970  require(xspace.state_is_auto_read_accessible(xauto_access));
971  require(xspace.name_space()->state_is_auto_read_accessible(xauto_access));
972 
973  // Body:
974 
975  const tp_space* ltensor_space = dynamic_cast<const tp_space*>(&xspace);
976  const at1_space* lvector_space = dynamic_cast<const at1_space*>(&xspace);
977  const at0_space* lscalar_space = dynamic_cast<const at0_space*>(&xspace);
978 
979  namespace_poset* lns = xspace.name_space();
980 
981  if(xauto_access)
982  {
983  xspace.get_read_access();
984  }
985 
986  xos << xindent << xheading << endl;
987 
988  string lindent = xindent + " ";
989 
990  xos << lindent << "path: " << xspace.path() << endl;
991  xos << lindent << "schema path: " << xspace.schema().path() << endl;
992 
993  if(lscalar_space == 0)
994  {
995  // Xspace must be vector or tensor space; print scalar space.
996 
997  at0_space& lscalar_space = lns->member_poset<at0_space>(xspace.scalar_space_path(), xauto_access);
998  print_prereq_paths(xos, lscalar_space, "scalar space", lindent, xauto_access);
999 
1000  if((lvector_space == 0) && (ltensor_space != 0))
1001  {
1002  // Xspace is tensor; print vector space.
1003 
1004  lvector_space = &lns->member_poset<at1_space>(ltensor_space->vector_space_path(), xauto_access);
1005  print_prereq_paths(xos, *lvector_space, "vector space", lindent, xauto_access);
1006  }
1007  }
1008 
1009  if(xauto_access)
1010  {
1011  xspace.release_access();
1012  }
1013 
1014  // Postconditions:
1015 
1016  // Exit:
1017 
1018  return;
1019 }
1020 
virtual poset_type type_id() const
Identifier for the type of this poset.
Definition: vd_space.cc:782
poset_state_handle * host() const
The poset which this is a handle to a component of.
virtual void put_is_covector(pod_index_type xmbr_id, bool xauto_access)
Sets is_covector true for the member with id xmbr_id.
Definition: vd_space.cc:573
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.
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
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 vd_space * clone() const
Virtual constructor; creates a new handle of the same actual type as this, attached to the same state...
Definition: vd_space.cc:915
virtual pod_index_type prereq_id(int xi) const
The id of the xi-th prerequisite poset for this.
Definition: vd_space.cc:814
static 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 vd_space in namespace xns with path xpath, schema specified by xschema_path, and table attribute scalar_space_path specified by xscalar_space_path.
Definition: vd_space.cc:87
const scoped_index & index() const
The member index of this poset within the namespace host()
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
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...
static const std::string & standard_schema_poset_name()
The name of the standard schema poset for this class.
Definition: vd_space.cc:45
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.
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
bool contains_variance_subposets(bool xauto_access) const
True if the variance subposets exist.
Definition: vd_space.cc:328
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
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.
virtual ~vd_space()
Destructor.
Definition: vd_space.cc:641
A Cartesian product space.
Definition: tuple_space.h:52
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.
static std::string covariant_subposet_name(int xi)
The name of the covariant subposet for the xi-th index.
Definition: vd_space.cc:678
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.
Definition: vd_space.cc:867
Abstract base class with useful features for all objects.
Definition: any.h:39
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
tuple_space()
Default constructor; creates a new tuple_space handle not attached to any state.
Definition: tuple_space.cc:202
virtual size_type covariant_subposet_ct() const
The number of covariant subposets.
Definition: vd_space.cc:729
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
A space of scalars viewed as an antisymmetric tensor space of degree 0.
Definition: at0_space.h:42
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
std::string poset_name() const
The poset name part of the path.
Definition: poset_path.cc:473
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
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: vd_space.cc:66
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
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...
void create_variance_subposets()
Create covariant subposets.
Definition: vd_space.cc:697
poset_state_handle()
Default constructor.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Definition: vd_space.cc:250
static poset_handle_factory & factory()
The poset handle factory.
int d() const
The dimension.
Definition: vd_space.cc:174
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.
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).
Definition: vd_space.cc:363
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
An abstract vector space of dimension d.
Definition: vd_space.h:47
virtual void put_is_vector(pod_index_type xmbr_id, bool xauto_access)
Sets is_vector true for the member with id xmbr_id.
Definition: vd_space.cc:441
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
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
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
virtual bool invariant() const
Class invariant.
Definition: vd_space.cc:938
virtual bool is_ancestor_of(const any *xother) const
True if other conforms to this.
Definition: vd_space.cc:896
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.
Definition: vd_space.cc:495
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
virtual void get_read_access() const
Get read access to the state associated with this.
vd_space()
Default constructor; creates a new vd_space handle not attached to any state.
Definition: vd_space.cc:626
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.
An abstract tensor space of degree p.
Definition: tp_space.h:47
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
virtual bool invariant() const
Class invariant.
Definition: tuple_space.cc:367
Abstract vector space over dof_type.
Definition: vd.h:350
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
int factor_ct() const
The number of factors in this product.
Definition: tuple_space.cc:152
virtual const char * class_name() const
The name of this class.
Definition: vd_space.cc:796
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
A client handle for a poset member which has been prepared for use as a schema.
static std::string make_reserved_name(const std::string &xprefix, const size_t &xindex, const std::string &xsuffix)
Creates a string reserved_prefix()_xprefix_xindex_xsuffix.
Definition: poset_path.cc:733
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