Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::linalg::factor_result Class Reference

Stores the result of factorization type algorithms. More...

Public Member Functions

constexpr factor_result ()=default
 Construct a result denoting success.
 
constexpr factor_result (std::size_t idx) noexcept
 Construct a result denoting failure.
 
constexpr auto has_pivot_index () const noexcept -> bool
 Query whether the factorization failed.
 
constexpr operator bool () const noexcept
 Query whether the factorization succeeded.
 
constexpr auto pivot_index () const noexcept -> std::size_t
 Obtain the pivot index.
 

Detailed Description

Stores the result of factorization type algorithms.

A factor_result contains an optional pivot index signaling either success or failure of the corresponding factorization algorithm. On success, a factor_result does not have a pivot index. On failure, a factor_result has a pivot index which specifies the first bad pivot encountered during factorization, that is the pivot that caused factorization to fail.

Note
A factor_result cannot represent a pivot index with value std::numeric_limits<std::size_t>::max().

Constructor & Destructor Documentation

◆ factor_result() [1/2]

arene::base::linalg::factor_result::factor_result ( )
constexprdefault

Construct a result denoting success.

Postcondition
has_pivot_index() is false

◆ factor_result() [2/2]

arene::base::linalg::factor_result::factor_result ( std::size_t idx)
inlineexplicitconstexprnoexcept

Construct a result denoting failure.

Parameters
idxIndex of the first bad pivot encountered during factorization
Precondition
idx != std::numeric_limits<std::size_t>::max(), otherwise ARENE_PRECONDITION violation
Postcondition
has_pivot_index() is true and pivot_index() is idx

Member Function Documentation

◆ has_pivot_index()

auto arene::base::linalg::factor_result::has_pivot_index ( ) const -> bool
inlineconstexprnoexcept

Query whether the factorization failed.

Returns
true if the factorization failed, that is if there is a pivot index

◆ operator bool()

arene::base::linalg::factor_result::operator bool ( ) const
inlineexplicitconstexprnoexcept

Query whether the factorization succeeded.

Returns
true if the factorization succeeded, that is if there is no pivot index

◆ pivot_index()

auto arene::base::linalg::factor_result::pivot_index ( ) const -> std::size_t
inlineconstexprnoexcept

Obtain the pivot index.

Precondition
has_pivot_index() is true, otherwise ARENE_PRECONDITION violation
Returns
Index of the first bad pivot encountered during factorization

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