![]() |
FIMS
v0.10.0
|
Helper for mapping population biological size bins to observed fleet bins. More...
#include <size_bin_mapping.hpp>
Static Public Member Functions | |
| static double | OverlapWidth (double left_a, double right_a, double left_b, double right_b) |
| Return the overlap width between two 1-D closed-open intervals. | |
| static bool | HasStrictlyIncreasingEdges (const fims::Vector< double > &edges) |
| Check that a bin-edge vector is usable for geometric mapping. | |
| static fims::Vector< fims::Vector< double > > | BuildRebinWeights (const fims::Vector< double > &source_edges, const fims::Vector< double > &destination_edges) |
| Build overlap-based rebin weights from source bins to destination bins. | |
| static bool | DestinationCoversSourceRange (const fims::Vector< double > &source_edges, const fims::Vector< double > &destination_edges) |
| Check that the destination edges fully cover the source-bin range. | |
| static fims::Vector< double > | ExpandDestinationEdgesToCoverSourceRange (const fims::Vector< double > &source_edges, const fims::Vector< double > &destination_edges) |
| Return explicit mapping edges whose support covers the source range while preserving the canonical destination bin breaks. | |
| template<typename Type > | |
| static fims::Vector< Type > | ApplyRebinWeights (const fims::Vector< fims::Vector< double > > &weights, const fims::Vector< Type > &source_mass) |
| Apply a source-to-destination bin mapping to a size-mass vector. | |
Helper for mapping population biological size bins to observed fleet bins.
This helper operates only on bin geometry. It does not depend on growth, age-to-length conversion, selectivity, or catch-at-age logic.
|
inlinestatic |
Apply a source-to-destination bin mapping to a size-mass vector.
The source vector contains probability mass or another size-indexed quantity on the population biological size grid. The weight matrix must have been created by BuildRebinWeights(), so each row corresponds to one destination bin and each column corresponds to one source bin. For each destination bin, this function multiplies the source mass in every source bin by its overlap fraction and sums the results. In matrix notation, the returned vector is destination_mass = weights * source_mass.
In the growth-derived age-to-length path, the source vector is the population-level age-to-size probability row and the destination vector is the fleet-specific age-to-length probability row. The caller may first use ExpandDestinationEdgesToCoverSourceRange() to extend the outer destination edges, then use BuildRebinWeights() to construct the geometric mapping. This function performs only the weighted aggregation; it does not validate or normalize the resulting row.
| weights | Overlap weights stored as [destination_bin][source_bin], typically returned by BuildRebinWeights(). |
| source_mass | Mass or probability values indexed by source bin. |
| std::runtime_error | If a weight row has a different number of columns than source_mass. |
|
inlinestatic |
Build overlap-based rebin weights from source bins to destination bins.
| source_edges | Population biological size-grid edges. |
| destination_edges | Fleet observation-bin edges. |
Convert a probability distribution from FIMS's internal biological size grid into the same bins as observed by a fleet using geometric mass conservation when translating the growth-derived biological size distribution into the bins actually observed by a fleet. It requires destination support to cover source support and does not apply higher-level tail handling such as biological plus-group interpretation or observation-side compression rules.
|
inlinestatic |
Check that the destination edges fully cover the source-bin range.
| source_edges | Population biological size-grid edges. |
| destination_edges | Fleet observation-bin edges. |
|
inlinestatic |
Return explicit mapping edges whose support covers the source range while preserving the canonical destination bin breaks.
| source_edges | Population biological size-grid edges that must be covered. |
| destination_edges | Fleet observation-bin edges. |
This is an explicit higher-level mapping policy. It does not redefine the canonical destination geometry itself; it only prepares a temporary edge vector for geometric translation when destination support is narrower than source support.
|
inlinestatic |
Check that a bin-edge vector is usable for geometric mapping.
| edges | Bin edges to validate. |
|
inlinestatic |
Return the overlap width between two 1-D closed-open intervals.
| left_a | Left edge of interval A. |
| right_a | Right edge of interval A. |
| left_b | Left edge of interval B. |
| right_b | Right edge of interval B. |