Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::linear_algebra::SemimoduleVec< S, N, Orientation > Struct Template Referenceexport

An N-entry semimodule vector over the semiring S, read as an index→scalar arrow. IsColumnVector / IsCovector by the default (semimodule) contract: ⊕ and the two-sided scalar ⊗ action, but no negation (a dioid has none). Ket (ColumnOrientation, |v⟩) and Bra (RowOrientation, ⟨w|) are its two orientations — the bra·ket language of :transfer made first-class carriers, the "matrix column/row @b is a vector" slogan for a semiring. One carrier, orientation as a template parameter (the tag is the only difference between a column and a row). More...

Collaboration diagram for dedekind::linear_algebra::SemimoduleVec< S, N, Orientation >:

Public Types

using scalar_type = S
using orientation = Orientation
using dimension_type = dedekind::sets::Finite
using Domain = std::size_t
 A vector is an index→scalar arrow, so Ket / Bra are IsArrow — they feed :transfer's inner_product / OuterProduct directly, retiring the ad-hoc bra/ket structs.
using Codomain = S

Public Member Functions

constexpr S operator() (std::size_t i) const
constexpr S operator[] (std::size_t i) const

Public Attributes

std::array< S, N > c {}

Static Public Attributes

static constexpr std::size_t dimension = N
template<typename Op>
static constexpr bool is_associative_v
 The additive monoid (·, ⊕) inherits the scalar's laws (§4 property distribution): the elementwise ⊕ is associative / commutative exactly when the base ⊕ is, and only for the vector's own std::plus — an arbitrary Op is not certified. Totality distributes separately (is_saturating below).
template<typename Op>
static constexpr bool is_commutative_v

Friends

constexpr bool operator== (const SemimoduleVec &, const SemimoduleVec &)=default
constexpr SemimoduleVec operator+ (const SemimoduleVec &a, const SemimoduleVec &b)
constexpr SemimoduleVec operator* (const S &s, const SemimoduleVec &a)
constexpr SemimoduleVec operator* (const SemimoduleVec &a, const S &s)

Detailed Description

template<typename S, std::size_t N, typename Orientation>
struct dedekind::linear_algebra::SemimoduleVec< S, N, Orientation >

An N-entry semimodule vector over the semiring S, read as an index→scalar arrow. IsColumnVector / IsCovector by the default (semimodule) contract: ⊕ and the two-sided scalar ⊗ action, but no negation (a dioid has none). Ket (ColumnOrientation, |v⟩) and Bra (RowOrientation, ⟨w|) are its two orientations — the bra·ket language of :transfer made first-class carriers, the "matrix column/row @b is a vector" slogan for a semiring. One carrier, orientation as a template parameter (the tag is the only difference between a column and a row).

Member Data Documentation

◆ is_associative_v

template<typename S, std::size_t N, typename Orientation>
template<typename Op>
bool dedekind::linear_algebra::SemimoduleVec< S, N, Orientation >::is_associative_v
staticconstexpr
Initial value:
=
std::same_as<Op, std::plus<SemimoduleVec>> &&
typename dedekind::algebra::semiring_ops<S>::add{})
constexpr bool associative(Op)
The laws as functions of the operation: associative<T>(Op{}), commutative<T>(Op{}),...
Definition species.cppm:384

The additive monoid (·, ⊕) inherits the scalar's laws (§4 property distribution): the elementwise ⊕ is associative / commutative exactly when the base ⊕ is, and only for the vector's own std::plus — an arbitrary Op is not certified. Totality distributes separately (is_saturating below).

◆ is_commutative_v

template<typename S, std::size_t N, typename Orientation>
template<typename Op>
bool dedekind::linear_algebra::SemimoduleVec< S, N, Orientation >::is_commutative_v
staticconstexpr
Initial value:
=
std::same_as<Op, std::plus<SemimoduleVec>> &&
dedekind::category::commutative<S>(
typename dedekind::algebra::semiring_ops<S>::add{})

The documentation for this struct was generated from the following file: