Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::numbers::Cut< Q > Class Template Referenceexport

A decidable Dedekind real: a principal rational cut or a rational radical \(\pm\sqrt{c}\). More...

Public Types

using Domain = Cut
using ScalarCarrier = Q

Public Member Functions

constexpr Cut ()=default
 The additive identity \(0\) (principal cut at \(0\)).
constexpr Cut (Q value)
 A rational is a real: its principal cut. Implicit, so \(\mathbb{Q}\hookrightarrow\) Cut is spelled by ordinary assignment.
template<typename V>
requires (!std::same_as<V, Q> && std::convertible_to<V, Q>)
constexpr Cut (V v)
 Single-step implicit lift V → Q → Cut (e.g. an int literal names the principal cut at that integer).
constexpr Cut operator- () const
 Additive reflection \(-x\): negate the rational, or flip the root's sign.
constexpr bool contains (const Q &q) const
 Is the rational q strictly below this real ( \(q\in\) the lower cut)? The decidable membership query the cut is defined by: the χ of lower_set(*this).

Static Public Member Functions

static constexpr Cut sqrt (Q radicand)
 The radical real \(\sqrt{c}\) (requires \(c\ge 0\); a perfect square is admitted — it simply compares == to its rational root).

Friends

constexpr std::strong_ordering operator<=> (const Cut &a, const Cut &b)
 The order on reals is cut-inclusion, decided exactly on the leaf shapes. Everything else (<, >, <=, >=, ==) derives.
constexpr bool operator== (const Cut &a, const Cut &b)

Detailed Description

template<typename Q = Rational<default_integer>>
requires IsRational<Q>
class dedekind::numbers::Cut< Q >

A decidable Dedekind real: a principal rational cut or a rational radical \(\pm\sqrt{c}\).

Template Parameters
Qthe rational scalar carrier (defaults to \(\mathbb{Q}\)). Only its ordered-ring surface is used (*, unary -, <=>, Q{}), so every decision is exact.

The documentation for this class was generated from the following file:
  • src/main/modules/dedekind/numbers/cut.cppm