|
PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
|
Immutable, non-copying range of bars retaining its Dataset owner. More...
#include <pineforge/hpo/dataset.hpp>
Public Member Functions | |
| DatasetView (std::shared_ptr< const Dataset > dataset) | |
| Constructs a view of the entire owner. | |
| DatasetView (std::shared_ptr< const Dataset > dataset, std::size_t first, std::size_t count) | |
| Constructs the range [first, first + count). | |
| const pf_bar_t * | data () const noexcept |
| Returns owner->data() + begin, preserving the pointer even for an empty owner. | |
| std::size_t | size () const noexcept |
| Returns the number of bars in this view. | |
| bool | empty () const noexcept |
| Returns whether this view contains no bars. | |
Public Attributes | |
| const std::shared_ptr< const Dataset > | owner |
| Keeps owned bars or the mapping and its descriptor alive. | |
| const std::size_t | begin |
| First bar's index in owner. | |
| const std::size_t | length |
| Number of bars in this view. | |
Immutable, non-copying range of bars retaining its Dataset owner.
Bounds are checked once at construction without adding begin and length (so overflow cannot admit an invalid range). An explicit empty view is allowed, including at owner->size(); it is useful for range arithmetic but cannot be executed by TrialExecutor. A whole view preserves the owner's exact data pointer. Mapped-file verification belongs to the owner at the run boundary; constructing or reading a view never calls Dataset::verify_unchanged().
Definition at line 127 of file dataset.hpp.
|
explicit |
Constructs a view of the entire owner.
| std::invalid_argument | with code hpo_dataset_invalid for a null owner. |
| pineforge::hpo::DatasetView::DatasetView | ( | std::shared_ptr< const Dataset > | dataset, |
| std::size_t | first, | ||
| std::size_t | count | ||
| ) |
Constructs the range [first, first + count).
| std::invalid_argument | with code hpo_dataset_invalid for a null owner or bounds outside that owner's bars. |
|
noexcept |
Returns owner->data() + begin, preserving the pointer even for an empty owner.
|
inlinenoexcept |
Returns whether this view contains no bars.
Definition at line 149 of file dataset.hpp.
References length.
|
inlinenoexcept |
Returns the number of bars in this view.
Definition at line 147 of file dataset.hpp.
References length.
| const std::size_t pineforge::hpo::DatasetView::begin |
First bar's index in owner.
Definition at line 140 of file dataset.hpp.
| const std::size_t pineforge::hpo::DatasetView::length |
Number of bars in this view.
Definition at line 142 of file dataset.hpp.
| const std::shared_ptr<const Dataset> pineforge::hpo::DatasetView::owner |
Keeps owned bars or the mapping and its descriptor alive.
Definition at line 138 of file dataset.hpp.
Referenced by pineforge::hpo::TrialExecutor::dataset().