|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Helpers for converting between indexed maps and dense containers. More...
#include <map>#include <vector>#include <stdexcept>#include "Matrix.h"#include "Include.h"#include "ObservableValue.h"#include "BinnedObservableId.h"

Go to the source code of this file.
Classes | |
| struct | UnzipResult1D< T, U > |
| Result of converting a one-dimensional indexed map to dense vectors. More... | |
| struct | UnzipResult2D< T > |
| Result of converting a square indexed matrix to dense vectors. More... | |
Functions | |
| template<typename T , typename U > | |
| std::map< T, U > | zip (const std::vector< T > &ids, const std::vector< U > &vals) |
| Builds a map from parallel id and value vectors. | |
| template<typename T > | |
| std::map< T, std::map< T, double > > | zip (const std::vector< T > &ids, const std::vector< std::vector< double > > &vals) |
| Builds a square nested map from ids and a dense matrix. | |
| UnzipResult1D< BinnedObservableId, double > | flatten (std::map< ObservableId, std::vector< ObservableValue > > indexed) |
| Flattens observable values into binned observable ids and values. | |
| template<typename T > | |
| std::map< T, std::map< T, double > > | zip (const std::vector< T > &ids, const RealMatrix &vals) |
| Builds a square nested map from ids and a RealMatrix. | |
| template<typename T , typename U > | |
| UnzipResult1D< T, U > | unzip (const std::map< T, U > &indexed) |
| Splits a map into parallel id and value vectors. | |
| template<typename T > | |
| UnzipResult2D< T > | unzip (const std::map< T, std::map< T, double > > &indexed) |
| Splits a nested square map into ids and a dense matrix. | |
Helpers for converting between indexed maps and dense containers.
The utilities in this file are used to keep the association between logical ids and numerical values while switching between STL maps, vectors, and matrix representations.
Definition in file Indexing.h.
|
inline |
Flattens observable values into binned observable ids and values.
Each input observable can contain several binned values. The output contains one BinnedObservableId per value, using (0, 0) as the bin range when an observable value has no explicit bin.
| indexed | Map from observable id to one or more observable values. |
Definition at line 118 of file Indexing.h.
| UnzipResult2D< T > unzip | ( | const std::map< T, std::map< T, double > > & | indexed | ) |
Splits a nested square map into ids and a dense matrix.
| T | Row and column id type. |
| indexed | Nested square map. |
Definition at line 198 of file Indexing.h.
| UnzipResult1D< T, U > unzip | ( | const std::map< T, U > & | indexed | ) |
Splits a map into parallel id and value vectors.
| T | Id type. |
| U | Value type. |
| indexed | Input map. |
Definition at line 176 of file Indexing.h.
| std::map< T, std::map< T, double > > zip | ( | const std::vector< T > & | ids, |
| const RealMatrix & | vals | ||
| ) |
Builds a square nested map from ids and a RealMatrix.
| T | Row and column id type. |
| ids | Row and column ids. |
| vals | Dense square matrix. |
out[row_id][col_id] stores the corresponding matrix entry.| std::invalid_argument | if vals is not square with respect to ids. |
Definition at line 149 of file Indexing.h.
| std::map< T, std::map< T, double > > zip | ( | const std::vector< T > & | ids, |
| const std::vector< std::vector< double > > & | vals | ||
| ) |
Builds a square nested map from ids and a dense matrix.
| T | Row and column id type. |
| ids | Row and column ids. |
| vals | Dense square matrix represented as nested vectors. |
out[row_id][col_id] stores the corresponding matrix entry.| std::invalid_argument | if vals is empty, non-square with respect to ids, or has incompatible dimensions. |
Definition at line 88 of file Indexing.h.
| std::map< T, U > zip | ( | const std::vector< T > & | ids, |
| const std::vector< U > & | vals | ||
| ) |
Builds a map from parallel id and value vectors.
| T | Id type. |
| U | Value type. |
| ids | Ordered ids. |
| vals | Values associated with ids. |
| std::invalid_argument | if the two vectors do not have the same size. |
Definition at line 61 of file Indexing.h.