MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
pbqp::Cost Class Reference

A saturating cost; Cost::inf forbids an option or option pair. More...

#include <pbqp/graph.h>

Public Types

using Rep = int32_t

Public Member Functions

constexpr Cost ()=default
constexpr Cost (Rep value)
constexpr Rep value () const
constexpr bool is_inf () const
constexpr operator Rep () const
constexpr Cost & operator+= (Cost rhs)

Static Public Member Functions

static constexpr Cost inf ()
static constexpr Cost min ()

Friends

constexpr auto operator<=> (Cost, Cost)=default
constexpr Cost operator+ (Cost lhs, Cost rhs)
 Any sign; saturates and Cost::inf absorbs.
std::ostream & operator<< (std::ostream &out, Cost cost)
 Prints Cost::inf as inf.

Detailed Description

A saturating cost; Cost::inf forbids an option or option pair.

Definition at line 31 of file graph.h.

Member Typedef Documentation

◆ Rep

using pbqp::Cost::Rep = int32_t

Definition at line 33 of file graph.h.

Constructor & Destructor Documentation

◆ Cost() [1/2]

pbqp::Cost::Cost ( )
constexprdefault

◆ Cost() [2/2]

pbqp::Cost::Cost ( Rep value)
inlineconstexpr

Definition at line 36 of file graph.h.

References value().

Member Function Documentation

◆ inf()

constexpr Cost pbqp::Cost::inf ( )
inlinestaticnodiscardconstexpr

Definition at line 39 of file graph.h.

References Cost().

Referenced by mim::plug::mach::ISel::analyze(), and operator+.

◆ is_inf()

bool pbqp::Cost::is_inf ( ) const
inlinenodiscardconstexpr

Definition at line 43 of file graph.h.

Referenced by operator+.

◆ min()

constexpr Cost pbqp::Cost::min ( )
inlinestaticnodiscardconstexpr

Definition at line 40 of file graph.h.

References Cost().

Referenced by operator+.

◆ operator Rep()

pbqp::Cost::operator Rep ( ) const
inlineexplicitconstexpr

Definition at line 44 of file graph.h.

◆ operator+=()

Cost & pbqp::Cost::operator+= ( Cost rhs)
inlineconstexpr

Definition at line 55 of file graph.h.

References Cost().

◆ value()

Rep pbqp::Cost::value ( ) const
inlinenodiscardconstexpr

Definition at line 42 of file graph.h.

Referenced by Cost().

◆ operator+

Cost operator+ ( Cost lhs,
Cost rhs )
friend

Any sign; saturates and Cost::inf absorbs.

Definition at line 49 of file graph.h.

References Cost(), inf(), is_inf(), and min().

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
Cost cost )
friend

Prints Cost::inf as inf.

Definition at line 10 of file graph.cpp.

References Cost(), and operator<<.

Referenced by operator<<.

◆ operator<=>

auto operator<=> ( Cost ,
Cost  )
friend

References Cost().


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