SheafSystem  0.0.0.0
at2_e2.h
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 #ifndef AT2_E2_H
22 #define AT2_E2_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef AT2_H
29 #include "SheafSystem/at2.h"
30 #endif
31 
32 #ifndef ANTISYMMETRIC_MATRIX_2X2_H
33 #include "SheafSystem/antisymmetric_matrix_2x2.h"
34 #endif
35 
36 #ifndef E2_H
37 #include "SheafSystem/e2.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
43 //==============================================================================
44 // CLASS AT2_E2_ROW_DOFS_TYPE
45 //==============================================================================
46 
50 template <typename T>
52 {
53 public:
54 
58  typedef T dof_type;
59 
64 
69 
73  static const std::string& static_class_name();
74 
78  static int d();
79 
84  T& operator[] (int xindex);
85 
90  const T& operator[] (int xindex) const;
91 
96  operator typename at2_e2_row_dofs_type<T>::matrix_type& ();
97 
102  operator const typename at2_e2_row_dofs_type<T>::matrix_type& () const;
103 
108 
113  at2_e2_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
114  {
115  return clone();
116  }
117 
118  //
119  // The antisymmetrix matrix is actually
120  // 0 xy
121  // -xy 0
122  // So we only need to store the xy component.
123 
130 
131 protected:
132 private:
133 
134 };
135 
136 //==============================================================================
137 // CLASS AT2_E2_LITE
138 //==============================================================================
139 
140 class e2_lite;
141 
146 class SHEAF_DLL_SPEC at2_e2_lite : public at2_lite
147 {
148  //============================================================================
150  //============================================================================
152 
153 public:
154 
155  // Typedefs:
156 
161 
166 
170  at2_e2_lite();
171 
175  at2_e2_lite(const at2_e2_lite& xother);
176 
180  at2_e2_lite& operator=(const at2_e2_lite& xother);
181 
185  virtual ~at2_e2_lite();
186 
190  at2_e2_lite(const row_dofs_type& xrow_dofs);
191 
195  at2_e2_lite& operator=(const row_dofs_type& xrow_dofs);
196 
200  at2_e2_lite(const matrix_type& xmatrix);
201 
205  at2_e2_lite& operator=(const matrix_type& xmatrix);
206 
211  operator matrix_type& ();
212 
217  operator const matrix_type& () const;
218 
223  operator row_dofs_type& ();
224 
229  operator const row_dofs_type& () const;
230 
234  at2_e2_lite(const value_type& xy);
235 
236  using at2_lite::component;
238 
242  virtual void put_component(value_type xy);
243 
244 protected:
245 
249  row_dofs_type _row_dofs;
250 
251 private:
252 
254 
255 
256  //============================================================================
258  //============================================================================
260 
261 public:
262 protected:
263 private:
264 
266 
267 
268  //============================================================================
270  //============================================================================
272 
273 public:
274 
279 
283  virtual int dd() const;
284 
285 protected:
286 private:
287 
289 
290 
291  //============================================================================
293  //============================================================================
295 
296 public:
297 
302  virtual const tp_lite& tp_prototype(int xp) const;
303 
308  virtual const atp_lite& atp_prototype(int xp) const;
309 
314  virtual const stp_lite& stp_prototype(int xp) const;
315 
316 protected:
317 private:
318 
320 
321 
322  //============================================================================
324  //============================================================================
326 
327 public:
328 protected:
329 private:
330 
332 
333 
334  //============================================================================
336  //============================================================================
338 
339 public:
340 
344  virtual const std::string& class_name() const;
345 
349  static const std::string& static_class_name();
350 
354  virtual at2_e2_lite* clone() const;
355 
360  virtual at2_e2_lite* clone(bool xnew_state, bool xauto_access) const
361  {
362  return clone();
363  }
364 
365 protected:
366 private:
367 
369 
370 
371  //============================================================================
373  //============================================================================
375 
376 public:
377 
381  virtual bool is_ancestor_of(const any_lite& xother) const;
382 
386  bool invariant() const;
387 
391  virtual void* row_dofs();
392 
396  virtual const void* row_dofs() const;
397 
398 protected:
399 private:
400 
402 };
403 
404 //==============================================================================
405 // CLASS AT2_E2
406 //==============================================================================
407 
412 class SHEAF_DLL_SPEC at2_e2 : public at2
413 {
414  // ===========================================================
416  // ===========================================================
418 
419 public:
420 
424  static const poset_path& standard_schema_path();
425 
429  static void make_standard_schema(namespace_poset& xns);
430 
436  static host_type& new_host(namespace_type& xns,
437  const poset_path& xhost_path,
438  const poset_path& xschema_path,
439  const poset_path& xvector_space_path,
440  bool xauto_access);
441 
448  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
449 
450 protected:
451 
452 private:
453 
455 
456 
457  //============================================================================
459  //============================================================================
461 
462 public:
463 
464  // Typedefs:
465 
470 
475 
480 
485 
489  at2_e2();
490 
495  at2_e2(const poset_state_handle* xhost, pod_index_type xhub_id);
496 
501  at2_e2(const poset_state_handle* xhost, const scoped_index& xid);
502 
507  at2_e2(const poset_state_handle* xhost, const std::string& xname);
508 
512  explicit at2_e2(abstract_poset_member* xother);
513 
517  at2_e2(poset_state_handle* xhost, bool xauto_access = true);
518 
522  at2_e2(poset_state_handle& xhost,
523  const row_dofs_type& xrdt,
524  bool xauto_access = true);
525 
529  at2_e2& operator=(const row_dofs_type& xrdt);
530 
534  virtual at2_e2& operator=(const abstract_poset_member& xother);
535 
539  at2_e2& operator=(const at2_e2& xother);
540 
544  ~at2_e2();
545 
549  virtual const volatile_type& lite_prototype() const;
550 
554  virtual volatile_type* lite_type() const;
555 
559  virtual void put_components(dof_type xy_comp);
560 
565  operator row_dofs_type& ();
566 
571  operator const row_dofs_type& () const;
572 
573 protected:
574 private:
575 
577 
578 
579  //============================================================================
581  //============================================================================
583 
584 public:
585 protected:
586 private:
587 
589 
590 
591  //============================================================================
593  //============================================================================
595 
596 public:
597 protected:
598 private:
599 
601 
602 
603  //============================================================================
605  //============================================================================
607 
608 public:
609 protected:
610 private:
611 
613 
614 
615  //============================================================================
617  //============================================================================
619 
620 public:
621 protected:
622 private:
623 
625 
626 
627  //============================================================================
629  //============================================================================
631 
632 public:
633 
639  virtual tp* new_tp(int xp, bool xauto_access) const;
640 
645  virtual atp* new_atp(int xp, bool xauto_access) const;
646 
651  virtual stp* new_stp(int xp, bool xauto_access) const;
652 
653 protected:
654 private:
655 
657 
658 
659  //============================================================================
661  //============================================================================
663 
664 public:
665 
669  virtual const std::string& class_name() const;
670 
674  static const std::string& static_class_name();
675 
679  virtual at2_e2* clone() const;
680 
686  inline at2_e2* clone(bool xnew_state, bool xauto_access = true) const
687  {
688  return static_cast<at2_e2*>(at2::clone(xnew_state, xauto_access));
689  }
690 
691 protected:
692 private:
693 
695 
696 
697  //============================================================================
699  //============================================================================
701 
702 public:
703 
707  bool is_ancestor_of(const any* xother) const;
708 
712  bool invariant() const;
713 
714 protected:
715 private:
716 
718 };
719 
720 //==============================================================================
721 // NON-MEMBER FUNCTIONS
722 //==============================================================================
723 
727 template <typename T>
728 std::ostream& operator<<(std::ostream& xos, const at2_e2_row_dofs_type<T>& xrdt);
729 
730 //==============================================================================
731 
732 class at0;
733 class at0_lite;
734 class e2;
735 class e2_lite;
736 
737 namespace atp_algebra
738 {
739 
744 SHEAF_DLL_SPEC void hook(const e2& x0, const e2& x1, at0& xresult, bool xauto_access);
745 
750 SHEAF_DLL_SPEC void hook(const e2_lite& x0, const e2_lite& x1, at0_lite& xresult);
751 
756 SHEAF_DLL_SPEC void hook(const at2_e2& x0, const e2& x1, e2& xresult, bool xauto_access);
757 
762 SHEAF_DLL_SPEC void hook(const at2_e2_lite& x0, const e2_lite& x1, e2_lite& xresult);
763 
768 SHEAF_DLL_SPEC void star(const at2_e2& x0, at0& xresult, bool xauto_access);
769 
774 SHEAF_DLL_SPEC void star(const at2_e2_lite& x0, at0_lite& xresult);
775 
780 SHEAF_DLL_SPEC at0_lite* star(const at2_e2_lite& x0);
781 
786 SHEAF_DLL_SPEC void star(const at0& x0, at2_e2& xresult, bool xauto_access);
787 
792 SHEAF_DLL_SPEC void star(const at0_lite& x0, at2_e2_lite& xresult);
793 
798 SHEAF_DLL_SPEC at2_e2_lite* star(const at0_lite& x0);
799 
801 
806 SHEAF_DLL_SPEC void star(const e2& x0, e2& xresult, bool xauto_access);
807 
812 SHEAF_DLL_SPEC void star(const e2_lite& x0, e2_lite& xresult);
813 
818 SHEAF_DLL_SPEC e2_lite* star(const e2_lite& x0);
819 
824 SHEAF_DLL_SPEC void wedge(const e2& x0, const e2& x1, at2_e2& xresult, bool xauto_access);
825 
830 SHEAF_DLL_SPEC void wedge(const e2_lite& x0, const e2_lite& x1, at2_e2_lite& xresult);
831 
832 } // namespace atp_algebra
833 
834 } // namespace fiber_bundle
835 
836 
837 #endif // ifndef AT2_E2_H
static const std::string & static_class_name()
The name of this class.
Definition: at2_e2.impl.h:42
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
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
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (persistent version)...
Definition: at2_e2.h:412
An antisymmetric tensor of degree p.
Definition: atp.h:190
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
The default name space; a poset which contains other posets as members.
virtual at2_e2_lite * clone(bool xnew_state, bool xauto_access) const
Virtual constructor, makes a new instance of the same type as this; synonym for clone(), intended for use only in certain templates.
Definition: at2_e2.h:360
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
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
static int d()
The dimension of the row dof components.
Definition: at2_e2.impl.h:62
at2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at2_e2.h:469
An antisymmetric rank 2 tensor over a Euclidean vector space of dimension 2 (volatile version)...
Definition: at2_e2.h:146
at2_e2_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: at2_e2.impl.h:154
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
at2_e2_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: at2_e2.h:63
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
antisymmetric_matrix_2x2< T > matrix_type
The type of the associated matrix.
Definition: at2_e2.h:68
Abstract base class with useful features for all objects.
Definition: any.h:39
at2_e2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: at2_e2.h:160
Euclidean vector space of dimension 2 (volatile version).
Definition: e2.h:112
An abstract antisymmetric tensor space of degree p.
Definition: atp_space.h:42
at2_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: at2_e2.h:484
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A scalar viewed as an antisymmetric tensor of degree 0. As the degree is 0 there is nothing to be sym...
Definition: at0.h:424
at2_e2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: at2_e2.h:165
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: at2_e2.impl.h:82
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
Antisymmetric matrix with 2 rows and 2 columns.
at2_e2_lite volatile_type
The associated volatile type.
Definition: at2_e2.h:474
T dof_type
The type of the dofs.
Definition: at2_e2.h:58
SHEAF_DLL_SPEC tensor_variance hook(const tensor_variance &x0)
The variance of the hook of a tensor with variance x0.
Row dofs type for class at2_e2.
Definition: at2_e2.h:51
virtual at2 * clone() const
Make a new handle, no state instance of current.
Definition: at2.cc:1040
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
T components[1]
The xy dof.
Definition: at2_e2.h:129
e2 vector_space_type
Type of underlying vector space.
Definition: at2_e2.h:479
row_dofs_type _row_dofs
Row_dofs_type.
Definition: at2_e2.h:249
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: at2.h:56
e2_lite vector_space_type
Type of underlying vector space.
Definition: at2_e2.h:278
at2_e2 * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
Definition: at2_e2.h:686
A general antisymmetric tensor of degree 2 over an abstract vector space (volatile version)...
Definition: at2.h:43
SHEAF_DLL_SPEC tensor_variance wedge(const tensor_variance &x0, const tensor_variance &x1)
The variance of the wedge of a tensor with variance x0 with a tnesor with variance x1...
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.
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
Definition: vd.h:431
SHEAF_DLL_SPEC tensor_variance star(const tensor_variance &x0, int xdd)
The variance of the Hodge star of a tensor with variance x0 over a vector space of dimension xdd...
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
Namespace for the fiber_bundles component of the sheaf system.
at2_e2_row_dofs_type< T > * clone(bool xnew_state, bool xauto_access) const
Virtual constructor, makes a new instance of the same type as this; synonym for clone(), intended for use only in certain templates.
Definition: at2_e2.h:113
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233