21 #include "SheafSystem/stp.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/at1.h" 26 #include "SheafSystem/at1_space.h" 27 #include "SheafSystem/fiber_bundles_namespace.h" 28 #include "SheafSystem/schema_poset_member.h" 29 #include "SheafSystem/stp_space.h" 30 #include "SheafSystem/wsv_block.h" 133 vd_lite::operator=(xrow_dofs);
137 postcondition_of(vd_lite::operator=(xrow_dofs));
170 if(dd()+p()-1 >= p())
226 const string& result = static_class_name();
230 ensure(!result.empty());
245 static const string result(
"stp_lite");
249 ensure(!result.empty());
271 ensure(is_same_type(*result));
295 require(&xother != 0);
301 bool result =
dynamic_cast<const stp_lite*
>(&xother) != 0;
314 if(invariant_check())
318 disable_invariant_check();
322 invariance(tp_lite::invariant());
328 enable_invariant_check();
361 static const poset_path result(standard_schema_poset_name(),
"stp_schema");
365 ensure(result.
full());
366 ensure(result.
poset_name() == standard_schema_poset_name());
386 standard_schema_path().member_name(),
387 tp::standard_schema_path(),
391 lschema.detach_from_state();
417 require(!xhost_path.
empty());
420 require(xschema_path.
full());
422 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
427 require(host_type::d(xns, xschema_path, xauto_access) == host_type::d(xns, xp, xvector_space_path, xauto_access));
432 host_type::new_table(xns, xhost_path, xschema_path, xp, xvector_space_path, xauto_access);
436 ensure(xns.
owns(result, xauto_access));
437 ensure(result.
path(
true) == xhost_path);
439 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
441 ensure(result.
factor_ct(
true) == result.
d(
true));
442 ensure(result.
d(
true) == host_type::d(xns, xschema_path, xauto_access));
444 ensure(result.
p(
true) == xp);
488 attach_to_state(xhost, xhub_id);
494 ensure(index() == xhub_id);
495 ensure(is_attached());
509 attach_to_state(xhost, xid.
hub_pod());
515 ensure(index() ==~ xid);
516 ensure(is_attached());
527 require(!xname.empty());
532 attach_to_state(xhost, xname);
538 ensure(name() == xname);
539 ensure(is_attached());
549 require(xother != 0);
553 attach_to_state(xother);
558 ensure(is_attached());
559 ensure(is_same_state(xother));
569 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
573 new_jim_state(xhost, 0,
false, xauto_access);
577 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
591 require(is_ancestor_of(&xother));
592 require(precondition_of(attach_to_state(&xother)));
596 attach_to_state(&xother);
600 ensure(postcondition_of(attach_to_state(&xother)));
614 require(precondition_of(attach_to_state(&xother)));
618 attach_to_state(&xother);
622 ensure(postcondition_of(attach_to_state(&xother)));
730 const string& result = static_class_name();
734 ensure(!result.empty());
749 static const string result(
"stp");
753 ensure(!result.empty());
774 return reinterpret_cast<host_type*
>(_host);
781 return dynamic_cast<const host_type*
>(xother) != 0;
802 require(xother != 0);
809 bool result =
dynamic_cast<const stp*
>(xother) != 0;
857 invariance(tp::invariant());
859 if(invariant_check())
863 disable_invariant_check();
867 invariance(state_is_read_accessible() ? is_covariant(
false) || is_contravariant(
false) :
true);
871 enable_invariant_check();
876 ensure(is_derived_query);
902 require(x1.
dd() == x0.
dd());
903 require(xresult.
dd() == x0.
dd());
904 require(xresult.
p() == x0.
p() + x1.
p());
928 require(xresult.
p(xauto_access) == x0.
p(xauto_access) + x1.
p(xauto_access));
virtual int dd() const
Dimension of the underlying vector space.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
static const std::string & static_class_name()
The name of this class.
A symmetric tensor of degree p over an abstract vector space.
bool full() const
True if both poset name and member name are not empty.
virtual int p() const
The degree of the tensors in host(); the sum of the contravariant and covariant degrees.
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
poset_path vector_space_path() const
The path of the underlying vector space.
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
A client handle for a general, abstract partially order set.
virtual ~stp_lite()
Destructor.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual stp & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
SHEAF_DLL_SPEC void symmetric_product(const stp_lite &x0, const stp_lite &x1, stp_lite &xresult)
Symmetric product (pre-allocated version for volatile types).
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
SHEAF_DLL_SPEC unsigned int binomial_coefficient(unsigned int xi, unsigned int xj)
Binomial coefficient (xi, xj).
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
stp_lite()
Default constructor.
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
virtual int p() const
The degree of the tensor; the sum of the contravariant and covariant degrees.
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
virtual int d() const
Dimension of this as a vector space.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual const std::string & class_name() const
The name of this class.
virtual stp_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
host_type * host() const
The poset this is a member of.
An index within the external ("client") scope of a given id space.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
std::string poset_name() const
The poset name part of the path.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
virtual stp * clone() const
Make a new handle, no state instance of current.
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
bool empty() const
True if both poset name and member name are empty.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, int xp, const poset_path &xvector_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
stp()
Default constructor.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
stp_lite & operator=(const stp_lite &xother)
Assignment operator.
virtual const std::string & class_name() const
The name of this class.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
int_type pod_index_type
The plain old data index type.
int dd() const
The dimension of the underlying ("domain") vector space.
An abstract client handle for a member of a poset.
static const std::string & static_class_name()
The name of this class.
bool invariant() const
Class invariant.
Namespace containing the vector algrebra functions for the fiber_bundles component of the sheaf syste...
A symmetric tensor of degree p over an abstract vector space (volatile version).
An abstract symmetric tensor space of degree p.
Namespace for the fiber_bundles component of the sheaf system.
bool invariant() const
Class invariant.
Row dofs type for class vd.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
A client handle for a poset member which has been prepared for use as a schema.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.