20 #ifndef SEC_MET_IMPL_H 21 #define SEC_MET_IMPL_H 23 #ifndef SHEAF_DLL_SPEC_H 24 #include "SheafSystem/sheaf_dll_spec.h" 27 #ifndef ASSERT_CONTRACT_H 28 #include "SheafSystem/assert_contract.h" 32 #include "SheafSystem/sec_met.h" 45 template <
typename VMET,
typename VVECTOR,
typename VR>
47 lower_functor<VMET, VVECTOR, VR>::
48 operator()(
const VMET& xmet,
const VVECTOR& xvector, VR& xresult)
52 require(precondition_of(
lower(xmet, xvector, xresult)));
56 lower(xmet, xvector, xresult);
60 ensure(postcondition_of(
lower(xmet, xvector, xresult)));
68 template <
typename VMET,
typename VCOVECTOR,
typename VR>
70 raise_functor<VMET, VCOVECTOR, VR>::
71 operator()(
const VMET& xmet,
const VCOVECTOR& xcovector, VR& xresult)
75 require(precondition_of(
raise(xmet, xcovector, xresult)));
79 raise(xmet, xcovector, xresult);
83 ensure(postcondition_of(
raise(xmet, xcovector, xresult)));
94 template <
typename SMET,
typename SVECTOR,
typename SR>
95 void lower(
const SMET& xmetric,
const SVECTOR& xvector, SR& xresult,
100 require(xmetric.state_is_auto_read_accessible(xauto_access));
101 require(xvector.state_is_auto_read_accessible(xauto_access));
102 require(xresult.state_is_auto_read_write_accessible(xauto_access));
103 require(xmetric.is_covariant(0, xauto_access));
104 require(xvector.is_contravariant(0, xauto_access));
110 xmetric.get_read_access();
111 xvector.get_read_access();
112 xresult.get_read_write_access(
true);
115 typedef typename SMET::fiber_type::volatile_type VMET;
116 typedef typename SVECTOR::fiber_type::volatile_type VVECTOR;
117 typedef typename SR::fiber_type::volatile_type VR;
118 lower_functor<VMET, VVECTOR, VR> f;
119 binary_op(xmetric, xvector, xresult, f, xauto_access);
124 xresult.put_is_p_form(
false);
128 xmetric.release_access();
129 xvector.release_access();
130 xresult.release_access();
135 ensure(xresult.is_covariant(0, xauto_access));
144 template <
typename SMET,
typename SCOVECTOR,
typename SR>
145 void raise(
const SMET& xmetric,
const SCOVECTOR& xcovector, SR& xresult,
150 require(xmetric.state_is_auto_read_accessible(xauto_access));
151 require(xcovector.state_is_auto_read_accessible(xauto_access));
152 require(xresult.state_is_auto_read_write_accessible(xauto_access));
153 require(xmetric.is_contravariant(0, xauto_access));
154 require(xcovector.is_covariant(0, xauto_access));
160 xmetric.get_read_access();
161 xcovector.get_read_access();
162 xresult.get_read_write_access(
true);
165 typedef typename SMET::fiber_type::volatile_type VMET;
166 typedef typename SCOVECTOR::fiber_type::volatile_type VCOVECTOR;
167 typedef typename SR::fiber_type::volatile_type VR;
168 raise_functor<VMET, VCOVECTOR, VR> f;
169 binary_op(xmetric, xcovector, xresult, f, xauto_access);
173 xresult.put_is_p_vector(
false);
177 xmetric.release_access();
178 xcovector.release_access();
179 xresult.release_access();
184 ensure(xresult.is_contravariant(0, xauto_access));
194 #endif // ifndef SEC_MET_IMPL_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.
void binary_op(const S0 &x0, const S1 &x1, SR &xresult, F xfunctor, bool xauto_access)
Binary operator.
Namespace for the fiber_bundles component of the sheaf system.