SheafSystem  0.0.0.0
fiber_bundle::ed_algebra Namespace Reference

Namespace containing the Euclidean vector algebra functions for the fiber_bundles component of the sheaf system. More...

Functions

SHEAF_DLL_SPEC vd_value_type dot (const ed &x0, const ed &x1, bool xauto_access)
 The Euclidean "dot" product of x0 with x1 (version for persistent types). More...
 
SHEAF_DLL_SPEC vd_value_type length (const ed &x0, bool xauto_access)
 The Euclidean length (magnitude) of x0 (version for persistent types). More...
 
SHEAF_DLL_SPEC void put_length (ed &x0, const vd_value_type &xlength, bool xauto_access)
 Set the Euclidean length (magnitude) of x0 to xlength. (version for persistent types). More...
 
SHEAF_DLL_SPEC void normalize (const ed &x0, ed &xresult, bool xauto_access)
 Normalize x0 (convert to a unit vector) (pre_allocated version for persistent types). More...
 
template<typename T >
void normalize (T &x0, bool xauto_access)
 Normalize x0 (convert to a unit vector) in place (for persistent types). More...
 
SHEAF_DLL_SPEC vd_value_type dot (const ed_lite &x0, const ed_lite &x1)
 The Euclidean "dot" product of x0 with x1 (version for volatile types). More...
 
SHEAF_DLL_SPEC vd_value_type length (const ed_lite &x0)
 The Euclidean length (magnitude) of x0 (version for volatile types). More...
 
SHEAF_DLL_SPEC void put_length (ed_lite &x0, const vd_value_type &xlength)
 Set the Euclidean length (magnitude) of x0 to xlength. (version for volatile types). More...
 
SHEAF_DLL_SPEC void normalize (const ed_lite &x0, ed_lite &xresult)
 Normalize x0 (convert to a unit vector) (pre_allocated version for volatile types). More...
 
template<typename T >
vd_value_type operator* (const T &x0, const T &x1)
 The Euclidean "dot" product of x0 with x1 (for volatile types). More...
 
template<typename T >
void normalize (T &x0)
 Normalize x0 (convert to a unit vector) in place (for volatile types). More...
 

Detailed Description

Namespace containing the Euclidean vector algebra functions for the fiber_bundles component of the sheaf system.

Function Documentation

◆ dot() [1/2]

fiber_bundle::vd_value_type fiber_bundle::ed_algebra::dot ( const ed x0,
const ed x1,
bool  xauto_access 
)

The Euclidean "dot" product of x0 with x1 (version for persistent types).

Precondition
  • x0.state_is_auto_read_accessible(xauto_access)
  • x1.state_is_auto_read_accessible(xauto_access)
  • x0.is_same_type(&x1)
  • x0.is_p_form(xauto_access) == x1.is_p_form(xauto_access)
Postcondition
  • -unexecutable( \ "result == sum(i, 0, x0.d(), x0.component(i) * x1.component(i)" )

Definition at line 863 of file ed.cc.

References fiber_bundle::vd::component(), fiber_bundle::vd::d(), sheaf::poset_component::get_read_access(), fiber_bundle::atp::is_p_form(), sheaf::any::is_same_type(), length(), sheaf::poset_component::release_access(), and sheaf::read_write_monitor_handle::state_is_auto_read_accessible().

Referenced by fields::field_ed_algebra::dot(), geometry::line_surface_intersecter::intersect(), fiber_bundle::sec_ed::invariant(), fiber_bundle::ed::invariant(), normalize(), and operator*().

◆ dot() [2/2]

fiber_bundle::vd_value_type fiber_bundle::ed_algebra::dot ( const ed_lite x0,
const ed_lite x1 
)

The Euclidean "dot" product of x0 with x1 (version for volatile types).

Precondition
  • x0.d() == x1.d()
Postcondition
  • -unexecutable( "result == sum(i, 0, x0.d(), x0.component(i)*x1.component(i)" )

Definition at line 1049 of file ed.cc.

References fiber_bundle::vd_lite::component(), fiber_bundle::atp_lite::d(), and length().

◆ length() [1/2]

◆ length() [2/2]

fiber_bundle::vd_value_type fiber_bundle::ed_algebra::length ( const ed_lite x0)

The Euclidean length (magnitude) of x0 (version for volatile types).

Postcondition
  • result >= 0.0
  • -unexecutable( "result == sqrt(sum(i, 0, x0.d(), x0.component(i)**2)" )

Definition at line 1076 of file ed.cc.

References fiber_bundle::vd_lite::component(), fiber_bundle::atp_lite::d(), put_length(), and fiber_bundle::sec_at0_algebra::sqrt().

◆ normalize() [1/4]

void fiber_bundle::ed_algebra::normalize ( const ed x0,
ed xresult,
bool  xauto_access 
)

Normalize x0 (convert to a unit vector) (pre_allocated version for persistent types).

Precondition
  • x0.state_is_auto_read_accessible(xauto_access)
  • xresult.state_is_auto_read_write_accessible(xauto_access)
  • x0.is_same_type(&xresult)
  • x0.is_p_form(xauto_access) == xresult.is_p_form(xauto_access)
