PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
|
This class encapsulates a value that may be a default value or not. More...
#include <default_value.hpp>
Public Types | |
using | value_type = T |
The type encapsulated by this default_value. | |
Public Member Functions | |
constexpr | default_value (default_init< value_type > default_val=default_init< value_type >{}) noexcept(std::is_nothrow_move_constructible_v< value_type >) |
Copy construct a default_value object using the provided default value. More... | |
constexpr default_value & | operator= (value_type non_default_val) noexcept(std::is_nothrow_move_assignable_v< value_type >) |
Override the previously provided default value with the new, non-default value. More... | |
template<typename U , PLSSVM_REQUIRES(std::is_convertible_v< U, value_type >) > | |
constexpr | default_value (const default_value< U > &other) noexcept(std::is_nothrow_copy_constructible_v< U >) |
Copy-construct a new default_value from a possibly other type. More... | |
template<typename U , PLSSVM_REQUIRES(std::is_convertible_v< U, value_type >) > | |
constexpr | default_value (default_value< U > &&other) noexcept(std::is_nothrow_move_constructible_v< U >) |
Move-construct a new default_value_from a possibly other type. More... | |
template<typename U , PLSSVM_REQUIRES(std::is_convertible_v< U, value_type >) > | |
constexpr default_value & | operator= (const default_value< U > &other) noexcept(std::is_nothrow_copy_assignable_v< U >) |
Copy-assign a new default_value from a possible other type. More... | |
template<typename U , PLSSVM_REQUIRES(std::is_convertible_v< U, value_type >) > | |
constexpr default_value & | operator= (default_value< U > &&other) noexcept(std::is_nothrow_move_assignable_v< U >) |
Move-assign a new default_value from a possible other type. More... | |
constexpr const value_type & | value () const noexcept |
Get the currently active value: the user provided value if provided, otherwise the default value is returned. More... | |
constexpr | operator const value_type & () const noexcept |
Get the currently active value: the user provided value if provided, otherwise the default value is returned. More... | |
constexpr const value_type & | get_default () const noexcept |
Get the default value even if it has already been overwritten by the user. More... | |
constexpr bool | is_default () const noexcept |
Check whether the currently active value is the default value. More... | |
constexpr void | swap (default_value &other) noexcept(std::is_nothrow_swappable_v< T >) |
Swap the content of two default_values. More... | |
constexpr void | reset () noexcept |
Set the current active value back to the default value. | |
Private Attributes | |
value_type | value_ {} |
The wrapped value to be used if use_default_init_ is false . | |
bool | use_default_init_ { true } |
Flag used to determine whether the default value should be used or the user defined value. | |
default_init< value_type > | default_init_ {} |
The wrapped default value used if use_default_init_ is true . | |
This class encapsulates a value that may be a default value or not.
T | the type of the encapsulated value |
|
inlineexplicitconstexprnoexcept |
Copy construct a default_value object using the provided default value.
Afterward, is_default()
will return true
!
[in] | default_val | set the default value of this default_value wrapper |
|
inlineexplicitconstexprnoexcept |
Copy-construct a new default_value from a possibly other type.
U | the type of the other default_value wrapper |
[in] | other | the other default_value potentially wrapping another type |
U
must be convertible to value_type
!
|
inlineexplicitconstexprnoexcept |
Move-construct a new default_value_from a possibly other type.
U | the type of the other default_value wrapper |
[in,out] | other | the other default_value potentially wrapping another type |
U
must be convertible to value_type
!
|
inlineconstexprnoexcept |
Override the previously provided default value with the new, non-default value.
Afterward, is_default()
will return false
!
[in] | non_default_val | the non-default value |
*this
|
inlineconstexprnoexcept |
Copy-assign a new default_value from a possible other type.
U | the type of the other default_value wrapper |
other | the other default_value potentially wrapping another type |
U
must be convertible to value_type
! *this
|
inlineconstexprnoexcept |
Move-assign a new default_value from a possible other type.
U | the type of the other default_value wrapper |
other | the other default_value potentially wrapping another type |
U
must be convertible to value_type
! *this
|
inlineconstexprnoexcept |
Get the currently active value: the user provided value if provided, otherwise the default value is returned.
[[nodiscard]]
)
|
inlineconstexprnoexcept |
Get the currently active value: the user provided value if provided, otherwise the default value is returned.
[[nodiscard]]
)
|
inlineconstexprnoexcept |
Get the default value even if it has already been overwritten by the user.
[[nodiscard]]
)
|
inlineconstexprnoexcept |
Check whether the currently active value is the default value.
true
if the default value is currently active, false
otherwise ([[nodiscard]]
)
|
inlineconstexprnoexcept |
Swap the content of two default_values.
[in,out] | other | the other default_value |