SheafSystem  0.0.0.0
st2.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 ST2_H
22 #define ST2_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef STP_H
29 #include "SheafSystem/stp.h"
30 #endif
31 
32 namespace fiber_bundle
33 {
34 
35 //==============================================================================
36 // CLASS ST2_LITE
37 //==============================================================================
38 
43 class SHEAF_DLL_SPEC st2_lite : public stp_lite
44 {
45  //===========================================================================
47  //===========================================================================
49 
50 public:
51 
57 
61  st2_lite();
62 
66  st2_lite(const st2_lite& xother);
67 
71  st2_lite& operator=(const st2_lite& xother);
72 
76  virtual ~st2_lite();
77 
81  st2_lite(const row_dofs_type& xrow_dofs);
82 
86  st2_lite& operator=(const row_dofs_type& xrow_dofs);
87 
88  using stp_lite::component;
90 
94  virtual value_type component(int xrow, int xcolumn) const;
95 
99  virtual void put_component(int xrow, int xcolumn, value_type xcomp);
100 
105  virtual int index_for_row_column(int xrow, int xcolumn) const;
106 
107 protected:
108 private:
109 
111 
112 
113  //===========================================================================
115  //===========================================================================
117 
118 public:
119 protected:
120 private:
121 
123 
124 
125  //===========================================================================
127  //===========================================================================
129 
130 public:
131 
137  enum static_const_int {P = 2};
138 
142  virtual int p() const;
143 
144 protected:
145 private:
146 
148 
149 
150  //===========================================================================
152  //===========================================================================
154 
155 public:
156 protected:
157 private:
158 
160 
161 
162  //===========================================================================
164  //===========================================================================
166 
167 public:
168 protected:
169 private:
170 
172 
173 
174  //============================================================================
176  //============================================================================
178 
179 public:
180 
184  virtual const std::string& class_name() const;
185 
189  static const std::string& static_class_name();
190 
194  virtual st2_lite* clone() const;
195 
196 protected:
197 private:
198 
200 
201 
202  //===========================================================================
204  //===========================================================================
206 
207 public:
208 
212  virtual bool is_ancestor_of(const any_lite& xother) const;
213 
217  bool invariant() const;
218 
219 
220 protected:
221 private:
222 
224 };
225 
226 //==============================================================================
227 // CLASS ST2
228 //==============================================================================
229 
234 class SHEAF_DLL_SPEC st2 : public stp
235 {
236  // ===========================================================
238  // ===========================================================
240 
241 public:
242 
246  static const poset_path& standard_schema_path();
247 
251  static void make_standard_schema(namespace_poset& xns);
252 
258  static host_type& new_host(namespace_type& xns,
259  const poset_path& xhost_path,
260  const poset_path& xschema_path,
261  const poset_path& xvector_space_path,
262  bool xauto_access);
263 
264 protected:
265 
266 private:
267 
269 
270 
271  //===========================================================================
273  //===========================================================================
275 
276 public:
277 
282 
286  st2();
287 
292  st2(const poset_state_handle* xhost, pod_index_type xhub_id);
293 
298  st2(const poset_state_handle* xhost, const scoped_index& xid);
299 
304  st2(const poset_state_handle* xhost, const std::string& xname);
305 
309  explicit st2(abstract_poset_member* xother);
310 
314  st2(poset_state_handle* xhost, bool xauto_access = true);
315 
319  virtual st2& operator=(const abstract_poset_member& xother);
320 
324  st2& operator=(const st2& xother);
325 
329  ~st2();
330 
334  virtual const volatile_type& lite_prototype() const;
335 
339  virtual volatile_type* lite_type() const;
340 
341 
342  using stp::component;
343  using stp::put_component;
344 
348  value_type component(int xrow, int xcolumn) const;
349 
353  value_type component(int xrow, int xcolumn, bool xauto_access) const;
354 
358  void put_component(int xrow, int xcolumn, value_type xvalue);
359 
363  void put_component(int xrow, int xcolumn, value_type xvalue,
364  bool xauto_access);
365 
370  virtual int index_for_row_column(int xrow, int xcolumn) const;
371 
372 
373 protected:
374 private:
375 
377 
378 
379  //============================================================================
381  //============================================================================
383 
384 public:
385 protected:
386 private:
387 
389 
390 
391  //============================================================================
393  //============================================================================
395 
396 public:
397 
403  enum static_const_int {P = 2};
404 
405 protected:
406 private:
407 
409 
410 
411  //============================================================================
413  //============================================================================
415 
416 public:
417 protected:
418 private:
419 
421 
422 
423  //============================================================================
425  //============================================================================
427 
428 public:
429 
430 protected:
431 
432 private:
433 
435 
436 
437  //============================================================================
439  //============================================================================
441 
442 public:
443 
447  virtual const std::string& class_name() const;
448 
452  static const std::string& static_class_name();
453 
457  virtual st2* clone() const;
458 
464  inline st2* clone(bool xnew_state, bool xauto_access = true) const
465  {
466  return static_cast<st2*>(stp::clone(xnew_state, xauto_access));
467  }
468 
469 protected:
470 private:
471 
473 
474 
475  //============================================================================
477  //============================================================================
479 
480 public:
481 
482 
486  bool is_ancestor_of(const any* xother) const;
487 
491  bool invariant() const;
492 
493 
494 protected:
495 private:
496 
498 };
499 
500 //==============================================================================
501 // NON-MEMBER FUNCTIONS
502 //==============================================================================
503 
504 //==============================================================================
505 // ST2 FACET
506 //==============================================================================
507 
512 namespace st2_algebra
513 {
514 
515 #ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
516 
521 SHEAF_DLL_SPEC void trace(const st2& x0, vd_value_type& xresult, bool xauto_access);
522 
527 SHEAF_DLL_SPEC vd_value_type trace(const st2& x0, bool xauto_access);
528 
533 SHEAF_DLL_SPEC void trace(const st2_lite& x0, vd_value_type& xresult);
534 
539 SHEAF_DLL_SPEC vd_value_type trace(const st2_lite& x0);
540 
545 SHEAF_DLL_SPEC void determinant(const st2& x0, vd_value_type& xresult, bool xauto_access);
546 
551 SHEAF_DLL_SPEC vd_value_type determinant(const st2& x0, bool xauto_access);
552 
557 SHEAF_DLL_SPEC void determinant(const st2_lite& x0, vd_value_type& xresult);
558 
563 SHEAF_DLL_SPEC vd_value_type determinant(const st2_lite& x0);
564 
565 #endif // ifndef DOXYGEN_1_5_4_SKIP_UNKNOWN
566 
567 //==============================================================================
568 //==============================================================================
569 
574 template <typename T, typename GLN>
575 T* to_principal_axes(const T& xlite, GLN& xtransform);
576 
581 template <typename T, typename GLN>
582 void to_principal_axes(const T& xlite, GLN& xtransform, T& xresult);
583 
591 template <typename T, typename GLN>
592 void
593 to_principal_axes(const T& xlite, const T& xpd_lite,
594  GLN& xtransform, T& xresult);
595 
596 } // namespace st2_algebra
597 
598 } // namespace fiber_bundle
599 
600 #endif // ifndef ST2_H
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: st2.h:56
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
value_type component(int xindex) const
The xindex-th component.
Definition: vd.cc:209
static_const_int
The tensor degree (static version)
Definition: st2.h:137
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
void trace(const S0 &x0, SR &xresult, bool xauto_access)
Definition: sec_st2.impl.h:99
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
void to_principal_axes(const T &xlite, const T &xpd_lite, GLN &xtransform, T &xresult)
Computes the principal axes basis for xlite and an associated positive definite tensor xpd_lite...
Definition: st2.impl.h:72
virtual stp * clone() const
Make a new handle, no state instance of current.
Definition: stp.cc:823
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
st2_lite volatile_type
The associated volatile type.
Definition: st2.h:281
void determinant(const S0 &x0, SR &xresult, bool xauto_access)
Definition: sec_st2.impl.h:131
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
st2 * 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: st2.h:464
static_const_int
The tensor degree (static version)
Definition: st2.h:403
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
vd_value_type value_type
The POD ("plain old data") type of scalar in the vector space of this.
Definition: vd.h:423
An abstract client handle for a member of a poset.
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
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.
A general symmetric tensor of degree 2 over an abstract vector space (persistent version).
Definition: st2.h:234
Row dofs type for class vd.
Definition: vd.h:61
double vd_value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: fiber_bundle.h:63