Issue:
Do we just want to do nothing if the length of the vector is zero?
Postcondition
  • xresult.is_p_form(false) == x0.is_p_form(false)
  • -unexecutable( "length(xresult, xauto_access) == 1.0" )

Definition at line 992 of file ed.cc.

References fiber_bundle::vd::component(), fiber_bundle::vd::d(), dot(), sheaf::poset_component::get_read_access(), sheaf::poset_component::get_read_write_access(), fiber_bundle::atp::is_p_form(), sheaf::any::is_same_type(), length(), fiber_bundle::vd::put_component(), fiber_bundle::atp::put_is_p_form(), fiber_bundle::atp::put_is_p_vector(), sheaf::poset_component::release_access(), sheaf::read_write_monitor_handle::state_is_auto_read_accessible(), and sheaf::read_write_monitor_handle::state_is_auto_read_write_accessible().

Referenced by fiber_bundle::sec_ed::invariant(), fields::field_ed_algebra::normalize(), fiber_bundle::sec_ed_algebra::normalize(), normalize(), and put_length().

◆ normalize() [2/4]

template<typename T >
void fiber_bundle::ed_algebra::normalize ( T &  x0,
bool  xauto_access 
)

Normalize x0 (convert to a unit vector) in place (for persistent types).

Precondition
  • precondition_of(normalize(x0, x0, xauto_access))
Postcondition
  • postcondition_of(normalize(x0, x0, xauto_access))
Precondition
  • precondition_of(normalize(x0, x0, xauto_access))
Postcondition
  • postcondition_of(normalize(x0, x0, xauto_access))

Definition at line 59 of file ed.impl.h.

References normalize().

◆ normalize() [3/4]

void fiber_bundle::ed_algebra::normalize ( const ed_lite x0,
ed_lite xresult 
)

Normalize x0 (convert to a unit vector) (pre_allocated version for volatile types).

Precondition
  • x0.is_same_type(xresult)
Issue:
Do we just want to do nothing if the length of the vector is zero?
Postcondition
  • -unexecutable( "length(xresult) == 1.0" )

Definition at line 1140 of file ed.cc.

References fiber_bundle::vd_lite::component(), fiber_bundle::atp_lite::d(), fiber_bundle::any_lite::is_same_type(), length(), and fiber_bundle::vd_lite::put_component().

◆ normalize() [4/4]

template<typename T >
void fiber_bundle::ed_algebra::normalize ( T &  x0)

Normalize x0 (convert to a unit vector) in place (for volatile types).

Precondition
  • precondition_of(normalize(x0, x0))
Postcondition
  • postcondition_of(normalize(x0, x0))
Precondition
  • precondition_of(normalize(x0, x0))
Postcondition
  • postcondition_of(normalize(x0, x0))

Definition at line 77 of file ed.impl.h.

References normalize().

◆ operator*()

template<typename T >
vd_value_type fiber_bundle::ed_algebra::operator* ( const T &  x0,
const T &  x1 
)

The Euclidean "dot" product of x0 with x1 (for volatile types).

Precondition
  • precondition_of(dot(x0, x1))
Postcondition
  • postcondition_of(dot(x0, x1))
Precondition
  • precondition_of(dot(x0, x1))
Postcondition
  • postcondition_of(dot(x0, x1))

Definition at line 39 of file ed.impl.h.

References dot().

◆ put_length() [1/2]

void fiber_bundle::ed_algebra::put_length ( ed x0,
const vd_value_type xlength,
bool  xauto_access 
)

Set the Euclidean length (magnitude) of x0 to xlength. (version for persistent types).

Precondition
  • x0.state_is_auto_read_write_accessible(xauto_access)
Postcondition
  • xlength >= 0.0
Issue:
Do we just want to do nothing if the length of the vector is zero?
Postcondition
  • -unexecutable( "length(x0, xauto_access) == xlength" )

Definition at line 947 of file ed.cc.

References fiber_bundle::vd::component(), fiber_bundle::vd::d(), sheaf::poset_component::get_read_write_access(), length(), normalize(), fiber_bundle::vd::put_component(), sheaf::poset_component::release_access(), and sheaf::read_write_monitor_handle::state_is_auto_read_write_accessible().

Referenced by fiber_bundle::sec_ed::invariant(), length(), and fields::field_ed_algebra::put_length().

◆ put_length() [2/2]

void fiber_bundle::ed_algebra::put_length ( ed_lite x0,
const vd_value_type xlength 
)

Set the Euclidean length (magnitude) of x0 to xlength. (version for volatile types).

Precondition
  • xlength >= 0.0
Issue:
Do we just want to do nothing if the length of the vector is zero?
Postcondition
  • -unexecutable( "length(x0) == xlength" )

Definition at line 1105 of file ed.cc.

References fiber_bundle::vd_lite::component(), fiber_bundle::atp_lite::d(), length(), normalize(), and fiber_bundle::vd_lite::put_component().