SheafSystem  0.0.0.0
at2.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/at2.h"
22 
23 #include "SheafSystem/abstract_poset_member.impl.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/at0.h"
26 #include "SheafSystem/at1_space.h"
27 #include "SheafSystem/fiber_bundles_namespace.h"
28 #include "SheafSystem/schema_poset_member.h"
29 #include "SheafSystem/wsv_block.h"
30 
31 using namespace std;
32 using namespace fiber_bundle; // Workaround for MS C++ bug.
33 
34 
35 //==============================================================================
36 // CLASS AT2_LITE
37 //==============================================================================
38 
39 
40 //==============================================================================
41 // AT2 FACET
42 //==============================================================================
43 
44 // PUBLIC MEMBER FUNCTIONS
45 
48 {
49 
50  // Preconditions:
51 
52  // Body:
53 
54  // Postconditions:
55 
56  ensure(invariant());
57 
58  // Exit:
59 }
60 
62 at2_lite(const at2_lite& xother)
63 {
64  // Preconditions:
65 
66  // Body:
67 
68  *this = xother;
69 
70  // Postconditions:
71 
72  ensure(invariant());
73 
74  // Exit:
75 }
76 
79 operator=(const at2_lite& xother)
80 {
81 
82  // Preconditions:
83 
84 
85  // Body:
86 
87 
88  // Postconditions:
89 
90  ensure(invariant());
91 
92  // Exit:
93 
94  return *this;
95 }
96 
99 {
100  // Preconditions:
101 
102  // Body:
103 
104  // Postconditions:
105 
106  // Exit:
107 
108 }
109 
111 at2_lite(const row_dofs_type& xrow_dofs)
112 {
113  // Preconditions:
114 
115  // Body:
116 
117  *this = xrow_dofs;
118 
119  // Postconditions:
120 
121  ensure(invariant());
122 
123  // Exit:
124 }
125 
128 operator=(const row_dofs_type& xrow_dofs)
129 {
130  // Preconditions:
131 
132  // Body:
133 
134  vd_lite::operator=(xrow_dofs);
135 
136  // Postconditions:
137 
138  postcondition_of(vd_lite::operator=(xrow_dofs));
139 
140  // Exit:
141 
142  return *this;
143 
144 }
145 
148 component(int xrow, int xcolumn) const
149 {
150  // Preconditions:
151 
152 // // We only allow values for xrow and xcolumn which are above
153 // // (not including) the diagonal.
154 
155 // require(0 <= xrow && xrow < dd()-1);
156 // require(xrow < xcolumn && xcolumn < dd());
157 
158  require(xrow >= 0 && xrow < dd());
159  require(xcolumn >= 0 && xcolumn < dd());
160 
161  // Body:
162 
163  //value_type result = component(index_for_row_column(xrow, xcolumn));
164 
165  value_type result = 0;
166  if(xrow < xcolumn)
167  {
168  result = component(index_for_row_column(xrow, xcolumn));
169  }
170  else if(xrow > xcolumn)
171  {
172  result = -component(index_for_row_column(xcolumn, xrow));
173  }
174 
175 
176  // Postconditions:
177 
178  ensure(invariant());
179 
180  // Exit:
181 
182  return result;
183 }
184 
185 void
187 put_component(int xrow, int xcolumn, value_type xcomp)
188 {
189  // Preconditions:
190 
191  // We only allow values for xrow and xcolumn which are above
192  // (not including) the diagonal.
193 
194  require(0 <= xrow && xrow < dd()-1);
195  require(xrow < xcolumn && xcolumn < dd());
196 
197  // Body:
198 
199  int lindex = index_for_row_column(xrow, xcolumn);
200  put_component(lindex, xcomp);
201 
202  // Postconditions:
203 
204  ensure(invariant());
205  ensure(isunordered_or_equals(component(index_for_row_column(xrow, xcolumn)), xcomp));
206 
207  // Exit:
208 
209  return;
210 }
211 
212 
213 int
215 index_for_row_column(int xrow, int xcolumn) const
216 {
217  // Preconditions:
218 
219  // We only allow values for xrow and xcolumn which are above
220  // (not including) the diagonal.
221 
222  require(0 <= xrow && xrow < dd()-1);
223  require(xrow < xcolumn && xcolumn < dd());
224 
225  //require(0 <= xrow && xrow < dd());
226  //require(0 <= xcolumn && xcolumn < dd());
227 
228  // Body:
229 
230  // Convert (xrow, xcolumn) into an index into linear component storage
231  // (upper triangular stored by rows).
232 
233  int i = xrow;
234  int j = xcolumn;
235 
236  // Swap i and j if i > j.
237 
238  if(i > j)
239  {
240  int isave = i;
241  i = j;
242  j = isave;
243  }
244 
245  int result = j + (i*(2*dd()-3-i))/2 - 1;
246 
247  // Postconditions:
248 
249  ensure(invariant());
250  ensure(result >= 0);
251  ensure(result < d());
252 
253  // Exit:
254 
255  return result;
256 }
257 
258 // PROTECTED MEMBER FUNCTIONS
259 
260 // PRIVATE MEMBER FUNCTIONS
261 
262 
263 //==============================================================================
264 // EXTERIOR ALGEBRA (ATP) FACET
265 //==============================================================================
266 
267 // PUBLIC MEMBER FUNCTIONS
268 
269 int
271 p() const
272 {
273  // Preconditions:
274 
275  // Body:
276 
277  int result = 2;
278 
279  // Postconditions:
280 
281  ensure(invariant());
282  ensure(result == 2);
283 
284  // Exit:
285 
286  return result;
287 }
288 
289 // PROTECTED MEMBER FUNCTIONS
290 
291 // PRIVATE MEMBER FUNCTIONS
292 
293 
294 //==============================================================================
295 // TENSOR ALGEBRA (TP) FACET
296 //==============================================================================
297 
298 // PUBLIC MEMBER FUNCTIONS
299 
300 // PROTECTED MEMBER FUNCTIONS
301 
302 // PRIVATE MEMBER FUNCTIONS
303 
304 
305 //==============================================================================
306 // VECTOR ALGEBRA (VD) FACET
307 //==============================================================================
308 
309 // PUBLIC MEMBER FUNCTIONS
310 
311 // PROTECTED MEMBER FUNCTIONS
312 
313 // PRIVATE MEMBER FUNCTIONS
314 
315 
316 //==============================================================================
317 // CARTESIAN ALGEBRA (TUPLE) FACET
318 //==============================================================================
319 
320 // PUBLIC MEMBER FUNCTIONS
321 
322 // PROTECTED MEMBER FUNCTIONS
323 
324 // PRIVATE MEMBER FUNCTIONS
325 
326 
327 //==============================================================================
328 // ABSTRACT POSET MEMBER FACET
329 //==============================================================================
330 
331 // PUBLIC MEMBER FUNCTIONS
332 
333 const std::string&
335 class_name() const
336 {
337  // Preconditions:
338 
339  // Body:
340 
341  const string& result = static_class_name();
342 
343  // Postconditions:
344 
345  ensure(!result.empty());
346 
347  // Exit:
348 
349  return result;
350 }
351 
352 const std::string&
355 {
356  // Preconditions:
357 
358  // Body:
359 
360  static const string result("at2_lite");
361 
362  // Postconditions:
363 
364  ensure(!result.empty());
365 
366  // Exit:
367 
368  return result;
369 }
370 
373 clone() const
374 {
375  at2_lite* result = 0;
376 
377  // Preconditions:
378 
379  // Body:
380 
381  result = new at2_lite();
382 
383  // Postconditions:
384 
385  ensure(result != 0);
386  ensure(is_same_type(*result));
387 
388  // Exit:
389 
390  return result;
391 }
392 
393 // PROTECTED MEMBER FUNCTIONS
394 
395 // PRIVATE MEMBER FUNCTIONS
396 
397 
398 //==============================================================================
399 // ANY FACET
400 //==============================================================================
401 
402 // PUBLIC MEMBER FUNCTIONS
403 
404 bool
406 is_ancestor_of(const any_lite& xother) const
407 {
408  // Preconditions:
409 
410  require(&xother != 0);
411 
412  // Body:
413 
414  // True if other conforms to this.
415 
416  bool result = dynamic_cast<const at2_lite*>(&xother) != 0;
417 
418  // Postconditions:
419 
420  return result;
421 }
422 
423 bool
425 invariant() const
426 {
427  bool result = true;
428 
429  if(invariant_check())
430  {
431  // Prevent recursive calls to invariant.
432 
433  disable_invariant_check();
434 
435  // Must satisfy base class invariant.
436 
437  invariance(atp_lite::invariant());
438 
439  // Invariances for this class:
440 
441  // Finished, turn invariant checking back on.
442 
443  enable_invariant_check();
444  }
445 
446  // Exit
447 
448  return result;
449 }
450 
451 // PROTECTED MEMBER FUNCTIONS
452 
453 // PRIVATE MEMBER FUNCTIONS
454 
455 
456 //==============================================================================
457 // CLASS AT2
458 //==============================================================================
459 
460 // ===========================================================
461 // HOST FACTORY FACET OF CLASS AT2
462 // ===========================================================
463 
464 // PUBLIC MEMBER FUNCTIONS
465 
466 const sheaf::poset_path&
469 {
470  // Preconditions:
471 
472 
473  // Body:
474 
475  static const poset_path result(standard_schema_poset_name(), "at2_schema");
476 
477  // Postconditions:
478 
479  // Exit:
480 
481  return result;
482 }
483 
484 void
487 {
488  // Preconditions:
489 
490  require(xns.state_is_read_write_accessible());
491  require(xns.contains_poset(standard_schema_poset_name()));
492  require(!xns.contains_poset_member(standard_schema_path()));
493 
494  // Body:
495 
496  schema_poset_member lschema(xns,
497  standard_schema_path().member_name(),
498  atp::standard_schema_path(),
499  "",
500  false);
501 
502  lschema.detach_from_state();
503 
504  // Postconditions:
505 
506  ensure(xns.contains_poset_member(standard_schema_path()));
507 
508  // Exit:
509 
510  return;
511 }
512 
516  const poset_path& xhost_path,
517  const poset_path& xschema_path,
518  const poset_path& xscalar_space_path,
519  bool xauto_access)
520 {
521  // cout << endl << "Entering at2::new_host." << endl;
522 
523  // Preconditions:
524 
525  require(xns.state_is_auto_read_write_accessible(xauto_access));
526 
527  require(!xhost_path.empty());
528  require(!xns.contains_path(xhost_path, xauto_access));
529 
530  require(xschema_path.full());
531  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
532  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
533 
534  require(xns.path_is_auto_read_accessible(xscalar_space_path, xauto_access));
535  require(xns.contains_poset<scalar_type::host_type>(xscalar_space_path, xauto_access));
536 
537  // Body:
538 
539  host_type& result =
540  host_type::new_table(xns, xhost_path, xschema_path, 2, xscalar_space_path, xauto_access);
541 
542  // Postconditions:
543 
544  ensure(xns.owns(result, xauto_access));
545  ensure(result.path(true) == xhost_path);
546  ensure(result.state_is_not_read_accessible());
547  ensure(result.schema(true).path(xauto_access) == xschema_path);
548 
549  ensure(result.factor_ct(true) == result.d(true));
550  ensure(result.d(true) == schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access));
551  ensure(result.scalar_space_path(true) == xscalar_space_path );
552  ensure(result.p(true) == 2);
553  ensure(result.dd(true) == result.d(true));
554  ensure(result.vector_space_path(true) == xhost_path );
555 
556  // Exit:
557 
558  // cout << "Leaving at2::new_host." << endl;
559  return result;
560 }
561 
562 // PROTECTED MEMBER FUNCTIONS
563 
564 // PRIVATE MEMBER FUNCTIONS
565 
566 
567 //==============================================================================
568 // AT2 FACET
569 //==============================================================================
570 
571 // PUBLIC MEMBER FUNCTIONS
572 
575 {
576 
577  // Preconditions:
578 
579  // Body:
580 
581  // Postconditions:
582 
583  ensure(invariant());
584 }
585 
587 at2(const poset_state_handle* xhost, pod_index_type xhub_id)
588 {
589  // Preconditions:
590 
591  require(xhost != 0);
592  require(xhost->state_is_read_accessible());
593  require(xhost->contains_member(xhub_id));
594 
595  // Body:
596 
597  attach_to_state(xhost, xhub_id);
598 
599  // Postconditions:
600 
601  ensure(invariant());
602  // ensure(host() == xhost);
603  ensure(index() == xhub_id);
604  ensure(is_attached());
605 }
606 
608 at2(const poset_state_handle* xhost, const scoped_index& xid)
609 {
610  // Preconditions:
611 
612  require(xhost != 0);
613  require(xhost->state_is_read_accessible());
614  require(xhost->contains_member(xid));
615 
616  // Body:
617 
618  attach_to_state(xhost, xid.hub_pod());
619 
620  // Postconditions:
621 
622  ensure(invariant());
623  // ensure(host() == xhost);
624  ensure(index() ==~ xid);
625  ensure(is_attached());
626 }
627 
629 at2(const poset_state_handle* xhost, const std::string& xname)
630 {
631 
632  // Preconditions:
633 
634  require(xhost != 0);
635  require(xhost->state_is_read_accessible());
636  require(!xname.empty());
637  require(xhost->contains_member(xname));
638 
639  // Body:
640 
641  attach_to_state(xhost, xname);
642 
643  // Postconditions:
644 
645  ensure(invariant());
646  // ensure(host() == xhost);
647  ensure(name() == xname);
648  ensure(is_attached());
649 
650 }
651 
654 {
655 
656  // Preconditions:
657 
658  require(xother != 0);
659 
660  // Body:
661 
662  attach_to_state(xother);
663 
664  // Postconditions:
665 
666  ensure(invariant());
667  ensure(is_attached());
668  ensure(is_same_state(xother));
669 
670 }
671 
673 at2(poset_state_handle* xhost, bool xauto_access)
674 {
675 
676  // Preconditions:
677 
678  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
679 
680  // Body:
681 
682  new_jim_state(xhost, 0, false, xauto_access);
683 
684  // Postconditions:
685 
686  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
687 
688  // Exit:
689 
690  return;
691 }
692 
697 {
698  // Preconditions:
699 
700  require(is_ancestor_of(&xother));
701  require(precondition_of(attach_to_state(&xother)));
702 
703  // Body:
704 
705  attach_to_state(&xother);
706 
707  // Postconditions:
708 
709  ensure(postcondition_of(attach_to_state(&xother)));
710 
711  // Exit:
712 
713  return *this;
714 }
715 
719 operator=(const at2& xother)
720 {
721  // Preconditions:
722 
723  require(precondition_of(attach_to_state(&xother)));
724 
725  // Body:
726 
727  attach_to_state(&xother);
728 
729  // Postconditions:
730 
731  ensure(postcondition_of(attach_to_state(&xother)));
732 
733  // Exit:
734 
735  return *this;
736 }
737 
740 {
741 
742  // Preconditions:
743 
744  // Body:
745 
746  // Postconditions:
747 
748 }
749 
753 {
754  // Preconditions:
755 
756  // Body:
757 
758  static const volatile_type result;
759 
760  // Postconditions:
761 
762  // Exit:
763 
764  return result;
765 }
766 
770 lite_type() const
771 {
772  // Preconditions:
773 
774  // Body:
775 
776  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
777 
778  // Postconditions:
779 
780  // Exit:
781 
782  return result;
783 }
784 
787 component(int xrow, int xcolumn) const
788 {
789  // Preconditions:
790 
791  require(state_is_read_accessible());
792  require(xrow >= 0 && xrow < dd());
793  require(xcolumn >= 0 && xcolumn < dd());
794 
795  // Body:
796 
797  value_type result = 0;
798  if(xrow < xcolumn)
799  {
800  result = component(index_for_row_column(xrow, xcolumn));
801  }
802  else if(xrow > xcolumn)
803  {
804  result = -component(index_for_row_column(xcolumn, xrow));
805  }
806 
807  // Postconditions:
808 
809  ensure(invariant());
810 
811  // Exit:
812 
813  return result;
814 }
815 
818 component(int xrow, int xcolumn, bool xauto_access) const
819 {
820  // Preconditions:
821 
822  require(state_is_auto_read_accessible(xauto_access));
823  require(xrow >= 0 && xrow < dd());
824  require(xcolumn >= 0 && xcolumn < dd());
825 
826  // Body:
827 
828  if(xauto_access)
829  {
830  get_read_access();
831  }
832 
833  value_type result = component(xrow, xcolumn);
834 
835  if(xauto_access)
836  {
837  release_access();
838  }
839 
840  // Postconditions:
841 
842  ensure(invariant());
843 
844  // Exit:
845 
846  return result;
847 }
848 
849 void
851 put_component(int xrow, int xcolumn, value_type xvalue)
852 {
853 
854  // Preconditions:
855 
856  require(state_is_read_write_accessible());
857 
858  // We only allow values for xrow and xcolumn which are above
859  // (not including) the diagonal.
860 
861  require((0 <= xrow) && (xrow < dd()-1));
862  require((xrow < xcolumn) && (xcolumn < dd()));
863 
864  // Body:
865 
866  put_component(index_for_row_column(xrow, xcolumn), xvalue);
867 
868  // Postconditions:
869 
870  ensure(invariant());
871  ensure(isunordered_or_equals(component(xrow, xcolumn), xvalue));
872 
873  // Exit:
874 
875  return;
876 }
877 
878 void
880 put_component(int xrow, int xcolumn, value_type xvalue, bool xauto_access)
881 {
882 
883  // Preconditions:
884 
885  require(state_is_auto_read_write_accessible(xauto_access));
886  require((0 <= xrow) && (xrow < dd(xauto_access)-1));
887  require((xrow < xcolumn) && (xcolumn < dd(xauto_access)));
888 
889  // Body:
890 
891  if(xauto_access)
892  {
893  get_read_write_access(true);
894  }
895 
896  put_component(index_for_row_column(xrow, xcolumn), xvalue);
897 
898  if(xauto_access)
899  {
900  release_access();
901  }
902 
903  // Postconditions:
904 
905  ensure(invariant());
906  ensure(isunordered_or_equals(component(xrow, xcolumn), xvalue));
907 
908  // Exit:
909 
910  return;
911 }
912 
913 int
915 index_for_row_column(int xrow, int xcolumn) const
916 {
917  // Preconditions:
918 
919  // We only allow values for xrow and xcolumn which are above
920  // (not including) the diagonal.
921 
922  require(0 <= xrow && xrow < dd()-1);
923  require(xrow < xcolumn && xcolumn < dd());
924 
925  // Body:
926 
927  // Convert (xrow, xcolumn) into an index into linear component storage.
928 
929  int i = xrow;
930  int j = xcolumn;
931 
932  int result = j + (i*(2*dd()-3-i))/2 - 1;
933 
934  // Postconditions:
935 
936  //ensure(invariant());
937  ensure(result >= 0);
938  ensure(result < d());
939 
940  // Exit:
941 
942  return result;
943 }
944 
945 // PROTECTED MEMBER FUNCTIONS
946 
947 // PRIVATE MEMBER FUNCTIONS
948 
949 
950 //==============================================================================
951 // ATP FACET
952 //==============================================================================
953 
954 // PUBLIC MEMBER FUNCTIONS
955 
956 // PROTECTED MEMBER FUNCTIONS
957 
958 // PRIVATE MEMBER FUNCTIONS
959 
960 
961 //==============================================================================
962 // TP FACET
963 //==============================================================================
964 
965 // PUBLIC MEMBER FUNCTIONS
966 
967 // PROTECTED MEMBER FUNCTIONS
968 
969 // PRIVATE MEMBER FUNCTIONS
970 
971 
972 //==============================================================================
973 // VD FACET
974 //==============================================================================
975 
976 // PUBLIC MEMBER FUNCTIONS
977 
978 // PROTECTED MEMBER FUNCTIONS
979 
980 // PRIVATE MEMBER FUNCTIONS
981 
982 
983 //==============================================================================
984 // TUPLE FACET
985 //==============================================================================
986 
987 // PUBLIC MEMBER FUNCTIONS
988 
989 // PROTECTED MEMBER FUNCTIONS
990 
991 // PRIVATE MEMBER FUNCTIONS
992 
993 
994 //==============================================================================
995 // ABSTRACT POSET MEMBER FACET
996 //==============================================================================
997 
998 // PUBLIC MEMBER FUNCTIONS
999 
1000 const std::string&
1002 class_name() const
1003 {
1004  // Preconditions:
1005 
1006  // Body:
1007 
1008  const string& result = static_class_name();
1009 
1010  // Postconditions:
1011 
1012  ensure(!result.empty());
1013 
1014  // Exit:
1015 
1016  return result;
1017 }
1018 
1019 const std::string&
1022 {
1023  // Preconditions:
1024 
1025  // Body:
1026 
1027  static const string result("at2");
1028 
1029  // Postconditions:
1030 
1031  ensure(!result.empty());
1032 
1033  // Exit:
1034 
1035  return result;
1036 }
1037 
1040 clone() const
1041 {
1042 
1043  // Preconditions:
1044 
1045  // Body:
1046 
1047  // Create new handle of the current class.
1048 
1049  at2* result = new at2();
1050 
1051  // Postconditions:
1052 
1053  ensure(result != 0);
1054  ensure(result->invariant());
1055 
1056  // Exit:
1057 
1058  return result;
1059 }
1060 
1061 // PROTECTED MEMBER FUNCTIONS
1062 
1063 // PRIVATE MEMBER FUNCTIONS
1064 
1065 
1066 //==============================================================================
1067 // ANY FACET
1068 //==============================================================================
1069 
1070 // PUBLIC MEMBER FUNCTIONS
1071 
1072 bool
1074 is_ancestor_of(const any* xother) const
1075 {
1076 
1077  // Preconditions:
1078 
1079  require(xother != 0);
1080 
1081  // Body:
1082 
1083  // If xother may be dynamically cast to the type of this then this is an
1084  // ancestor of other.
1085 
1086  bool result = dynamic_cast<const at2*>(xother) != 0;
1087 
1088  // Postconditions:
1089 
1090  ensure(invariant());
1091  ensure(xother->invariant());
1092 
1093  // Exit:
1094 
1095  return result;
1096 }
1097 
1098 bool
1100 invariant() const
1101 {
1102  bool result = true;
1103 
1104  // Body:
1105 
1106  if (invariant_check())
1107  {
1108  // Prevent recursive calls to invariant.
1109 
1110  disable_invariant_check();
1111 
1112  // Must satisfy base class invariant.
1113 
1114  invariance(atp::invariant());
1115 
1116  // Invariances for this class:
1117 
1118  invariance((state_is_read_accessible() ? p() == 2 : true));
1119 
1120  // Finished, turn invariant checking back on.
1121 
1122  enable_invariant_check();
1123  }
1124 
1125  // Exit:
1126 
1127  return result;
1128 }
1129 
1130 // PROTECTED MEMBER FUNCTIONS
1131 
1132 // PRIVATE MEMBER FUNCTIONS
1133 
1134 
1135 
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
Definition: any.cc:153
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 ...
static const std::string & static_class_name()
The name of this class.
Definition: at2.cc:1021
bool invariant() const
Class invariant.
Definition: at2.cc:425
at2()
Default constructor.
Definition: at2.cc:574
virtual void put_component(int xrow, int xcolumn, value_type xcomp)
Sets value of a component in a specified row and column.
Definition: at2.cc:187
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: atp_space.cc:86
virtual int index_for_row_column(int xrow, int xcolumn) const
The index into linear storage of the component in a specified row and column.
Definition: at2.cc:915
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...
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
A client handle for a general, abstract partially order set.
virtual at2 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
Definition: at2.cc:696
virtual int p() const
Degree of this as an antisymmetric tensor space.
Definition: at2.cc:271
virtual const std::string & class_name() const
The name of this class.
Definition: at2.cc:1002
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
STL namespace.
at2_lite & operator=(const at2_lite &xother)
Assignment operator.
Definition: at2.cc:79
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: at2.cc:486
virtual int index_for_row_column(int xrow, int xcolumn) const
The index into linear storage of the component in a specified row and column.
Definition: at2.cc:215
virtual at2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: at2.cc:373
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: at2.cc:770
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
Definition: at2.cc:1074
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
static const std::string & static_class_name()
The name of this class.
Definition: at2.cc:354
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual ~at2_lite()
Destructor.
Definition: at2.cc:98
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xscalar_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
Definition: at2.cc:515
A space of scalars viewed as an antisymmetric tensor space of degree 0.
Definition: at0_space.h:42
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: at2.cc:468
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)
at2_lite()
Default constructor.
Definition: at2.cc:47
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual const std::string & class_name() const
The name of this class.
Definition: at2.cc:335
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
Definition: tp_space.cc:235
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
virtual at2 * clone() const
Make a new handle, no state instance of current.
Definition: at2.cc:1040
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
~at2()
Destructor.
Definition: at2.cc:739
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: at2.cc:752
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: at2.h:56
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: at2.cc:148
An abstract client handle for a member of a poset.
bool invariant() const
Class invariant.
Definition: at2.cc:1100
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
Definition: at2.cc:787
void put_component(int xrow, int xcolumn, value_type xvalue)
Sets the component with row index xrow and column index xcolumn to xvalue.
Definition: at2.cc:851
Namespace for the fiber_bundles component of the sheaf system.
Row dofs type for class vd.
Definition: vd.h:61
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: at2.cc:406
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233
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.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.
Definition: sheaf.cc:102