SheafSystem  0.0.0.0
met.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 MET_H
22 #define MET_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ST2_H
29 #include "SheafSystem/st2.h"
30 #endif
31 
32 namespace fiber_bundle
33 {
34 
35 //==============================================================================
36 // CLASS MET_LITE
37 //==============================================================================
38 
43 class SHEAF_DLL_SPEC met_lite : public st2_lite
44 {
45  //============================================================================
47  //============================================================================
49 
50 public:
51 
55  met_lite();
56 
60  met_lite(const met_lite& xother);
61 
65  met_lite& operator=(const met_lite& xother);
66 
70  virtual ~met_lite();
71 
75  met_lite(const row_dofs_type& xrow_dofs);
76 
80  met_lite& operator=(const row_dofs_type& xrow_dofs);
81 
82 protected:
83 private:
84 
86 
87 
88  //============================================================================
90  //============================================================================
92 
93 public:
94 protected:
95 private:
96 
98 
99 
100  //============================================================================
102  //============================================================================
104 
105 public:
106 protected:
107 private:
108 
110 
111 
112  //============================================================================
114  //============================================================================
116 
117 public:
118 protected:
119 private:
120 
122 
123 
124  //============================================================================
126  //============================================================================
128 
129 public:
130 protected:
131 private:
132 
134 
135 
136  //============================================================================
138  //============================================================================
140 
141 public:
142 protected:
143 private:
144 
146 
147 
148  //============================================================================
150  //============================================================================
152 
153 public:
154 
158  virtual const std::string& class_name() const;
159 
163  static const std::string& static_class_name();
164 
168  virtual met_lite* clone() const;
169 
170 protected:
171 private:
172 
174 
175 
176  //============================================================================
178  //============================================================================
180 
181 public:
182 
186  virtual bool is_ancestor_of(const any_lite& xother) const;
187 
191  bool invariant() const;
192 
193 protected:
194 private:
195 
197 };
198 
199 
200 //==============================================================================
201 // CLASS MET
202 //==============================================================================
203 
208 class SHEAF_DLL_SPEC met : public st2
209 {
210 
211  // ===========================================================
213  // ===========================================================
215 
216 public:
217 
222 
226  static const poset_path& standard_schema_path();
227 
231  static void make_standard_schema(namespace_poset& xns);
232 
238  static host_type& new_host(namespace_type& xns,
239  const poset_path& xhost_path,
240  const poset_path& xschema_path,
241  const poset_path& xvector_space_path,
242  bool xauto_access);
243 
244 protected:
245 
246 private:
247 
249 
250 
251  //============================================================================
253  //============================================================================
255 
256 public:
257 
262 
266  met();
267 
272  met(const poset_state_handle* xhost, pod_index_type xhub_id);
273 
278  met(const poset_state_handle* xhost, const scoped_index& xid);
279 
284  met(const poset_state_handle* xhost, const std::string& xname);
285 
289  explicit met(abstract_poset_member* xother);
290 
294  met(poset_state_handle* xhost, bool xauto_access = true);
295 
299  virtual met& operator=(const abstract_poset_member& xother);
300 
304  met& operator=(const met& xother);
305 
309  ~met();
310 
314  virtual const volatile_type& lite_prototype() const;
315 
319  virtual volatile_type* lite_type() const;
320 
321 
322 protected:
323 private:
324 
326 
327 
328  //============================================================================
330  //============================================================================
332 
333 public:
334 protected:
335 private:
336 
338 
339 
340  //============================================================================
342  //============================================================================
344 
345 public:
346 protected:
347 private:
348 
350 
351 
352  //============================================================================
354  //============================================================================
356 
357 public:
358 protected:
359 private:
360 
362 
363 
364  //============================================================================
366  //============================================================================
368 
369 public:
370 protected:
371 private:
372 
374 
375 
376  //============================================================================
378  //============================================================================
380 
381 public:
382 
383 protected:
384 
385 private:
386 
388 
389 
390  //============================================================================
392  //============================================================================
394 
395 public:
396 
400  virtual const std::string& class_name() const;
401 
405  static const std::string& static_class_name();
406 
410  virtual met* clone() const;
411 
417  inline met* clone(bool xnew_state, bool xauto_access = true) const
418  {
419  return static_cast<met*>(st2::clone(xnew_state, xauto_access));
420  }
421 
422 protected:
423 private:
424 
426 
427 
428  //============================================================================
430  //============================================================================
432 
433 public:
434 
438  bool is_ancestor_of(const any* xother) const;
439 
440 
444  bool invariant() const;
445 
446 protected:
447 private:
448 
450 };
451 
452 //==============================================================================
453 // NON-MEMBER FUNCTIONS
454 //==============================================================================
455 
456 class ed;
457 class ed_lite;
458 
463 namespace met_algebra
464 {
465 
469 SHEAF_DLL_SPEC void raise(const met& xmetric, const ed& xcovector, ed& xresult,
470  bool xauto_access);
471 
475 SHEAF_DLL_SPEC void lower(const met& xmetric, const ed& xvector, ed& xresult,
476  bool xauto_access);
477 
481 SHEAF_DLL_SPEC void raise(const met_lite& xmetric, const ed_lite& xcovector, ed_lite& xresult);
482 
486 SHEAF_DLL_SPEC ed_lite* raise(const met_lite& xmetric, const ed_lite& xcovector);
487 
491 SHEAF_DLL_SPEC void lower(const met_lite& xmetric, const ed_lite& xvector, ed_lite& xresult);
492 
496 SHEAF_DLL_SPEC ed_lite* lower(const met_lite& xmetric, const ed_lite& xvector);
497 
498 } // namespace met_algebra
499 
500 } // namespace fiber_bundle
501 
502 #endif // ifndef MET_H
SHEAF_DLL_SPEC tensor_variance lower(const tensor_variance &x0, int xi)
The variance of the lower of a tensor with variance x0 on index xi.
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
met * 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: met.h:417
virtual st2 * clone() const
Make a new handle, no state instance of current.
Definition: st2.cc:999
A metric tensor over an abstract vector space (volatile version).
Definition: met.h:43
A metric tensor over an abstract vector space (persistent version).
Definition: met.h:208
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
Euclidean vector space of dimension d (volatile version).
Definition: ed.h:44
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
Euclidean vector space of dimension d (peresistent version).
Definition: ed.h:210
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
stp_space host_type
The type of host poset.
Definition: met.h:221
met_lite volatile_type
The associated volatile type.
Definition: met.h:261
An abstract client handle for a member of a poset.
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