SheafSystem  0.0.0.0
gl2.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 GL2_H
22 #define GL2_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef GLN_H
29 #include "SheafSystem/gln.h"
30 #endif
31 
32 #ifndef GENERAL_MATRIX_2X2_H
33 #include "SheafSystem/general_matrix_2x2.h"
34 #endif
35 
36 
37 namespace fiber_bundle
38 {
39 
40  class e2;
41 
42 //==============================================================================
43 // CLASS GL2_ROW_DOFS_TYPE
44 //==============================================================================
45 
49 template <typename T>
51 {
52 public:
53 
57  typedef T dof_type;
58 
63 
68 
72  static const std::string& static_class_name();
73 
77  static int d();
78 
83  T& operator[] (int xindex);
84 
89  const T& operator[] (int xindex) const;
90 
95  operator typename gl2_row_dofs_type<T>::matrix_type& ();
96 
101  operator const typename gl2_row_dofs_type<T>::matrix_type& () const;
102 
106  matrix_type& basis_matrix();
107 
111  const matrix_type& basis_matrix() const;
112 
116  matrix_type& component_matrix();
117 
121  const matrix_type& component_matrix() const;
122 
126  gl2_row_dofs_type<T>* clone() const;
127 
132  gl2_row_dofs_type<T>* clone(bool xnew_state, bool xauto_access) const
133  {
134  return clone();
135  }
136 
155 
156 protected:
157 private:
158 
159 };
160 
161 
162 //==============================================================================
163 // CLASS GL2_LITE
164 //==============================================================================
165 
173 class SHEAF_DLL_SPEC gl2_lite : public gln_lite
174 {
175  //============================================================================
177  //============================================================================
179 
180 public:
181 
182  // Typedefs:
183 
188 
193 
197  gl2_lite();
198 
202  gl2_lite(const gl2_lite& xother);
203 
207  gl2_lite& operator=(const gl2_lite& xother);
208 
212  virtual ~gl2_lite();
213 
218  gl2_lite(const row_dofs_type& xrow_dofs);
219 
223  gl2_lite& operator=(const row_dofs_type& xrow_dofs);
224 
228  gl2_lite(const matrix_type& xmatrix);
229 
233  gl2_lite& operator=(const matrix_type& xmatrix);
234 
239  operator matrix_type& ();
240 
245  operator const matrix_type& () const;
246 
251  operator row_dofs_type& ();
252 
257  operator const row_dofs_type& () const;
258 
262  matrix_type& basis_matrix();
263 
267  const matrix_type& basis_matrix() const;
268 
272  matrix_type& component_matrix();
273 
277  const matrix_type& component_matrix() const;
278 
283  void rescale(const value_type& xscale, const value_type& yscale);
284 
300  void rotate_z(const value_type& xangle);
301 
306  void basis(value_type xb0[], value_type xb1[]) const;
307 
314  void put_basis(const value_type xb0[],
315  const value_type xb1[]);
316 
320  void get_matrix(row_dofs_type& xmatrix) const;
321 
327  void put_matrix(row_dofs_type& xmatrix);
328 
329 
330 protected:
331 
335  row_dofs_type _row_dofs;
336 
337 private:
338 
340 
341 
342  //============================================================================
344  //============================================================================
346 
347 public:
348 
349  using gln_lite::n;
350 
354  virtual int n() const;
355 
356 protected:
357 private:
358 
360 
361 
362  //============================================================================
364  //============================================================================
366 
367 public:
368 protected:
369 private:
370 
372 
373 
374  //============================================================================
376  //============================================================================
378 
379 public:
380 
384  virtual const std::string& class_name() const;
385 
389  static const std::string& static_class_name();
390 
394  virtual gl2_lite* clone() const;
395 
400  virtual gl2_lite* clone(bool xnew_state, bool xauto_access) const
401  {
402  return clone();
403  }
404 
405 protected:
406 private:
407 
409 
410 
411  //============================================================================
413  //============================================================================
415 
416 public:
417 
421  virtual bool is_ancestor_of(const any_lite& xother) const;
422 
426  bool invariant() const;
427 
431  virtual void* row_dofs();
432 
436  virtual const void* row_dofs() const;
437 
438 protected:
439 private:
440 
442 };
443 
444 
445 //==============================================================================
446 // CLASS GL2
447 //==============================================================================
448 
455 
456 class SHEAF_DLL_SPEC gl2 : public gln
457 {
458  // ===========================================================
460  // ===========================================================
462 
463 public:
464 
468  static const poset_path& standard_schema_path();
469 
473  static void make_standard_schema(namespace_poset& xns);
474 
480  static host_type& new_host(namespace_type& xns,
481  const poset_path& xhost_path,
482  const poset_path& xschema_path,
483  const poset_path& xvector_space_path,
484  bool xauto_access);
485 
492  static host_type& standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
493 
494 protected:
495 
496 private:
497 
499 
500 
501  //============================================================================
503  //============================================================================
505 
506 public:
507 
508  // Typedefs:
509 
514 
519 
524 
528  gl2();
529 
533  gl2(const gl2& xother, bool xnew_jem);
534 
538  virtual gl2& operator=(const abstract_poset_member& xother);
539 
543  gl2& operator=(const gl2& xother);
544 
548  virtual ~gl2();
549 
553  gl2(poset* xhost, bool xauto_access = true);
554 
557 
561  gl2(poset_state_handle& xhost,
562  const row_dofs_type& xrdt,
563  bool xauto_access = true);
564 
568  gl2& operator=(const row_dofs_type& xrdt);
569 
574  gl2(const poset* xhost, pod_index_type xhub_id);
575 
580  gl2(const poset* xhost, const scoped_index& xid);
581 
586  gl2(const poset* xhost, const std::string& xname);
587 
591  explicit gl2(gl2* xother);
592 
597  operator row_dofs_type& ();
598 
603  operator const row_dofs_type& () const;
604 
608  void get_matrix(row_dofs_type& xmatrix) const;
609 
615  void put_matrix(row_dofs_type& xmatrix);
616 
617 
621  virtual volatile_type* lite_type() const;
622 
623 
624  //============================================================================
626  //============================================================================
628 
629 public:
630 protected:
631 private:
632 
634 
635 
636 
637  //============================================================================
639  //============================================================================
641 
642 public:
643 
644 protected:
645 
646 private:
647 
649 
650 
651  //============================================================================
653  //============================================================================
655 
656 public:
657 
661  virtual const std::string& class_name() const;
662 
666  static const std::string& static_class_name();
667 
671  virtual gl2* clone() const;
672 
673 
674 
680  inline gl2* clone(bool xnew_state, bool xauto_access = true) const
681  {
682  return static_cast<gl2*>(gln::clone(xnew_state, xauto_access));
683  }
684 
685 protected:
686 private:
687 
689 
690 
691 
692  //============================================================================
694  //============================================================================
696 
697 public:
698 
702  virtual bool invariant() const;
703 
707  virtual bool is_ancestor_of(const any* xother) const;
708 
709 protected:
710 private:
711 
713 };
714 
715 //==============================================================================
716 // NON-MEMBER FUNCTIONS
717 //==============================================================================
718 
722 template <typename T>
723 std::ostream& operator<<(std::ostream& xos, const gl2_row_dofs_type<T>& xrdt);
724 
725 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
726 
730 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, const gl2_lite& xlite);
731 
735 SHEAF_DLL_SPEC std::ostream& operator<<(std::ostream& xos, const gl2& xpersistent);
736 
737 
741 SHEAF_DLL_SPEC void inverse(const gl2_lite& xlite, gl2_lite& xresult);
742 
746 SHEAF_DLL_SPEC void inverse(const gl2& xgl, gl2& xresult);
747 
748 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
749 
750 
751 } // namespace fiber_bundle
752 
753 
754 #endif // ifndef GL2_H
Euclidean vector space of dimension 2 (persistent version).
Definition: e2.h:405
The mathematical group GL(n, R). GL(n,R) is the group of general, invertible, linear transformations ...
Definition: gln.h:103
The default name space; a poset which contains other posets as members.
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
row_dofs_type _row_dofs
Row_dofs_type.
Definition: gl2.h:335
gl2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gl2.h:187
The mathematical group GL(n, R). GL(n,R) is the group of general, invertible, linear transformations ...
Definition: gln.h:289
gl2 * 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: gl2.h:680
gl2_row_dofs_type< double >::matrix_type matrix_type
The type of the associated matrix.
Definition: gl2.h:192
General matrix with 2 rows and 2 columns.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
The mathematical group GL(2, R). The group of all invertible, linear transformations on the R2...
Definition: gl2.h:456
gl2_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: gl2.h:132
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Row dofs type for class gl2.
Definition: gl2.h:50
Abstract base class with useful features for all objects.
Definition: any.h:39
matrix_type & component_matrix()
The associated component transformation matrix (non const version).
Definition: gl2.impl.h:194
The mathematical group GL(2, R). The group of all invertible, linear transformations on the R2...
Definition: gl2.h:173
A client handle for a mutable partially ordered set.
Definition: poset.h:40
gl2_lite volatile_type
The associated volatile type.
Definition: gl2.h:518
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
static int d()
The dimension of the row dof components.
Definition: gl2.impl.h:62
virtual gl2_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: gl2.h:400
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: gln.h:121
matrix_type & basis_matrix()
The associated basis transformation matrix (non const version).
Definition: gl2.impl.h:156
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: gl2.impl.h:82
virtual int n() const
Dimension of the representation space; n in GL(n, R).
Definition: gln.cc:193
A Cartesian product space.
Definition: gln_space.h:52
gl2_row_dofs_type< T > row_dofs_type
The type of the row dofs (type of this).
Definition: gl2.h:62
general_matrix_2x2< T > matrix_type
The type of the associated matrix.
Definition: gl2.h:67
gl2_row_dofs_type< T > * clone() const
Creates a new instance of the same type as this.
Definition: gl2.impl.h:235
T dof_type
The type of the dofs.
Definition: gl2.h:57
e2 vector_space_type
Type of underlying vector space.
Definition: gl2.h:523
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
gl2_row_dofs_type< double > row_dofs_type
The type of the row dofs.
Definition: gl2.h:513
static const std::string & static_class_name()
The name of this class.
Definition: gl2.impl.h:42
T components[8]
The dofs in the following order:
Definition: gl2.h:154
virtual gln * clone() const
Make a new handle, no state instance of current.
Definition: gln.cc:1439
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC void inverse(const gl2_lite &xlite, gl2_lite &xresult)
Inverse (pre-allocated version for volatile type).
Definition: gl2.cc:1484
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.
Definition: binary_index.cc:35