Sequoia
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
sequoia::maths::weighting< WeightHandler, IndexType > Class Template Reference

A class to store non-trivial edge weights. More...

#include <Edge.hpp>

Public Types

using weight_handler_type = WeightHandler
 
using weight_type = typename WeightHandler::value_type
 

Public Member Functions

constexpr const weight_type & weight () const noexcept
 
constexpr weight_type & weight () noexcept
 
constexpr void weight (weight_type w)
 
template<class... Args>
requires ((sizeof...(Args) > 0) && is_initializable_v<weight_type, Args...>)
constexpr void weight (Args &&... args)
 
template<std::invocable< weight_type & > Fn>
constexpr std::invoke_result_t< Fn, weight_type & > mutate_weight (Fn fn)
 

Protected Member Functions

template<class... Args>
requires (!resolve_to_copy_v<weighting, Args...>)
constexpr explicit (sizeof...(Args)==1) weighting(Args &&... args)
 
constexpr weighting (const weighting &other)
 
template<class Other >
requires std::is_base_of_v<weighting, std::remove_cvref_t<Other>>
constexpr weighting (Other &&other)
 
constexpr weighting (weighting &&) noexcept=default
 
constexpr weightingoperator= (const weighting &other)
 
constexpr weightingoperator= (weighting &&) noexcept=default
 

Friends

constexpr bool operator== (const weighting &lhs, const weighting &rhs) noexcept
 

Detailed Description

template<class WeightHandler, std::integral IndexType>
requires object::handler<WeightHandler>
class sequoia::maths::weighting< WeightHandler, IndexType >

A class to store non-trivial edge weights.

This class is designed to wrap an edge but in a manner which is flexible enough to support the sharing of weights between edges. The latter is used for undirected graphs where two partial edges representing the pair of links between two vertices may wish to share the common weight, particularly if it is expensive to store twice. The sharing of weights between distinct edges is done at the level of the graph.


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