SheafSystem  0.0.0.0
met_e2.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/met_e2.impl.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/stp_space.h"
28 #include "SheafSystem/fiber_bundles_namespace.h"
29 #include "SheafSystem/schema_poset_member.h"
30 #include "SheafSystem/wsv_block.h"
31 
32 
33 using namespace std;
34 using namespace fiber_bundle; // Workaround for MS C++ bug.
35 
36 
37 //==============================================================================
38 // CLASS MET_E2_ROW_DOFS_TYPE
39 //==============================================================================
40 
41 
42 //==============================================================================
43 // CLASS MET_E2_LITE
44 //==============================================================================
45 
46 //==============================================================================
47 // EUCLIDEAN METRIC 2D (MET_E2) FACET OF CLASS MET_E2_LITE
48 //==============================================================================
49 
50 // PUBLIC MEMBER FUNCTIONS
51 
54 {
55  // Preconditions:
56 
57  // Body:
58 
59  // Postconditions:
60 
61  ensure(invariant());
62 
63  // Exit:
64 }
65 
67 met_e2_lite(const met_e2_lite& xother)
68 {
69  // Preconditions:
70 
71  // Body:
72 
73  *this = xother;
74 
75  // Postconditions:
76 
77  ensure(invariant());
78 
79  // Exit:
80 }
81 
84 operator=(const met_e2_lite& xother)
85 {
86 
87  // Preconditions:
88 
89 
90  // Body:
91 
92  if(this == &xother)
93  return *this;
94 
95  _row_dofs = xother._row_dofs;
96 
97  // Postconditions:
98 
99  ensure(invariant());
100  ensure_for_all(i, 0, d(), component(i) == xother[i]);
101 
102  // Exit:
103 
104  return *this;
105 }
106 
109 {
110  // Preconditions:
111 
112  // Body:
113 
114  // Postconditions:
115 
116  // Exit:
117 }
118 
120 met_e2_lite(const row_dofs_type& xrow_dofs)
121 {
122  // Preconditions:
123 
124  // Body:
125 
126  *this = xrow_dofs;
127 
128  // Postconditions:
129 
130  ensure(invariant());
131 
132  // Exit:
133 }
134 
137 operator=(const row_dofs_type& xrow_dofs)
138 {
139  // Preconditions:
140 
141  // Body:
142 
143  _row_dofs = xrow_dofs;
144 
145  // Postconditions:
146 
147  ensure(invariant());
148 
149  // Exit:
150 
151  return *this;
152 
153 }
154 
156 met_e2_lite(const matrix_type& xmatrix)
157 {
158  // Preconditions:
159 
160  // Body:
161 
162  *this = xmatrix;
163 
164  // Postconditions:
165 
166  ensure(invariant());
167 
168  // Exit:
169 }
170 
173 operator=(const matrix_type& xmatrix)
174 {
175  // Preconditions:
176 
177  // Body:
178 
179  //_row_dofs = xmatrix;
180  _row_dofs = reinterpret_cast<const row_dofs_type&>(xmatrix);
181 
182  // Postconditions:
183 
184  ensure(invariant());
185 
186  // Exit:
187 
188  return *this;
189 
190 }
191 
192 fiber_bundle::met_e2_lite::
194 {
195  // Preconditions:
196 
197  // Body:
198 
199  matrix_type& result = _row_dofs;
200 
201  // Postconditions:
202 
203  // Exit:
204 
205  return result;
206 }
207 
208 fiber_bundle::met_e2_lite::
209 operator const met_e2_lite::matrix_type& () const
210 {
211  // Preconditions:
212 
213  // Body:
214 
215  const matrix_type& result = _row_dofs;
216 
217  // Postconditions:
218 
219  // Exit:
220 
221  return result;
222 }
223 
224 fiber_bundle::met_e2_lite::
226 {
227  // Preconditions:
228 
229  // Body:
230 
231  row_dofs_type& result = _row_dofs;
232 
233  // Postconditions:
234 
235  // Exit:
236 
237  return result;
238 }
239 
240 fiber_bundle::met_e2_lite::
241 operator const met_e2_lite::row_dofs_type& () const
242 {
243  // Preconditions:
244 
245  // Body:
246 
247  const row_dofs_type& result = _row_dofs;
248 
249  // Postconditions:
250 
251  // Exit:
252 
253  return result;
254 }
255 
257 met_e2_lite(const value_type& xx, const value_type& xy, const value_type& yy)
258 {
259  // Preconditions:
260 
261  // Body:
262 
263  put_components(xx, xy, yy);
264 
265  // Postconditions:
266 
267  ensure(invariant());
268  ensure(isunordered_or_equals(component(0), xx));
269  ensure(isunordered_or_equals(component(1), xy));
270  ensure(isunordered_or_equals(component(2), yy));
271 
272  // Exit:
273 }
274 
275 void
277 put_components(const value_type& xx_comp,
278  const value_type& xy_comp,
279  const value_type& yy_comp)
280 {
281  // Preconditions:
282 
283  // Body:
284 
285  put_component(0, xx_comp);
286  put_component(1, xy_comp);
287  put_component(2, yy_comp);
288 
289  // Postconditions:
290 
291  ensure(invariant());
292  ensure(isunordered_or_equals(component(0), xx_comp));
293  ensure(isunordered_or_equals(component(1), xy_comp));
294  ensure(isunordered_or_equals(component(2), yy_comp));
295 
296  // Exit:
297 }
298 
299 //==============================================================================
300 // EUCLIDEAN METRIC (MET_ED) FACET OF CLASS MET_E2_LITE
301 //==============================================================================
302 
303 // PUBLIC MEMBER FUNCTIONS
304 
305 // PROTECTED MEMBER FUNCTIONS
306 
307 // PRIVATE MEMBER FUNCTIONS
308 
309 
310 //==============================================================================
311 // METRIC TENSOR (MET) FACET OF CLASS MET_E2_LITE
312 //==============================================================================
313 
314 // PUBLIC MEMBER FUNCTIONS
315 
316 // PROTECTED MEMBER FUNCTIONS
317 
318 // PRIVATE MEMBER FUNCTIONS
319 
320 
321 //==============================================================================
322 // ST2 FACET OF CLASS MET_E2_LITE
323 //==============================================================================
324 
325 // PUBLIC MEMBER FUNCTIONS
326 
327 // PROTECTED MEMBER FUNCTIONS
328 
329 // PRIVATE MEMBER FUNCTIONS
330 
331 
332 //==============================================================================
333 // INTERIOR ALGEBRA (STP) FACET OF CLASS MET_E2_LITE
334 //==============================================================================
335 
336 // PUBLIC MEMBER FUNCTIONS
337 
338 // PROTECTED MEMBER FUNCTIONS
339 
340 // PRIVATE MEMBER FUNCTIONS
341 
342 
343 //==============================================================================
344 // TENSOR ALGEBRA (TP) FACET OF CLASS MET_E2_LITE
345 //==============================================================================
346 
347 // PUBLIC MEMBER FUNCTIONS
348 
349 int
351 dd() const
352 {
353  // Preconditions:
354 
355  // Body:
356 
357  int result = 2;
358 
359  // Postconditions:
360 
361  ensure(invariant());
362  ensure(result == 2);
363 
364  // Exit:
365 
366  return result;
367 }
368 
369 // PROTECTED MEMBER FUNCTIONS
370 
371 // PRIVATE MEMBER FUNCTIONS
372 
373 
374 //==============================================================================
375 // VECTOR ALGEBRA (VD) FACET OF CLASS MET_E2_LITE
376 //==============================================================================
377 
378 // PUBLIC MEMBER FUNCTIONS
379 
382 tp_prototype(int xp) const
383 {
384  // Preconditions:
385 
386  require(precondition_of(e2_lite::static_tp_prototype(xp)));
387 
388  // Body:
389 
390  const tp_lite& result = e2_lite::static_tp_prototype(xp);
391 
392  // Postconditions:
393 
394  ensure(postcondition_of(e2_lite::static_tp_prototype(xp)));
395 
396  // Exit:
397 
398  return result;
399 }
400 
403 atp_prototype(int xp) const
404 {
405  // Preconditions:
406 
407  require(precondition_of(e2_lite::static_atp_prototype(xp)));
408 
409  // Body:
410 
411  const atp_lite& result = e2_lite::static_atp_prototype(xp);
412 
413  // Postconditions:
414 
415  ensure(postcondition_of(e2_lite::static_atp_prototype(xp)));
416 
417  // Exit:
418 
419  return result;
420 }
421 
424 stp_prototype(int xp) const
425 {
426  // Preconditions:
427 
428  require(precondition_of(e2_lite::static_stp_prototype(xp)));
429 
430  // Body:
431 
432  const stp_lite& result = e2_lite::static_stp_prototype(xp);
433 
434  // Postconditions:
435 
436  ensure(postcondition_of(e2_lite::static_stp_prototype(xp)));
437 
438  // Exit:
439 
440  return result;
441 }
442 
443 //==============================================================================
444 // CARTESIAN ALGEBRA (TUPLE) FACET OF CLASS MET_E2_LITE
445 //==============================================================================
446 
447 // PUBLIC MEMBER FUNCTIONS
448 
449 // PROTECTED MEMBER FUNCTIONS
450 
451 // PRIVATE MEMBER FUNCTIONS
452 
453 
454 //==============================================================================
455 // ABSTRACT POSET MEMBER FACET OF CLASS MET_E2_LITE
456 //==============================================================================
457 
458 // PUBLIC MEMBER FUNCTIONS
459 
460 const std::string&
462 class_name() const
463 {
464  // Preconditions:
465 
466  // Body:
467 
468  const string& result = static_class_name();
469 
470  // Postconditions:
471 
472  ensure(!result.empty());
473 
474  // Exit:
475 
476  return result;
477 }
478 
479 const std::string&
482 {
483  // Preconditions:
484 
485  // Body:
486 
487  static const string result("met_e2_lite");
488 
489  // Postconditions:
490 
491  ensure(!result.empty());
492 
493  // Exit:
494 
495  return result;
496 }
497 
500 clone() const
501 {
502  met_e2_lite* result = 0;
503 
504  // Preconditions:
505 
506  // Body:
507 
508  result = new met_e2_lite();
509 
510  // Postconditions:
511 
512  ensure(result != 0);
513  ensure(is_same_type(*result));
514 
515  // Exit:
516 
517  return result;
518 }
519 
520 // PROTECTED MEMBER FUNCTIONS
521 
522 // PRIVATE MEMBER FUNCTIONS
523 
524 
525 //==============================================================================
526 // ANY FACET OF CLASS MET_E2_LITE
527 //==============================================================================
528 
529 // PUBLIC MEMBER FUNCTIONS
530 
531 bool
533 is_ancestor_of(const any_lite& xother) const
534 {
535  // Preconditions:
536 
537  require(&xother != 0);
538 
539  // Body:
540 
541  // True if other conforms to this.
542 
543  bool result = dynamic_cast<const met_e2_lite*>(&xother) != 0;
544 
545  // Postconditions:
546 
547  return result;
548 }
549 
550 bool
552 invariant() const
553 {
554  bool result = true;
555 
556  if(invariant_check())
557  {
558  // Prevent recursive calls to invariant.
559 
560  disable_invariant_check();
561 
562  // Must satisfy base class invariant.
563 
564  invariance(met_ed_lite::invariant());
565 
566  // Invariances for this class:
567 
568  // Finished, turn invariant checking back on.
569 
570  enable_invariant_check();
571  }
572 
573  // Exit
574 
575  return result;
576 }
577 
578 void*
581 {
582  return &_row_dofs;
583 }
584 
585 const void*
587 row_dofs() const
588 {
589  return &_row_dofs;
590 }
591 
592 // PROTECTED MEMBER FUNCTIONS
593 
594 // PRIVATE MEMBER FUNCTIONS
595 
596 
597 //==============================================================================
598 // CLASS MET_E2
599 //==============================================================================
600 
601 // ===========================================================
602 // HOST FACTORY FACET OF CLASS MET_E2
603 // ===========================================================
604 
605 // PUBLIC MEMBER FUNCTIONS
606 
607 const sheaf::poset_path&
610 {
611  // Preconditions:
612 
613 
614  // Body:
615 
616  static const poset_path result(standard_schema_poset_name(), "met_e2_schema");
617 
618  // Postconditions:
619 
620  // Exit:
621 
622  return result;
623 }
624 
625 void
628 {
629  // Preconditions:
630 
631  require(xns.state_is_read_write_accessible());
632  require(xns.contains_poset(standard_schema_poset_name()));
633  require(!xns.contains_poset_member(standard_schema_path()));
634 
635  // Body:
636 
637  string lmember_names = "xx DOUBLE false ";
638  lmember_names += "xy DOUBLE false ";
639  lmember_names += "yy DOUBLE false";
640 
641  schema_poset_member lschema(xns,
642  standard_schema_path().member_name(),
643  met_ed::standard_schema_path(),
644  lmember_names,
645  false);
646 
647  lschema.detach_from_state();
648 
649  // Postconditions:
650 
651  ensure(xns.contains_poset_member(standard_schema_path()));
652 
653  // Exit:
654 
655  return;
656 }
657 
661  const poset_path& xhost_path,
662  const poset_path& xschema_path,
663  const poset_path& xvector_space_path,
664  bool xauto_access)
665 {
666  // cout << endl << "Entering met_e2::new_host." << endl;
667 
668  // Preconditions:
669 
670  require(xns.state_is_auto_read_write_accessible(xauto_access));
671 
672  require(!xhost_path.empty());
673  require(!xns.contains_path(xhost_path, xauto_access));
674 
675  require(xschema_path.full());
676  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
677  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
678  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 3);
679 
680  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
681  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
682  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
683  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 2);
684 
685  // Body:
686 
687  host_type& result =
688  host_type::new_table(xns, xhost_path, xschema_path, 2, xvector_space_path, xauto_access);
689 
690  // Postconditions:
691 
692  ensure(xns.owns(result, xauto_access));
693  ensure(result.path(true) == xhost_path);
694  ensure(result.state_is_not_read_accessible());
695  ensure(result.schema(true).path(xauto_access) == xschema_path);
696 
697  ensure(result.factor_ct(true) == 3);
698  ensure(result.d(true) == 3);
699  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
700  ensure(result.p(true) == 2);
701  ensure(result.dd(true) == 2);
702  ensure(result.vector_space_path(true) == xvector_space_path);
703 
704  // Exit:
705 
706  // cout << "Leaving met_e2::new_host." << endl;
707  return result;
708 }
709 
712 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
713 {
714  // cout << endl << "Entering met_e2::new_host." << endl;
715 
716  // Preconditions:
717 
718  require(xns.state_is_auto_read_write_accessible(xauto_access));
719 
720  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
721  require(standard_host_is_available<met_e2>(xns, xsuffix, xauto_access));
722 
723  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
724 
725  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
726 
727  // Body:
728 
729  // Create the vector space if necessary.
730 
731  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
732 
733  poset_path lpath(standard_host_path<met_e2>(xsuffix));
734 
735  host_type* result_ptr;
736  if(xns.contains_path(lpath, xauto_access))
737  {
738  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
739  }
740  else
741  {
742  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
743  }
744 
745  host_type& result = *result_ptr;
746 
747  // Postconditions:
748 
749  ensure(xns.owns(result, xauto_access));
750  ensure(result.path(true) == standard_host_path<met_e2>(xsuffix));
751  ensure(result.state_is_not_read_accessible());
752  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
753 
754  ensure(result.factor_ct(true) == 3);
755  ensure(result.d(true) == 3);
756  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
757  ensure(result.p(true) == 2);
758  ensure(result.dd(true) == 2);
759  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
760 
761  // Exit:
762 
763  // cout << "Leaving met_e2::new_host." << endl;
764  return result;
765 }
766 
767 // PROTECTED MEMBER FUNCTIONS
768 
769 // PRIVATE MEMBER FUNCTIONS
770 
771 
772 //==============================================================================
773 // MET_E2 FACET OF CLASS MET_E2
774 //==============================================================================
775 
776 // PUBLIC MEMBER FUNCTIONS
777 
780 {
781 
782  // Preconditions:
783 
784  // Body:
785 
786  // Postconditions:
787 
788  ensure(invariant());
789 }
790 
793 {
794  // Preconditions:
795 
796  require(xhost != 0);
797  require(xhost->state_is_read_accessible());
798  require(xhost->contains_member(xhub_id));
799 
800  // Body:
801 
802  attach_to_state(xhost, xhub_id);
803 
804  // Postconditions:
805 
806  ensure(invariant());
807  // ensure(host() == xhost);
808  ensure(index() == xhub_id);
809  ensure(is_attached());
810 
811 }
812 
814 met_e2(const poset_state_handle* xhost, const scoped_index& xid)
815 {
816  // Preconditions:
817 
818  require(xhost != 0);
819  require(xhost->state_is_read_accessible());
820  require(xhost->contains_member(xid));
821 
822  // Body:
823 
824  attach_to_state(xhost, xid.hub_pod());
825 
826  // Postconditions:
827 
828  ensure(invariant());
829  // ensure(host() == xhost);
830  ensure(index() ==~ xid);
831  ensure(is_attached());
832 }
833 
835 met_e2(const poset_state_handle* xhost, const std::string& xname)
836 {
837 
838  // Preconditions:
839 
840  require(xhost != 0);
841  require(xhost->state_is_read_accessible());
842  require(!xname.empty());
843  require(xhost->contains_member(xname));
844 
845  // Body:
846 
847  attach_to_state(xhost, xname);
848 
849  // Postconditions:
850 
851  ensure(invariant());
852  // ensure(host() == xhost);
853  ensure(name() == xname);
854  ensure(is_attached());
855 
856 }
857 
860 {
861 
862  // Preconditions:
863 
864  require(xother != 0);
865 
866  // Body:
867 
868  attach_to_state(xother);
869 
870  // Postconditions:
871 
872  ensure(invariant());
873  ensure(is_attached());
874  ensure(is_same_state(xother));
875 
876 }
877 
879 met_e2(poset_state_handle* xhost, bool xauto_access)
880 {
881 
882  // Preconditions:
883 
884  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
885 
886  // Body:
887 
888  new_jim_state(xhost, 0, false, xauto_access);
889 
890  // Postconditions:
891 
892  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
893 
894  // Exit:
895 
896  return;
897 }
898 
901  const row_dofs_type& xrdt,
902  bool xauto_access)
903 {
904 
905  // Preconditions:
906 
907  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
908 
909  // Body:
910 
911  new_jim_state(&xhost, 0, false, xauto_access);
912 
913  if(xauto_access)
914  {
915  xhost.get_read_write_access();
916  }
917 
918  *this = xrdt;
919 
920  if(xauto_access)
921  {
922  xhost.release_access();
923  }
924 
925  // Postconditions:
926 
927  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
928 
929  // Exit:
930 
931  return;
932 }
933 
937 {
938  // Preconditions:
939 
940  require(state_is_read_write_accessible());
941 
942  // Body:
943 
944  sheaf::row_dofs(*this) = xrdt;
945 
946  // Postconditions:
947 
948  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
949 
950  // Exit:
951 
952  return *this;
953 
954 }
955 
960 {
961  // Preconditions:
962 
963  require(is_ancestor_of(&xother));
964  require(precondition_of(attach_to_state(&xother)));
965 
966  // Body:
967 
968  attach_to_state(&xother);
969 
970  // Postconditions:
971 
972  ensure(postcondition_of(attach_to_state(&xother)));
973 
974  // Exit:
975 
976  return *this;
977 }
978 
982 operator=(const met_e2& xother)
983 {
984  // Preconditions:
985 
986  require(precondition_of(attach_to_state(&xother)));
987 
988  // Body:
989 
990  attach_to_state(&xother);
991 
992  // Postconditions:
993 
994  ensure(postcondition_of(attach_to_state(&xother)));
995 
996  // Exit:
997 
998  return *this;
999 }
1000 
1003 {
1004 
1005  // Preconditions:
1006 
1007  // Body:
1008 
1009  // Postconditions:
1010 
1011  // Exit:
1012 
1013 }
1014 
1018 {
1019  // Preconditions:
1020 
1021  // Body:
1022 
1023  static const volatile_type result;
1024 
1025  // Postconditions:
1026 
1027  // Exit:
1028 
1029  return result;
1030 }
1031 
1035 lite_type() const
1036 {
1037  // Preconditions:
1038 
1039  // Body:
1040 
1041  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
1042 
1043  // Postconditions:
1044 
1045  // Exit:
1046 
1047  return result;
1048 }
1049 
1050 
1051 fiber_bundle::met_e2::
1053 {
1054  // Preconditions:
1055 
1056  require(state_is_read_write_accessible());
1057 
1058  // Body:
1059 
1060  row_dofs_type& result = sheaf::row_dofs(*this);
1061 
1062  // Postconditions:
1063 
1064  // Exit:
1065 
1066  return result;
1067 }
1068 
1069 fiber_bundle::met_e2::
1070 operator const met_e2::row_dofs_type& () const
1071 {
1072  // Preconditions:
1073 
1074  require(state_is_read_accessible());
1075 
1076  // Body:
1077 
1078  const row_dofs_type& result = sheaf::row_dofs(*this);
1079 
1080  // Postconditions:
1081 
1082  // Exit:
1083 
1084  return result;
1085 }
1086 
1087 // PROTECTED MEMBER FUNCTIONS
1088 
1089 // PRIVATE MEMBER FUNCTIONS
1090 
1091 
1092 //==============================================================================
1093 // MET_ED FACET OF CLASS MET_E2
1094 //==============================================================================
1095 
1096 // PUBLIC MEMBER FUNCTIONS
1097 
1098 // PROTECTED MEMBER FUNCTIONS
1099 
1100 // PRIVATE MEMBER FUNCTIONS
1101 
1102 
1103 //==============================================================================
1104 // MET FACET OF CLASS MET_E2
1105 //==============================================================================
1106 
1107 // PUBLIC MEMBER FUNCTIONS
1108 
1109 // PROTECTED MEMBER FUNCTIONS
1110 
1111 // PRIVATE MEMBER FUNCTIONS
1112 
1113 
1114 //==============================================================================
1115 // ST2 FACET OF CLASS MET_E2
1116 //==============================================================================
1117 
1118 // PUBLIC MEMBER FUNCTIONS
1119 
1120 // PROTECTED MEMBER FUNCTIONS
1121 
1122 // PRIVATE MEMBER FUNCTIONS
1123 
1124 
1125 //==============================================================================
1126 // STP FACET OF CLASS MET_E2
1127 //==============================================================================
1128 
1129 // PUBLIC MEMBER FUNCTIONS
1130 
1131 // PROTECTED MEMBER FUNCTIONS
1132 
1133 // PRIVATE MEMBER FUNCTIONS
1134 
1135 
1136 //==============================================================================
1137 // TP FACET OF CLASS MET_E2
1138 //==============================================================================
1139 
1140 // PUBLIC MEMBER FUNCTIONS
1141 
1142 // PROTECTED MEMBER FUNCTIONS
1143 
1144 // PRIVATE MEMBER FUNCTIONS
1145 
1146 
1147 //==============================================================================
1148 // VD FACET OF CLASS MET_E2
1149 //==============================================================================
1150 
1151 // PUBLIC MEMBER FUNCTIONS
1152 
1153 // PROTECTED MEMBER FUNCTIONS
1154 
1155 // PRIVATE MEMBER FUNCTIONS
1156 
1157 
1158 //==============================================================================
1159 // TUPLE FACET OF CLASS MET_E2
1160 //==============================================================================
1161 
1162 // PUBLIC MEMBER FUNCTIONS
1163 
1166 new_tp(int xp, bool xauto_access) const
1167 {
1168  // Preconditions:
1169 
1170  require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1171 
1172  // Body:
1173 
1174  tp* result = e2::new_tp(vector_space(xauto_access), xp);
1175 
1176  // Postconditions:
1177 
1178  ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1179 
1180  // Exit:
1181 
1182  return result;
1183 }
1184 
1187 new_atp(int xp, bool xauto_access) const
1188 {
1189  // Preconditions:
1190 
1191  require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1192 
1193  // Body:
1194 
1195  atp* result = e2::new_atp(vector_space(xauto_access), xp);
1196 
1197  // Postconditions:
1198 
1199  ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1200 
1201  // Exit:
1202 
1203  return result;
1204 }
1205 
1208 new_stp(int xp, bool xauto_access) const
1209 {
1210  // Preconditions:
1211 
1212  require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1213 
1214  // Body:
1215 
1216  stp* result = e2::new_stp(vector_space(xauto_access), xp);
1217 
1218  // Postconditions:
1219 
1220  ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1221 
1222  // Exit:
1223 
1224  return result;
1225 }
1226 
1227 // PROTECTED MEMBER FUNCTIONS
1228 
1229 // PRIVATE MEMBER FUNCTIONS
1230 
1231 
1232 //==============================================================================
1233 // ABSTRACT POSET MEMBER FACET OF CLASS MET_E2
1234 //==============================================================================
1235 
1236 // PUBLIC MEMBER FUNCTIONS
1237 
1238 const std::string&
1240 class_name() const
1241 {
1242  // Preconditions:
1243 
1244  // Body:
1245 
1246  const string& result = static_class_name();
1247 
1248  // Postconditions:
1249 
1250  ensure(!result.empty());
1251 
1252  // Exit:
1253 
1254  return result;
1255 }
1256 
1257 const std::string&
1260 {
1261  // Preconditions:
1262 
1263  // Body:
1264 
1265  static const string result("met_e2");
1266 
1267  // Postconditions:
1268 
1269  ensure(!result.empty());
1270 
1271  // Exit:
1272 
1273  return result;
1274 }
1275 
1278 clone() const
1279 {
1280 
1281  // Preconditions:
1282 
1283  // Body:
1284 
1285  // create new handle of the current class.
1286 
1287  met_e2 *result = new met_e2();
1288 
1289  // Postconditions:
1290 
1291  ensure(result != 0);
1292  ensure(result->invariant());
1293 
1294  // Exit:
1295 
1296  return result;
1297 
1298 }
1299 
1300 // PROTECTED MEMBER FUNCTIONS
1301 
1302 // PRIVATE MEMBER FUNCTIONS
1303 
1304 
1305 //==============================================================================
1306 // ANY FACET OF CLASS MET_E2
1307 //==============================================================================
1308 
1309 // PUBLIC MEMBER FUNCTIONS
1310 
1311 bool
1313 is_ancestor_of(const any* xother) const
1314 {
1315 
1316  // Preconditions:
1317 
1318  require(xother != 0);
1319 
1320  // Body:
1321 
1322  // If xother may be dynamically cast to the type of this then this is an
1323  // ancestor of other.
1324 
1325  bool result = dynamic_cast<const met_e2*>(xother) != 0;
1326 
1327  // Postconditions:
1328 
1329  // ensure(invariant());
1330 
1331  // Exit:
1332 
1333  return result;
1334 
1335 }
1336 
1337 bool
1339 invariant() const
1340 {
1341  bool result = true;
1342 
1343  // Preconditions:
1344 
1345  // Body:
1346 
1347  // Must satisfy base class invariant
1348 
1349  invariance(met_ed::invariant());
1350 
1351  if (invariant_check())
1352  {
1353  // Prevent recursive calls to invariant
1354 
1355  disable_invariant_check();
1356 
1357  // Invariants for this class:
1358 
1359  invariance(is_attached() ? (d() == 3) : true);
1360 
1361  // Finished, turn invariant checking back on.
1362 
1363  enable_invariant_check();
1364  }
1365 
1366  // Postconditions:
1367 
1368  ensure(is_derived_query);
1369 
1370  // Exit:
1371 
1372  return result;
1373 }
1374 
1375 // PROTECTED MEMBER FUNCTIONS
1376 
1377 // PRIVATE MEMBER FUNCTIONS
1378 
1379 
1380 //==============================================================================
1381 // NON-MEMBER FUNCTIONS
1382 //==============================================================================
1383 
1384 //==============================================================================
1385 // MET FACET
1386 //==============================================================================
1387 
1388 // PUBLIC MEMBER FUNCTIONS
1389 
1391 void
1393 raise(const met_e2_lite& xmetric, const e2_lite& xcovector, e2_lite& xresult)
1394 {
1395  // Preconditions:
1396 
1397  require(unexecutable("xmetric.is_contravariant())"));
1398  require(unexecutable("xcovector.is_covariant())")); // is_dual;
1399  require(unexecutable("xresult.is_contravariant())")); // !is_dual
1400 
1401  // Body:
1402 
1403  // Left matrix multiply xcovector with xmetric.
1404 
1405  //
1406  // This class is a 2x2 matrix and we may therefore make optimizations
1407  // in light of this fact.
1408 
1409  typedef met_e2_lite::value_type value_type;
1410 
1411  value_type m00 = xmetric.component(0);
1412  value_type m01 = xmetric.component(1);
1413 
1414  value_type m10 = xmetric.component(1);
1415  value_type m11 = xmetric.component(2);
1416 
1417  value_type comp0 = xcovector.component(0);
1418  value_type comp1 = xcovector.component(1);
1419 
1420  value_type result_comp;
1421 
1422  result_comp = m00*comp0 + m01*comp1;
1423  xresult.put_component(0, result_comp);
1424 
1425  result_comp = m10*comp0 + m11*comp1;
1426  xresult.put_component(1, result_comp);
1427 
1428  // Postconditions:
1429 
1430  //ensure(unexecutable(""));
1431 
1432  // Exit:
1433 
1434 }
1435 
1439 raise(const met_e2_lite& xmetric, const e2_lite& xcovector)
1440 {
1441  // Preconditions:
1442 
1443  require(precondition_of(raise(xmetric, xcovector, *result)));
1444 
1445  // Body:
1446 
1447  e2_lite* result = new e2_lite();
1448 
1449  raise(xmetric, xcovector, *result);
1450 
1451  // Postconditions:
1452 
1453  ensure(result != 0);
1454  ensure(postcondition_of(raise(xmetric, xcovector, *result)));
1455 
1456  // Exit:
1457 
1458  return result;
1459 }
1460 
1462 void
1464 lower(const met_e2_lite& xmetric, const e2_lite& xvector, e2_lite& xresult)
1465 {
1466  // Preconditions:
1467 
1468  require(unexecutable("xmetric.is_covariant())"));
1469  require(unexecutable("xcovector.is_contravariant())")); // !is_dual
1470  require(unexecutable("xresult.is_covariant())")); // is_dual
1471 
1472  // Body:
1473 
1474  // Right matrix multiply xvector with xmetric.
1475 
1476  //
1477  // This class is a 2x2 matrix and we may therefore make optimizations
1478  // in light of this fact.
1479 
1480  typedef met_e2_lite::value_type value_type;
1481 
1482  value_type m00 = xmetric.component(0);
1483  value_type m01 = xmetric.component(1);
1484 
1485  value_type m10 = xmetric.component(1);
1486  value_type m11 = xmetric.component(2);
1487 
1488  value_type comp0 = xvector.component(0);
1489  value_type comp1 = xvector.component(1);
1490 
1491  value_type result_comp;
1492 
1493  result_comp = m00*comp0 + m10*comp1;
1494  xresult.put_component(0, result_comp);
1495 
1496  result_comp = m01*comp0 + m11*comp1;
1497  xresult.put_component(1, result_comp);
1498 
1499  // Postconditions:
1500 
1501  //ensure(unexecutable(""));
1502 
1503  // Exit:
1504 
1505 }
1506 
1510 lower(const met_e2_lite& xmetric, const e2_lite& xvector)
1511 {
1512  // Preconditions:
1513 
1514  require(precondition_of(lower(xmetric, xvector, *result)));
1515 
1516  // Body:
1517 
1518  e2_lite* result = new e2_lite();
1519 
1520  lower(xmetric, xvector, *result);
1521 
1522  // Postconditions:
1523 
1524  ensure(result != 0);
1525  ensure(postcondition_of(lower(xmetric, xvector, *result)));
1526 
1527  // Exit:
1528 
1529  return result;
1530 }
1531 
1533 void
1535 raise(const met_e2& xmetric, const e2& xcovector, e2& xresult,
1536  bool xauto_access)
1537 {
1538  // Preconditions:
1539 
1540  require(xmetric.state_is_auto_read_accessible(xauto_access));
1541  require(xcovector.state_is_auto_read_accessible(xauto_access));
1542  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1543  require(xcovector.d(xauto_access) == xmetric.dd(xauto_access));
1544  require(xresult.d(xauto_access) == xmetric.dd(xauto_access));
1545  require(xmetric.is_contravariant(0, xauto_access));
1546  require(xcovector.is_covariant(0, xauto_access)); // is_dual;
1547 
1548 
1549  // Body:
1550 
1551  if(xauto_access)
1552  {
1553  xmetric.get_read_access();
1554  xcovector.get_read_access();
1555  xresult.get_read_write_access(true);
1556  }
1557 
1558  // Left matrix multiply xcovector with xmetric.
1559 
1560  //
1561  // This class is a 2x2 matrix and we may therefore make optimizations
1562  // in light of this fact.
1563 
1564  typedef met_e2::value_type value_type;
1565 
1566  value_type m00 = xmetric.component(0);
1567  value_type m01 = xmetric.component(1);
1568 
1569  value_type m10 = xmetric.component(1);
1570  value_type m11 = xmetric.component(2);
1571 
1572  value_type comp0 = xcovector.component(0);
1573  value_type comp1 = xcovector.component(1);
1574 
1575  value_type result_comp;
1576 
1577  result_comp = m00*comp0 + m01*comp1;
1578  xresult.put_component(0, result_comp);
1579 
1580  result_comp = m10*comp0 + m11*comp1;
1581  xresult.put_component(1, result_comp);
1582 
1583 
1584  // Make sure the result is contravariant/p_vector.
1585 
1586  if(!xresult.is_p_vector(false))
1587  {
1588  xresult.put_is_p_vector(false);
1589  }
1590 
1591 
1592  if(xauto_access)
1593  {
1594  xmetric.release_access();
1595  xcovector.release_access();
1596  xresult.release_access();
1597  }
1598 
1599  // Postconditions:
1600 
1601  ensure(xresult.is_contravariant(0, xauto_access)); // !is_dual
1602 
1603  // Exit:
1604 
1605 }
1606 
1608 void
1610 lower(const met_e2& xmetric, const e2& xvector, e2& xresult, bool xauto_access)
1611 {
1612  // Preconditions:
1613 
1614  require(xmetric.state_is_auto_read_accessible(xauto_access));
1615  require(xvector.state_is_auto_read_accessible(xauto_access));
1616  require(xresult.state_is_auto_read_write_accessible(xauto_access));
1617  require(xvector.d(xauto_access) == xmetric.dd(xauto_access));
1618  require(xresult.d(xauto_access) == xmetric.dd(xauto_access));
1619  require(xmetric.is_covariant(0, xauto_access));
1620  require(xvector.is_contravariant(0, xauto_access)); // !is_dual;
1621 
1622  // Body:
1623 
1624  if(xauto_access)
1625  {
1626  xmetric.get_read_access();
1627  xvector.get_read_access();
1628  xresult.get_read_write_access(true);
1629  }
1630 
1631  // Right matrix multiply xvector with xmetric.
1632 
1633  //
1634  // This class is a 2x2 matrix and we may therefore make optimizations
1635  // in light of this fact.
1636 
1637  typedef met_e2::value_type value_type;
1638 
1639  value_type m00 = xmetric.component(0);
1640  value_type m01 = xmetric.component(1);
1641 
1642  value_type m10 = m01;
1643  value_type m11 = xmetric.component(2);
1644 
1645  value_type comp0 = xvector.component(0);
1646  value_type comp1 = xvector.component(1);
1647 
1648  value_type result_comp;
1649 
1650  result_comp = m00*comp0 + m10*comp1;
1651  xresult.put_component(0, result_comp);
1652 
1653  result_comp = m01*comp0 + m11*comp1;
1654  xresult.put_component(1, result_comp);
1655 
1656 
1657  // Make sure the result is covariant/p_form.
1658 
1659  if(!xresult.is_p_form(false))
1660  {
1661  xresult.put_is_p_form(false);
1662  }
1663 
1664 
1665  if(xauto_access)
1666  {
1667  xmetric.release_access();
1668  xvector.release_access();
1669  xresult.release_access();
1670  }
1671 
1672  // Postconditions:
1673 
1674  ensure(xresult.is_covariant(0, xauto_access)); // is_dual
1675 
1676  // Exit:
1677 
1678 }
1679 
1680 
1681 //==============================================================================
1682 // TEMPLATE SPECIALIZATIONS
1683 //==============================================================================
1684 
SHEAF_DLL_SPEC void lower(const met &xmetric, const ed &xvector, ed &xresult, bool xauto_access)
Lower vector (pre-allocated version for persistent type).
Definition: met.cc:943
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
virtual met_e2 * clone() const
Make a new handle, no state instance of current.
Definition: met_e2.cc:1278
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
Definition: tp.cc:1160
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 ...
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: met_e2.cc:382
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
virtual int dd() const
Dimension of the underlying vector space.
Definition: tp.cc:788
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: met_e2.cc:1017
bool invariant() const
Class invariant.
Definition: met_e2.cc:1339
An antisymmetric tensor of degree p.
Definition: atp.h:190
void put_is_p_vector(bool xauto_access)
Sets is_p_vector to true; synonym for put_is_contravariant(xauto_access).
Definition: atp.cc:743
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
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
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xvector_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: met_e2.cc:660
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
poset_path path(bool xauto_access=true) const
A path to this component.
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
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...
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...
A client handle for a general, abstract partially order set.
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.
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
met_e2_lite & operator=(const met_e2_lite &xother)
Assignment operator.
Definition: met_e2.cc:84
virtual value_type component(int xrow, int xcolumn) const
The value of the component in a specified row and column.
Definition: st2.cc:145
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<met_e2>(xsuffix). Returns the host if it already exists...
Definition: met_e2.cc:712
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.
A metric tensor over an abstract vector space (volatile version).
Definition: met.h:43
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: met_e2.cc:1208
virtual bool is_covariant(bool xauto_access) const
True if and only if all tensor index positions are covariant.
Definition: tp.cc:1078
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
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: stp_space.cc:86
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Definition: met_e2.cc:580
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...
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
met_e2 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: met_e2.cc:936
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: met_e2.cc:1166
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
A metric tensor over a 2 dimensional Euclidean vector space (persistent version). ...
Definition: met_e2.h:448
row_dofs_type _row_dofs
Row_dofs_type.
Definition: met_e2.h:253
met_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: met_e2.h:166
virtual const std::string & class_name() const
The name of this class.
Definition: met_e2.cc:462
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: met_e2.cc:403
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
~met_e2()
Destructor.
Definition: met_e2.cc:1002
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...
met_e2()
Default constructor.
Definition: met_e2.cc:779
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)
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool invariant() const
Class invariant.
Definition: met_e2.cc:552
T components[3]
The xx, xy and yy dofs.
Definition: met_e2.h:125
met_e2_lite()
Default constructor.
Definition: met_e2.cc:53
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 is_p_form(bool xauto_access) const
True if this is a p-form; synonym for is_covariant(xauto_access).
Definition: atp.cc:677
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
virtual met_e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: met_e2.cc:500
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
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...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
bool path_is_auto_read_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and is auto read accessible.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Definition: vd_space.cc:250
static const std::string & static_class_name()
The name of this class.
Definition: met_e2.cc:481
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: met_e2.cc:1035
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: met_e2.cc:424
static const std::string & static_class_name()
The name of this class.
Definition: met_e2.cc:1259
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
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: met_e2.cc:533
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: met_e2.cc:627
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
bool is_p_vector(bool xauto_access) const
True if this is a p-vector; synonym for is_contravariant(xauto_access).
Definition: atp.cc:722
virtual int d() const
Dimension of this as a vector space.
Definition: vd.cc:1017
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: met_e2.cc:609
An abstract client handle for a member of a poset.
virtual void put_components(const value_type &xx_comp, const value_type &xy_comp, const value_type &yy_comp)
Set values of the components to the given arguments.
Definition: met_e2.cc:277
virtual ~met_e2_lite()
Destructor.
Definition: met_e2.cc:108
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
virtual atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: met_e2.cc:1187
A metric tensor over a 2 dimensional Euclidean vector space (volatile version).
Definition: met_e2.h:142
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
void put_is_p_form(bool xauto_access)
Sets is_p_form to true; synonym for put_is_covariant(xauto_access).
Definition: atp.cc:699
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
value_type component(int xrow, int xcolumn) const
The component with row index xrow and column index xcolumn.
Definition: st2.cc:751
bool is_ancestor_of(const any *xother) const
True if other conforms to current.
Definition: met_e2.cc:1313
SHEAF_DLL_SPEC void raise(const met &xmetric, const ed &xcovector, ed &xresult, bool xauto_access)
Raise covector (pre-allocated version for persistent type).
Definition: met.cc:886
virtual const std::string & class_name() const
The name of this class.
Definition: met_e2.cc:1240
virtual int dd() const
Dimension of the underlying vector space.
Definition: met_e2.cc:351
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