MGIS 3.1.0
Loading...
Searching...
No Matches
FixedSizeView.hxx File Reference

File which defines the FixedSizeView class, a view returning the values of a function with a fixed number of components as a fixed size span or as a scalar. More...

Classes

struct  mgis::function::FixedSizeView< FunctionType, N >
 a modifier returning the values of a function view as a fixed size span or a scalar More...
struct  mgis::function::LightweightViewTraits< FixedSizeView< FunctionType, N > >
 specialisation stating that a FixedSizeView is a lightweight view, i.e. that a copy of the view is cheap and can be used to evaluate the function More...

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.

Functions

template<size_type N, typename FunctionType>
requires ( (N > 0) && (N != dynamic_extent) && // (FunctionConcept<std::decay_t<FunctionType>>)&& // ((!std::is_const_v<FunctionType>) || (LightweightViewConcept<std::decay_t<FunctionType>>)))
constexpr auto mgis::function::view (FunctionType &)
 convert a function to a fixed size view
template<size_type N, typename FunctionType>
requires ( (N > 0) && (N != dynamic_extent) && // (FunctionConcept<std::decay_t<FunctionType>>)&& // (!EvaluatorConcept<std::decay_t<FunctionType>>)&& // (!LightweightViewConcept<std::decay_t<FunctionType>>)&& // (std::is_const_v<FunctionType>)&& // (requires(FunctionType & rf) { view(rf); }))
constexpr auto mgis::function::view (FunctionType &)
 convert a const function to an immutable fixed size view
template<FunctionConcept FunctionType, size_type N>
constexpr decltype(auto) mgis::function::getSpace (const FixedSizeView< FunctionType, N > &)
 return the underlying space
template<FunctionConcept FunctionType, size_type N>
constexpr bool mgis::function::check (AbstractErrorHandler &, const FixedSizeView< FunctionType, N > &)
 perform consistency checks
template<FunctionConcept FunctionType, size_type N>
constexpr size_type mgis::function::getNumberOfComponents (const FixedSizeView< FunctionType, N > &) MGIS_NOEXCEPT
 return the number of components

Detailed Description

File which defines the FixedSizeView class, a view returning the values of a function with a fixed number of components as a fixed size span or as a scalar.

Author
Thomas Helfer
Date
07/05/2025

Function Documentation

◆ check()

template<FunctionConcept FunctionType, size_type N>
bool mgis::function::check ( AbstractErrorHandler & eh,
const FixedSizeView< FunctionType, N > & v )
nodiscardconstexpr

perform consistency checks

Template Parameters
FunctionTypetype of the underlying function
Nnumber of components of the view
Parameters
[in]eherror handler used to report the errors
[in]vfixed size view
Returns
true if the number of components of the view is equal to N

◆ getNumberOfComponents()

template<FunctionConcept FunctionType, size_type N>
size_type mgis::function::getNumberOfComponents ( const FixedSizeView< FunctionType, N > & v)
nodiscardconstexpr

return the number of components

Template Parameters
FunctionTypetype of the underlying function
Nnumber of components of the view
Parameters
[in]vfixed size view
Returns
the number of components of the view, which is N

◆ getSpace()

template<FunctionConcept FunctionType, size_type N>
decltype(auto) mgis::function::getSpace ( const FixedSizeView< FunctionType, N > & v)
nodiscardconstexpr

return the underlying space

Template Parameters
FunctionTypetype of the underlying function
Nnumber of components of the view
Parameters
[in]vfixed size view
Returns
the space on which the view is defined

◆ view() [1/2]

template<size_type N, typename FunctionType>
requires ( (N > 0) && (N != dynamic_extent) && // (FunctionConcept<std::decay_t<FunctionType>>)&& // (!EvaluatorConcept<std::decay_t<FunctionType>>)&& // (!LightweightViewConcept<std::decay_t<FunctionType>>)&& // (std::is_const_v<FunctionType>)&& // (requires(FunctionType & rf) { view(rf); }))
auto mgis::function::view ( FunctionType & f)
nodiscardconstexpr

convert a const function to an immutable fixed size view

Template Parameters
Nnumber of components of the view
FunctionTypeconst type of the function
Parameters
[in]ffunction
Returns
a fixed size view of a view of the function, which only returns constant values
Note
this overload applies to constant functions which are neither evaluators nor lightweight views and for which a view can be created

◆ view() [2/2]

template<size_type N, typename FunctionType>
requires ( (N > 0) && (N != dynamic_extent) && // (FunctionConcept<std::decay_t<FunctionType>>)&& // ((!std::is_const_v<FunctionType>) || (LightweightViewConcept<std::decay_t<FunctionType>>)))
auto mgis::function::view ( FunctionType & f)
nodiscardconstexpr

convert a function to a fixed size view

Template Parameters
Nnumber of components of the view
FunctionTypetype of the function, which may be a qualified type
Parameters
[in]ffunction
Returns
a fixed size view of the function
Note
this overload applies to non-constant functions and to functions which are their own view