Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::johnson_detail::Wide Struct Reference

An integer of 128 bits, in two words of 64. More...

#include <Johnson.H>

Collaboration diagram for Aleph::johnson_detail::Wide:
[legend]

Static Public Member Functions

template<std::integral T>
static constexpr Wide of (const T x) noexcept
 The integer x, in two's complement.
 
static constexpr bool signed_less (const Wide &a, const Wide &b) noexcept
 Whether a < b, as integers in two's complement.
 

Public Attributes

std::uint64_t hi = 0
 The high word.
 
std::uint64_t lo = 0
 The low word.
 

Friends

constexpr Wide operator+ (const Wide &a, const Wide &b) noexcept
 a + b, modulo 2^128
 
constexpr Wide operator- (const Wide &a, const Wide &b) noexcept
 a - b, modulo 2^128
 
constexpr bool operator== (const Wide &a, const Wide &b) noexcept=default
 Whether a and b are the same integer.
 
constexpr bool operator< (const Wide &a, const Wide &b) noexcept
 Whether a < b, as unsigned integers.
 

Detailed Description

An integer of 128 bits, in two words of 64.

Johnson keeps in it the potentials, the new weights and the sums of Dijkstra when a potential is below lowest(), which only a signed integer type of up to 64 bits has: they fit in it. Its operations are those of the unsigned integers modulo 2^128, and signed_less() compares two of them as integers in two's complement, as the potentials are.

Definition at line 107 of file Johnson.H.

Member Function Documentation

◆ of()

template<std::integral T>
static constexpr Wide Aleph::johnson_detail::Wide::of ( const T  x)
inlinestaticconstexprnoexcept

◆ signed_less()

static constexpr bool Aleph::johnson_detail::Wide::signed_less ( const Wide &  a,
const Wide &  b 
)
inlinestaticconstexprnoexcept

Friends And Related Symbol Documentation

◆ operator+

constexpr Wide operator+ ( const Wide &  a,
const Wide &  b 
)
friend

a + b, modulo 2^128

Definition at line 124 of file Johnson.H.

◆ operator-

constexpr Wide operator- ( const Wide &  a,
const Wide &  b 
)
friend

a - b, modulo 2^128

Definition at line 131 of file Johnson.H.

◆ operator<

constexpr bool operator< ( const Wide &  a,
const Wide &  b 
)
friend

Whether a < b, as unsigned integers.

Definition at line 141 of file Johnson.H.

◆ operator==

constexpr bool operator== ( const Wide &  a,
const Wide &  b 
)
friend

Whether a and b are the same integer.

Member Data Documentation

◆ hi

std::uint64_t Aleph::johnson_detail::Wide::hi = 0

The high word.

Definition at line 109 of file Johnson.H.

Referenced by signed_less().

◆ lo

std::uint64_t Aleph::johnson_detail::Wide::lo = 0

The low word.

Definition at line 110 of file Johnson.H.

Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_unweighted().


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