Sequoia
|
Dual vector spaces and various generalizations. More...
Classes | |
struct | sequoia::maths::dual< class > |
Primary class template for defining duals. More... | |
struct | sequoia::maths::dual< C > |
Specialization for defining duals of convex spaces via convex functionals. More... | |
struct | sequoia::maths::dual< A > |
Specialization for defining duals of affine spaces via convex functionals. More... | |
struct | sequoia::maths::dual< V > |
Specialization for defining duals of vector spaces via linear functionals. More... | |
struct | sequoia::maths::is_dual< T > |
Helper to detect if a type is defined as a dual of something else. More... | |
struct | sequoia::maths::dual_of< T > |
Helper to generate the dual of a space, taking into account that the dual of the dual may be related to the original space. More... | |
Dual vector spaces and various generalizations.
When considering relationships between vector spaces, linear maps play a central role. These are such that
f(x + y) -> f(x) + f(y)
and are structure-preserving: both vector addition and scalar multiplication survive. Therefore, linear maps may be recognized as homomorphisms between vector spaces. Note that the space of linear mappings may equivalently be called the space of linear functionals.
Given a vector space, V, over a field F, the space of linear mappings from V to F is of particular importance and is known as the dual space V*. In this context - as the target of a homomorphism - F is considered to be a vector space.
Since dual vector space are just vector spaces, we may handle these within the approach introduced above. In particular, we know both the field and dimension of the dual space: these are simply those of the original vector space. The set underlying the dual vector space seems more problematic: how do we represent the set of linear functionals? But actually, this is not an issue within our approach since all we are required to do is name the strcuture and not attempt the far more difficult task of somehow specifying the elements. It is therefore sufficient for our purposes to create a class template, linear_functionals, the template parameters of which specify the spaces between which it maps.
This construction has an analogue for modules, with the field associated with a vector space relaxed to a ring. However, the situation is not so simple for the other structures we consider: affine and convex spaces. In this case, rather the linear functionals which satisfy the above equation, we consider the more general convex functionals:
f(lambda x + (1 - lambda) y) = lambda f(x) + (1 - lambda) f(y),
with 0 <= lambda <= 1.
For vector spaces, the dual of the dual is isomorphic to the original space. From the perspective of C++, given a type T we shall identify the dual of the dual of T as just t itself. However, clients may override this behaviour through template specialization if a more precise statement of the relationship is required. Indeed, for general modules this does not hold and so care must be taken.