Build a non-owning view of a packed layout as a span.
More...
#include <vector_view.hpp>
|
| | BlockVectorView (const LayoutType &layout, std::span< Scalar > values) |
| | Construct one of these views from a layout and a span of coefficients.
|
| |
| | BlockVectorView (const LayoutType &&, std::span< Scalar >)=delete |
| | Reject temporary metadata whose offsets would dangle before the coefficients are accessed.
|
| |
template<typename Range>
requires (!std::is_lvalue_reference_v<Range> && !std::ranges::borrowed_range<Range>) |
| | BlockVectorView (const LayoutType &, Range &&)=delete |
| | Prevent implicit const-span conversion from retaining a temporary owning container.
|
| |
template<typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, typename LayoutType::template Coordinates<Kind>> |
| std::span< Scalar > | get () const |
| | Access the requested physical coordinate while retaining storage constness.
|
| |
|
| const LayoutType & | m_layout |
| | The layout to use for the view. The layout must remain unchanged while the view is used.
|
| |
| std::span< Scalar > | m_values |
| | The span of coefficients to view.
|
| |
Build a non-owning view of a packed layout as a span.
- Template Parameters
-
| Kind | The kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals. |
| Layout | The block layout type, e.g. SystemLayout. |
| Scalar | The scalar type of the coefficients, e.g. double. |
- Note
- The layout must remain unchanged while the view is used. Probably we want to, in the future, add some way to validate this; however, I am at the moment at a loss for how to do so.
◆ LayoutType
◆ BlockVectorView() [1/3]
Construct one of these views from a layout and a span of coefficients.
- Parameters
-
| layout | The layout to use for the view. |
| values | The span of coefficients to view. |
- Exceptions
-
| std::domain_error | If the span of coefficients does not match the total size of the layout. |
- Todo
- Really this could go in many places; however, I think we should move away from throwing std exceptions and introduce our own exception hierarchy.
◆ BlockVectorView() [2/3]
Reject temporary metadata whose offsets would dangle before the coefficients are accessed.
◆ BlockVectorView() [3/3]
template<typename Range>
requires (!std::is_lvalue_reference_v<Range> && !std::ranges::borrowed_range<Range>)
Prevent implicit const-span conversion from retaining a temporary owning container.
◆ get()
template<typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, typename LayoutType::template Coordinates<Kind>>
Access the requested physical coordinate while retaining storage constness.
- Template Parameters
-
| Coordinate | The coordinate tag to access |
| Requirements |
-
A layout type with kind Kind must contain the requested coordinate tag.
|
◆ m_layout
The layout to use for the view. The layout must remain unchanged while the view is used.
◆ m_values
The span of coefficients to view.
The documentation for this class was generated from the following file: