SheafSystem  0.0.0.0
sec_t2.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #include "SheafSystem/sec_t2.h"
22 
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/binary_section_space_schema_member.impl.h"
25 #include "SheafSystem/binary_section_space_schema_poset.h"
26 #include "SheafSystem/fiber_bundles_namespace.h"
27 #include "SheafSystem/sec_at0.h"
28 #include "SheafSystem/sec_at0_space.h"
29 #include "SheafSystem/sec_tuple_space.impl.h"
30 #include "SheafSystem/section_space_schema_member.impl.h"
31 #include "SheafSystem/section_space_schema_poset.h"
32 #include "SheafSystem/tp.h"
33 #include "SheafSystem/tp_space.h"
34 
35 using namespace std;
36 using namespace fiber_bundle; // Workaround for MS C++ bug.
37 
38 //==============================================================================
39 // CLASS SEC_T2
40 //==============================================================================
41 
42 // ===========================================================
43 // HOST FACTORY FACET OF CLASS SEC_T2
44 // ===========================================================
45 
46 // PUBLIC MEMBER FUNCTIONS
47 
51  const poset_path& xhost_path,
52  const poset_path& xschema_path,
53  const poset_path& xscalar_space_path,
54  bool xauto_access)
55 {
56  // cout << endl << "Entering sec_t2::new_host." << endl;
57 
58  // Preconditions:
59 
60  require(xns.state_is_auto_read_write_accessible(xauto_access));
61 
62  require(!xhost_path.empty());
63  require(!xns.contains_path(xhost_path, xauto_access));
64 
65  require(xschema_path.full());
66  require(xns.path_is_auto_read_accessible<schema_type::host_type>(xschema_path, xauto_access));
67  require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
68 
69  require(xns.path_is_auto_read_accessible<scalar_type::host_type>(xscalar_space_path, xauto_access));
70 
71  require(host_type::same_scalar_fiber_space(xns, xschema_path, xscalar_space_path, xauto_access));
72 
73  // Body:
74 
75  host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xscalar_space_path, xauto_access);
76 
77  // Postconditions:
78 
79  ensure(xns.owns(result, xauto_access));
80  ensure(result.path(true) == xhost_path);
81  ensure(result.state_is_not_read_accessible());
82  ensure(result.schema(true).path(xauto_access) == xschema_path);
83 
84  ensure(result.factor_ct(true) == result.schema(true).fiber_space<fiber_type::host_type>().factor_ct(xauto_access));
85  ensure(result.d(true) == result.schema(true).fiber_space<fiber_type::host_type>().d(xauto_access));
86  ensure(result.d(true) == result.dd(true));
87  ensure(result.scalar_space_path(true) == xscalar_space_path);
88  ensure(result.p(true) == result.schema(true).fiber_space<fiber_type::host_type>().p(xauto_access));
89  ensure(result.p(true) == 2);
90  ensure(result.dd(true) == result.schema(true).fiber_space<fiber_type::host_type>().dd(xauto_access));
91  ensure(result.vector_space_path(true) == xhost_path);
92 
93  // Exit:
94 
95  // cout << "Leaving sec_t2::new_host." << endl;
96  return result;
97 }
98 
99 // PROTECTED MEMBER FUNCTIONS
100 
101 // PRIVATE MEMBER FUNCTIONS
102 
103 
104 //==============================================================================
105 // T2 FACET OF CLASS SEC_T2
106 //==============================================================================
107 
108 // PUBLIC MEMBER FUNCTIONS
109 
112 {
113 
114  // Preconditions:
115 
116  // Body:
117 
118  // Postconditions:
119 
120  ensure(invariant());
121 }
122 
124 sec_t2(const sec_rep_space* xhost, pod_index_type xhub_id)
125 {
126  // Preconditions:
127 
128  require(xhost != 0);
129  require(xhost->state_is_read_accessible());
130  require(xhost->contains_member(xhub_id));
131 
132  // Body:
133 
134  attach_to_state(xhost, xhub_id);
135 
136  // Postconditions:
137 
138  ensure(invariant());
139  //ensure(host() == xhost);
140  ensure(index() == xhub_id);
141  ensure(is_attached());
142  ensure(!is_restricted());
143 }
144 
146 sec_t2(const sec_rep_space* xhost, const scoped_index& xid)
147 {
148  // Preconditions:
149 
150  require(xhost != 0);
151  require(xhost->state_is_read_accessible());
152  require(xhost->contains_member(xid));
153 
154  // Body:
155 
156  attach_to_state(xhost, xid.hub_pod());
157 
158  // Postconditions:
159 
160  ensure(invariant());
161  //ensure(host() == xhost);
162  ensure(index() ==~ xid);
163  ensure(is_attached());
164  ensure(!is_restricted());
165 }
166 
168 sec_t2(const sec_rep_space* xhost, const std::string& xname)
169 {
170 
171  // Preconditions:
172 
173  require(xhost != 0);
174  require(xhost->state_is_read_accessible());
175  require(!xname.empty());
176  require(xhost->contains_member(xname));
177 
178  // Body:
179 
180  attach_to_state(xhost, xname);
181 
182  // Postconditions:
183 
184  ensure(invariant());
185  //ensure(host() == xhost);
186  ensure(name() == xname);
187  ensure(is_attached());
188  ensure(!is_restricted());
189 
190 }
191 
192 
194 sec_t2(const namespace_poset* xnamespace,
195  const poset_path& xpath,
196  bool xauto_access)
197 {
198 
199  // Preconditions:
200 
201  require(precondition_of(attach_to_state(same args)));
202 
203  // Body:
204 
205  attach_to_state(xnamespace, xpath, xauto_access);
206 
207  // Postconditions:
208 
209  ensure(postcondition_of(attach_to_state(same args)));
210 
211  // Exit:
212 
213  return;
214 }
215 
216 
219 {
220 
221  // Preconditions:
222 
223  require(xother != 0);
224 
225  // Body:
226 
227  attach_to_state(xother);
228 
229  // Postconditions:
230 
231  ensure(invariant());
232  ensure(is_attached());
233  ensure(is_same_state(xother));
234  ensure(is_same_restriction(xother));
235 
236 }
237 
239 sec_t2(sec_rep_space* xhost, section_dof_map* xdof_map, bool xauto_access)
240 {
241 
242  // Preconditions:
243 
244  require(precondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
245 
246  // Body:
247 
248  new_jim_state(xhost, xdof_map, false, xauto_access);
249 
250  // Postconditions:
251 
252  ensure(postcondition_of(new_jim_state(xhost, xdof_map, false, xauto_access)));
253 
254  // Exit:
255 
256  return;
257 }
258 
261  abstract_poset_member& xbase_mbr,
262  int xbase_version, bool xauto_access)
263 {
264 
265  // Preconditions:
266 
267  require(precondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
268 
269  // Body:
270 
271  new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
272 
273  // Postconditions:
274 
275  ensure(postcondition_of(new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
276 
277  // Exit:
278 
279  return;
280 }
281 
285 {
286  // Preconditions:
287 
288  require(is_ancestor_of(&xother));
289  require(precondition_of(attach_to_state(&xother)));
290 
291  // Body:
292 
293  attach_to_state(&xother);
294 
295  // Postconditions:
296 
297  ensure(postcondition_of(attach_to_state(&xother)));
298 
299  // Exit:
300 
301  return *this;
302 }
303 
306 operator=(const sec_t2& xother)
307 {
308  // Preconditions:
309 
310  require(precondition_of(attach_to_state(&xother)));
311 
312  // Body:
313 
314  attach_to_state(&xother);
315 
316  // Postconditions:
317 
318  ensure(postcondition_of(attach_to_state(&xother)));
319 
320  // Exit:
321 
322  return *this;
323 }
324 
327 operator=(const t2& xfiber)
328 {
329  // Preconditions:
330 
331  require(precondition_of(sec_vd::operator=(xfiber)));
332 
333  // Body:
334 
335  sec_vd::operator=(xfiber);
336 
337  // Postconditions:
338 
339  ensure(postcondition_of(sec_vd::operator=(xfiber)));
340 
341  // Exit:
342 
343  return *this;
344 }
345 
348 operator=(const t2_lite& xfiber)
349 {
350  // Preconditions:
351 
352  require(precondition_of(sec_vd::operator=(xfiber)));
353 
354  // Body:
355 
356  sec_vd::operator=(xfiber);
357 
358  // Postconditions:
359 
360  ensure(postcondition_of(sec_vd::operator=(xfiber)));
361 
362  // Exit:
363 
364  return *this;
365 }
366 
369 {
370 
371  // Preconditions:
372 
373  // Body:
374 
375  // Postconditions:
376 
377 }
378 
382 {
383  // Preconditions:
384 
385  // Body:
386 
387  static const fiber_type result;
388 
389  // Postconditions:
390 
391  // Exit:
392 
393  return result;
394 }
395 
396 // PROTECTED MEMBER FUNCTIONS
397 
398 // PRIVATE MEMBER FUNCTIONS
399 
400 
401 //==============================================================================
402 // TP FACET OF CLASS SEC_T2
403 //==============================================================================
404 
405 // PUBLIC MEMBER FUNCTIONS
406 
407 // PROTECTED MEMBER FUNCTIONS
408 
409 // PRIVATE MEMBER FUNCTIONS
410 
411 
412 //==============================================================================
413 // VD FACET OF CLASS SEC_T2
414 //==============================================================================
415 
416 // PUBLIC MEMBER FUNCTIONS
417 
418 // PROTECTED MEMBER FUNCTIONS
419 
420 // PRIVATE MEMBER FUNCTIONS
421 
422 
423 //==============================================================================
424 // TUPLE FACET OF CLASS SEC_T2
425 //==============================================================================
426 
427 // PUBLIC MEMBER FUNCTIONS
428 
429 // PROTECTED MEMBER FUNCTIONS
430 
431 // PRIVATE MEMBER FUNCTIONS
432 
433 
434 //==============================================================================
435 // ABSTRACT POSET MEMBER FACET OF CLASS SEC_T2
436 //==============================================================================
437 
438 // PUBLIC MEMBER FUNCTIONS
439 
440 const std::string&
442 class_name() const
443 {
444  // Preconditions:
445 
446  // Body:
447 
448  const string& result = static_class_name();
449 
450  // Postconditions:
451 
452  ensure(!result.empty());
453 
454  // Exit:
455 
456  return result;
457 }
458 
459 const std::string&
462 {
463  // Preconditions:
464 
465  // Body:
466 
467  static const string result("sec_t2");
468 
469  // Postconditions:
470 
471  ensure(!result.empty());
472 
473  // Exit:
474 
475  return result;
476 }
477 
480 clone() const
481 {
482 
483  // Preconditions:
484 
485  // Body:
486 
487  // create new handle of the current class.
488 
489  sec_t2 *result = new sec_t2();
490 
491  // Postconditions:
492 
493  ensure(result != 0);
494  ensure(result->invariant());
495 
496  // Exit:
497 
498  return result;
499 
500 }
501 
502 // PROTECTED MEMBER FUNCTIONS
503 
504 // PRIVATE MEMBER FUNCTIONS
505 
506 
507 //==============================================================================
508 // ANY FACET OF CLASS SEC_T2
509 //==============================================================================
510 
511 // PUBLIC MEMBER FUNCTIONS
512 
513 bool
515 fiber_is_ancestor_of(const any* xother) const
516 {
517 
518  // Preconditions:
519 
520  require(xother != 0);
521 
522  // Body:
523 
524  // If xother may be dynamically cast to the type of this fiber then this
525  // fiber is an ancestor of xother.
526 
527  bool result = dynamic_cast<const t2*>(xother) != 0;
528 
529  // Postconditions:
530 
531  ensure(invariant());
532  ensure(xother->invariant());
533 
534  // Exit:
535 
536  return result;
537 
538 }
539 
540 bool
542 is_ancestor_of(const any* xother) const
543 {
544  // Preconditions:
545 
546  require(xother != 0);
547 
548  // Body:
549 
550  // If other may be dynamically cast to the type of this then this is an
551  // ancestor of other.
552 
553  bool result = dynamic_cast<const sec_t2*>(xother) != 0;
554 
555  // Postconditions:
556 
557  //ensure(invariant());
558 
559  // Exit:
560 
561  return result;
562 
563 }
564 
565 bool
567 invariant() const
568 {
569  bool result = true;
570 
571  // Preconditions:
572 
573  // Body:
574 
575  // Must satisfy base class invariant
576 
577  invariance(sec_tp::invariant());
578 
579  if (invariant_check())
580  {
581  // Prevent recursive calls to invariant
582 
583  disable_invariant_check();
584 
585  invariance(is_attached() ? p() == 2 : true);
586 
587  // Finished, turn invariant checking back on.
588 
589  enable_invariant_check();
590  }
591 
592  // Postconditions:
593 
594  ensure(is_derived_query);
595 
596  // Exit:
597 
598  return result;
599 }
600 
601 // PROTECTED MEMBER FUNCTIONS
602 
603 // PRIVATE MEMBER FUNCTIONS
604 
605 //==============================================================================
606 // NON-MEMBER FUNCTIONS
607 //==============================================================================
608 
609 namespace
610 {
611  using namespace fiber_bundle::tp_algebra;
612 
613  class alt_functor
614  {
615  public:
616  void operator()(const t2_lite& x0, at2_lite& xresult) const
617  {
618  alt(x0, xresult);
619  }
620 
621  void operator()(const t2_lite& x0, t2_lite& xresult) const
622  {
623  alt(x0, xresult);
624  }
625  };
626 
627  class sym_functor
628  {
629  public:
630  void operator()(const t2_lite& x0, st2_lite& xresult) const
631  {
632  sym(x0, xresult);
633  }
634 
635  void operator()(const t2_lite& x0, t2_lite& xresult) const
636  {
637  sym(x0, xresult);
638  }
639  };
640 
641  class contract_functor
642  {
643  public:
644  contract_functor(int xp, int xq) : _p(xp), _q(xq) {}
645  void operator()(const t2_lite& x0, at0_lite& xresult) const
646  {
647  contract(x0, _p, _q, xresult);
648  }
649  private:
650  int _p;
651  int _q;
652  };
653 
654  class tensor_functor
655  {
656  public:
657  void operator()(const at1_lite& xl0, const at1_lite& xl1,
658  t2_lite& xlresult) const
659  {
660  tensor(xl0, xl1, xlresult);
661  }
662  };
663 
664 } //end unnamed namespace
665 
666 //==============================================================================
667 //==============================================================================
668 
669 #include "SheafSystem/sec_at0.h"
670 #include "SheafSystem/sec_at1.h"
671 #include "SheafSystem/sec_at2.h"
672 #include "SheafSystem/sec_st2.h"
673 #include "SheafSystem/sec_vd.impl.h"
674 
675 using namespace fiber_bundle::sec_vd_algebra;
676 
677 void
679 alt(const sec_t2& x0, sec_at2& xresult, bool xauto_access)
680 {
681  // Preconditions:
682 
683  require(x0.state_is_auto_read_accessible(xauto_access));
684  require(xresult.state_is_auto_read_write_accessible(xauto_access));
685  require(x0.dd(xauto_access) == xresult.dd(xauto_access));
686  require(!x0.variance(xauto_access).is_mixed());
687 
688  // Body:
689 
690  unary_op(x0, xresult, alt_functor(), xauto_access);
691 
692  // Set the variance of the result.
693 
694  xresult.put_variance(x0.variance(xauto_access), xauto_access);
695 
696  // Postconditions:
697 
698  ensure(xresult.variance(xauto_access) == x0.variance(xauto_access));
699  ensure(unexecutable("xresult is equal to the antisymmetric part of x0"));
700 
701  // Exit:
702 
703  return;
704 }
705 
706 void
708 alt(const sec_t2& x0, sec_t2& xresult, bool xauto_access)
709 {
710  // Preconditions:
711 
712  require(x0.state_is_auto_read_accessible(xauto_access));
713  require(xresult.state_is_auto_read_write_accessible(xauto_access));
714  require(x0.dd(xauto_access) == xresult.dd(xauto_access));
715  require(!x0.variance(xauto_access).is_mixed());
716 
717  // Body:
718 
719  unary_op(x0, xresult, alt_functor(), xauto_access);
720 
721  // Set the variance of the result.
722 
723  xresult.put_variance(x0.variance(xauto_access), xauto_access);
724 
725  // Postconditions:
726 
727  ensure(xresult.variance(xauto_access) == x0.variance(xauto_access));
728  ensure(unexecutable("xresult is equal to the antisymmetric part of x0"));
729 
730  // Exit:
731 
732  return;
733 }
734 
735 void
737 sym(const sec_t2& x0, sec_st2& xresult, bool xauto_access)
738 {
739  // Preconditions:
740 
741  require(x0.state_is_auto_read_accessible(xauto_access));
742  require(xresult.state_is_auto_read_write_accessible(xauto_access));
743  require(x0.dd(xauto_access) == xresult.dd(xauto_access));
744  require(!x0.variance(xauto_access).is_mixed());
745 
746  // Body:
747 
748  unary_op(x0, xresult, sym_functor(), xauto_access);
749 
750  // Set the variance of the result.
751 
752  xresult.put_variance(x0.variance(xauto_access), xauto_access);
753 
754  // Postconditions:
755 
756  ensure(xresult.variance(xauto_access) == x0.variance(xauto_access));
757  ensure(unexecutable("xresult is equal to the symmetric part of x0"));
758 
759  // Exit:
760 
761  return;
762 }
763 
764 void
766 sym(const sec_t2& x0, sec_t2& xresult, bool xauto_access)
767 {
768  // Preconditions:
769 
770  require(x0.state_is_auto_read_accessible(xauto_access));
771  require(xresult.state_is_auto_read_write_accessible(xauto_access));
772  require(x0.dd(xauto_access) == xresult.dd(xauto_access));
773  require(!x0.variance(xauto_access).is_mixed());
774 
775  // Body:
776 
777  unary_op(x0, xresult, sym_functor(), xauto_access);
778 
779  // Set the variance of the result.
780 
781  xresult.put_variance(x0.variance(xauto_access), xauto_access);
782 
783  // Postconditions:
784 
785  ensure(xresult.variance(xauto_access) == x0.variance(xauto_access));
786  ensure(unexecutable("xresult is equal to the symmetric part of x0"));
787 
788  // Exit:
789 
790  return;
791 }
792 
793 void
795 contract(const sec_t2& x0, int xp, int xq, sec_at0& xresult,
796  bool xauto_access)
797 {
798  // Preconditions:
799 
800  require(x0.state_is_auto_read_accessible(xauto_access));
801  require(xresult.state_is_auto_read_write_accessible(xauto_access));
802  require(xp != xq);
803  require(xp >= 0 && xp < x0.p(xauto_access));
804  require(xq >= 0 && xq < x0.p(xauto_access));
805  require(x0.is_contravariant(xp, xauto_access) != \
806  x0.is_contravariant(xq, xauto_access));
807 
808  // Body:
809 
810  unary_op(x0, xresult, contract_functor(xp, xq), xauto_access);
811 
812  // Postconditions:
813 
814  ensure(unexecutable("xresult is the contraction of x0 on indices xp and xq"));
815  //ensure(xresult.is_p_form(xauto_access) == x0.is_p_form(xauto_access));
816 
817  // Exit:
818 
819  return;
820 }
821 
822 void
824 tensor(const sec_at1& x0, const sec_at1& x1, sec_t2& xresult, bool xauto_access)
825 {
826  // Preconditions:
827 
828  require(x0.state_is_auto_read_accessible(xauto_access));
829  require(x1.state_is_auto_read_accessible(xauto_access));
830  require(xresult.state_is_auto_read_write_accessible(xauto_access));
831  require(x1.dd(xauto_access) == x0.dd(xauto_access));
832  require(xresult.dd(xauto_access) == x0.dd(xauto_access));
833 
834  // Body:
835 
836  binary_op(x0, x1, xresult, tensor_functor(), xauto_access);
837 
838  // Set the variance of the result.
839 
840  xresult.put_variance(
841  tensor_product(x0.variance(xauto_access), x1.variance(xauto_access)),
842  xauto_access);
843 
844  // Postconditions:
845 
846  ensure(xresult.variance(xauto_access) == \
847  tensor_product(x0.variance(xauto_access), x1.variance(xauto_access)));
848 
849  // Exit:
850 
851  return;
852 }
853 
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
Definition: any.cc:153
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
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 ...
SHEAF_DLL_SPEC void sym(const sec_t2 &x0, sec_st2 &xresult, bool xauto_access)
The symmetric part of tensor x0 (pre-allocated version).
Definition: sec_t2.cc:737
SHEAF_DLL_SPEC void alt(const t2_lite &x0, at2_lite &xresult)
The alternating (antisymmetric) part of tensor x0 (pre-allocated version for volatile types)...
Definition: t2.cc:1176
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
Definition: sec_t2.cc:542
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
virtual sec_t2 * clone() const
Make a new handle, no state instance of current.
Definition: sec_t2.cc:480
virtual const std::string & class_name() const
The name of this class.
Definition: sec_t2.cc:442
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...
void unary_op(const S0 &x0, SR &xresult, F xfunctor, bool xauto_access)
Unary operator.
Definition: sec_vd.impl.h:224
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...
A general antisymmetric tensor of degree 1 over an abstract vector space (volatile version)...
Definition: at1.h:44
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...
SHEAF_DLL_SPEC void sym(const t2_lite &x0, st2_lite &xresult)
The symmetric part of tensor x0 (pre-allocated version for volatile types).
Definition: t2.cc:1301
SHEAF_DLL_SPEC void alt(const sec_t2 &x0, sec_at2 &xresult, bool xauto_access)
The alternating (antisymmetric) part of tensor x0 (pre-allocated version).
Definition: sec_t2.cc:679
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
virtual const fiber_type & fiber_prototype() const
Virtual constructor for the associated fiber type.
Definition: sec_t2.cc:381
A member of a sec_rep_space; a section.
poset_path vector_space_path() const
The path of the underlying vector space.
STL namespace.
static const std::string & static_class_name()
The name of this class.
Definition: sec_t2.cc:461
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
A section of a bundle with fiber type at1.
Definition: sec_at1.h:48
virtual tensor_variance variance(bool xauto_access) const
The variance.
Definition: sec_tp.cc:589
void put_variance(const tensor_variance &xvariance, bool xauto_access)
Sets the variance to xvariance.
Definition: sec_tp.cc:627
SHEAF_DLL_SPEC tensor_variance tensor_product(const tensor_variance &x0, const tensor_variance &x1)
The variance of the tensor product of tensors with variance x0 and x1.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
Definition: sec_tp.cc:391
bool is_mixed() const
True if and only if there exists at least one index that is covariant and at least one that is contra...
A tensor of degree 2 over an abstract vector space (volatile version).
Definition: t2.h:43
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: sec_t2.cc:50
Abstract base class with useful features for all objects.
Definition: any.h:39
int p() const
The tensor degree of this space.
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
virtual bool is_contravariant(bool xauto_access) const
True if and only if all tensor index positions are contravariant.
Definition: sec_tp.cc:748
bool fiber_is_ancestor_of(const any *xother) const
True if xother conforms to an instance of the fiber of current.
Definition: sec_t2.cc:515
An abstract tensor section space of degree p.
Definition: sec_tp_space.h:53
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
Definition: sec_vd.impl.h:48
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
A section of a bundle with fiber type at2.
Definition: sec_at2.h:46
virtual int dd() const
Dimension of the underlying vector space.
Definition: sec_tp.cc:433
A section of a bundle with fiber type st2.
Definition: sec_st2.h:46
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
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 dd() const
The dimension of the underlying ("domain") vector space.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
virtual sec_t2 & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
Definition: sec_t2.cc:284
bool invariant() const
Class invariant.
Definition: sec_t2.cc:567
~sec_t2()
Destructor.
Definition: sec_t2.cc:368
A section of a bundle with fiber type tp.
Definition: sec_t2.h:46
SHEAF_DLL_SPEC void contract(const sec_t2 &x0, int xp, int xq, sec_at0 &xresult, bool xauto_access)
Contraction on contravariant index xp and covariant index xq (pre-allocated version).
Definition: sec_t2.cc:795
Namespace containing the general tensor algrebra functions for the fiber_bundles component of the she...
Definition: t2.h:496
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
poset_path scalar_space_path() const
The path of the underlying space of scalars.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
SHEAF_DLL_SPEC void tensor(const sec_at1 &x0, const sec_at1 &x1, sec_t2 &xresult, bool xauto_access)
Definition: sec_t2.cc:824
virtual int d(int xp, int xdd) const
Dimension d() as a function of degree xp and domain dimension xdd.
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
Definition: sec_vd.h:691
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
An abstract client handle for a member of a poset.
An abstract tensor space of degree p.
Definition: tp_space.h:47
SHEAF_DLL_SPEC void tensor(const at1_lite &x0, const at1_lite &x1, t2_lite &xresult)
Tensor product (pre-allocated version for volatile types).
Definition: t2.cc:1488
Namespace for the fiber_bundles component of the sheaf system.
Antisymetric tensor of degree 0. As the degree is 0 there is nothing to be symmetric or antisymmetric...
Definition: sec_at0.h:51
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...
SHEAF_DLL_SPEC void contract(const t2_lite &x0, int xp, int xq, at0_lite &xresult)
Contraction on contravariant index xp and covariant index xq (pre-allocated version for volatime type...
Definition: t2.cc:1091
A tensor of degree 2 over an abstract vector space (persistent version).
Definition: t2.h:226
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
sec_t2()
Default constructor.
Definition: sec_t2.cc:111
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61