SheafSystem  0.0.0.0
t2.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 
22 #ifndef T2_H
23 #define T2_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef TP_H
30 #include "SheafSystem/tp.h"
31 #endif
32 
33 namespace fiber_bundle
34 {
35 
36 //==============================================================================
37 // CLASS T2_LITE
38 //==============================================================================
39 
43 class SHEAF_DLL_SPEC t2_lite : public tp_lite
44 {
45 
46  //============================================================================
48  //============================================================================
50 
51 public:
52 
56  t2_lite();
57 
61  t2_lite(const t2_lite& xother);
62 
66  t2_lite& operator=(const t2_lite& xother);
67 
71  virtual ~t2_lite();
72 
76  t2_lite(const row_dofs_type& xrow_dofs);
77 
81  t2_lite& operator=(const row_dofs_type& xrow_dofs);
82 
83 
84  using tp_lite:: component;
86 
90  value_type component(int xrow, int xcolumn) const;
91 
95  void put_component(int xrow, int xcolumn, value_type xcomp);
96 
101  virtual int index_for_row_column(int xrow, int xcolumn) const;
102 
103 
104 protected:
105 private:
106 
108 
109 
110  //============================================================================
112  //============================================================================
114 
115 public:
116 
122  enum static_const_int {P = 2};
123 
128  virtual int p() const;
129 
130 
131 protected:
132 private:
133 
135 
136 
137  //============================================================================
139  //============================================================================
141 
142 public:
143 
147  virtual int d() const;
148 
149 protected:
150 private:
151 
153 
154 
155  //============================================================================
157  //============================================================================
159 
160 public:
161 protected:
162 private:
163 
165 
166 
167  //============================================================================
169  //============================================================================
171 
172 public:
173 
177  virtual const std::string& class_name() const;
178 
182  static const std::string& static_class_name();
183 
187  virtual t2_lite* clone() const;
188 
189 protected:
190 private:
191 
193 
194 
195  //============================================================================
197  //============================================================================
199 
200 public:
201 
205  virtual bool is_ancestor_of(const any_lite& xother) const;
206 
210  bool invariant() const;
211 
212 protected:
213 private:
214 
216 };
217 
218 
219 //==============================================================================
220 // CLASS T2
221 //==============================================================================
222 
226 class SHEAF_DLL_SPEC t2 : public tp
227 {
228 
229  // ===========================================================
231  // ===========================================================
233 
234 public:
235 
239  static const poset_path& standard_schema_path();
240 
244  static void make_standard_schema(namespace_poset& xns);
245 
251  static host_type& new_host(namespace_type& xns,
252  const poset_path& xhost_path,
253  const poset_path& xschema_path,
254  const poset_path& xvector_space_path,
255  bool xauto_access);
256 
257 protected:
258 
259 private:
260 
262 
263 
264  //============================================================================
266  //============================================================================
268 
269 public:
270 
276  enum static_const_int {P = 2};
277 
282 
286  t2();
287 
291  t2(const t2& xother);
292 
296  virtual t2& operator=(const abstract_poset_member& xother);
297 
301  t2& operator=(const t2& xother);
302 
306  virtual ~t2();
307 
311  virtual const volatile_type& lite_prototype() const;
312 
316  virtual volatile_type* lite_type() const;
317 
321  t2(poset* xhost, bool xauto_access = true);
322 
327  t2(const poset* xhost, pod_index_type xhub_id);
328 
333  t2(const poset* xhost, const scoped_index& xid);
334 
339  t2(const poset* xhost, const std::string& xname);
340 
345  virtual int index_for_row_column(int xrow, int xcolumn) const;
346 
347 
348 protected:
349 private:
350 
352 
353 
354  //============================================================================
356  //============================================================================
358 
359 public:
360 
361 protected:
362 
363 private:
364 
366 
367 
368  //============================================================================
370  //============================================================================
372 
373 public:
374 
375  using tp::component;
376  using tp::put_component;
377 
381  value_type component(int xrow, int xcolumn) const;
382 
386  value_type component(int xrow, int xcolumn, bool xauto_access) const;
387 
391  void put_component(int xrow, int xcolumn, value_type xvalue);
392 
396  void put_component(int xrow, int xcolumn, value_type xvalue, bool xauto_access);
397 
398 protected:
399 private:
400 
402 
403 
404  //============================================================================
406  //============================================================================
408 
409 public:
410 
411 protected:
412 
413 private:
414 
416 
417 
418  //============================================================================
420  //============================================================================
422 
423 public:
424 
428  virtual const std::string& class_name() const;
429 
433  static const std::string& static_class_name();
434 
438  virtual t2* clone() const;
439 
445  inline t2* clone(bool xnew_state, bool xauto_access = true) const
446  {
447  return static_cast<t2*>(tp::clone(xnew_state, xauto_access));
448  }
449 
450 protected:
451 private:
452 
454 
455 
456  //============================================================================
458  //============================================================================
460 
461 public:
462 
466  virtual bool invariant() const;
467 
471  virtual bool is_ancestor_of(const any* other) const;
472 
473 protected:
474 private:
475 
477 };
478 
479 //==============================================================================
480 // NON-MEMBER FUNCTIONS
481 //==============================================================================
482 
483 class at0;
484 class at0_lite;
485 class at1;
486 class at1_lite;
487 class at2;
488 class at2_lite;
489 class st2;
490 class st2_lite;
491 
492 //==============================================================================
493 // TP FACET
494 //==============================================================================
495 
496 namespace tp_algebra
497 {
498 
506 SHEAF_DLL_SPEC void contract(const t2_lite& x0, int xp, int xq, at0_lite& xresult);
507 
515 SHEAF_DLL_SPEC void contract(const t2& x0, int xp, int xq, at0& xresult,
516  bool xauto_access);
517 
522 SHEAF_DLL_SPEC void alt(const t2_lite& x0, at2_lite& xresult);
523 
528 SHEAF_DLL_SPEC void alt(const t2& x0, at2& xresult, bool xauto_access);
529 
534 SHEAF_DLL_SPEC void alt(const t2_lite& x0, t2_lite& xresult);
535 
540 SHEAF_DLL_SPEC void sym(const t2_lite& x0, st2_lite& xresult);
541 
546 SHEAF_DLL_SPEC void sym(const t2& x0, st2& xresult, bool xauto_access);
547 
552 SHEAF_DLL_SPEC void sym(const t2_lite& x0, t2_lite& xresult);
553 
558 SHEAF_DLL_SPEC void sym(const t2& x0, t2& xresult, bool xauto_access);
559 
564 SHEAF_DLL_SPEC void tensor(const at1_lite& x0, const at1_lite& x1, t2_lite& xresult);
565 
570 SHEAF_DLL_SPEC void tensor(const at1& x0, const at1& x1, t2& xresult, bool xauto_access);
571 
572 } // namespace tp_algebra
573 
574 } // namespace fiber_bundle
575 
576 #endif // ifndef T2_H
t2_lite volatile_type
The associated volatile type.
Definition: t2.h:281
static_const_int
The tensor degree (static version)
Definition: t2.h:276
void alt(const GT &x0, AT &xresult, bool xauto_access)
Definition: sec_tp.impl.h:140
vd_value_type value_type
The type of component in the fiber; the scalar type in the fiber vector space.
Definition: vd.h:129
void sym(const GT &x0, ST &xresult, bool xauto_access)
Definition: sec_tp.impl.h:184
The default name space; a poset which contains other posets as members.
A general antisymmetric tensor of degree 1 over an abstract vector space (persistent version)...
Definition: at1.h:211
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
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
A tensor of degree 2 over an abstract vector space (volatile version).
Definition: t2.h:43
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
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
static_const_int
The tensor degree (static version)
Definition: t2.h:122
A general symmetric tensor of degree 2 over an abstract vector space (volatile version).
Definition: st2.h:43
A client handle for a mutable partially ordered set.
Definition: poset.h:40
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
Antisymetric tensor of degree 0 (volatile version).
Definition: at0.h:127
virtual value_type component(int xindex) const
The value of the xi-th component.
Definition: vd.cc:1115
SHEAF_DLL_SPEC tensor_variance contract(const tensor_variance &x0, int xp, int xq)
The variance of the contration of a tensor with variance x0 on indices xp and xq. ...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
void put_component(int xindex, value_type xcomp)
Set the xindex-th component to xcomp.
Definition: vd.cc:230
virtual tp * clone() const
Make a new handle, no state instance of current.
Definition: tp.cc:1363
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
t2 * 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: t2.h:445
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.
virtual void put_component(int xindex, value_type xvalue)
Sets the value of the xindex-th component to xvalue.
Definition: vd.cc:1169
An abstract tensor space of degree p.
Definition: tp_space.h:47
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
A general antisymmetric tensor of degree 2 over an abstract vector space.
Definition: at2.h:233
void tensor(const S0 &x0, const S1 &x1, SR &xresult, bool xauto_access)
Definition: sec_tp.impl.h:228
A tensor of degree 2 over an abstract vector space (persistent version).
Definition: t2.h:226