Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CorrelationMatrixPair< T > Struct Template Reference

Stores a pair of correlation matrices (statistical and systematic) for a given key type. More...

#include <CorrelationRepo.h>

Public Member Functions

std::pair< double, double > at (const std::pair< T, T > &key) const
 Retrieves the correlation values for a given pair.
 
void emplace (std::pair< T, T > &&key, double stat_val, double syst_val)
 Inserts a new entry into both the statistical and systematic matrices, enforcing symmetry.
 

Public Attributes

SparseMatrix< Tstat
 Statistical correlation matrix.
 
SparseMatrix< Tsyst
 Systematic correlation matrix.
 

Friends

template<typename U >
std::ostream & operator<< (std::ostream &, const CorrelationMatrixPair< U > &)
 Stream output operator for a CorrelationMatrixPair.
 

Detailed Description

template<typename T>
struct CorrelationMatrixPair< T >

Stores a pair of correlation matrices (statistical and systematic) for a given key type.

The template parameter T is the type used as keys in the correlation matrices (e.g. ParamId or ExperimentObs). Internally this relies on SparseMatrix<T>, which behaves like an associative container:

  • contains(key) tests presence of an entry.
  • at(key) retrieves the stored double value.
  • iteration yields pairs (std::pair<T,T>, double).

Symmetry: The helper emplace below automatically inserts entries both for (a,b) and (b,a), enforcing a symmetric correlation structure.

Template Parameters
TKey type used to index the correlation entries.

Definition at line 28 of file CorrelationRepo.h.

Member Function Documentation

◆ at()

template<typename T >
std::pair< double, double > CorrelationMatrixPair< T >::at ( const std::pair< T, T > &  key) const
inline

Retrieves the correlation values for a given pair.

If a given (T,T) pair is not present in one of the matrices, the corresponding correlation component is assumed to be 0.0.

Parameters
keyA pair of keys (T, T) representing two parameters/observables.
Returns
A pair (stat_value, syst_value) for the requested key.

Definition at line 41 of file CorrelationRepo.h.

◆ emplace()

template<typename T >
void CorrelationMatrixPair< T >::emplace ( std::pair< T, T > &&  key,
double  stat_val,
double  syst_val 
)
inline

Inserts a new entry into both the statistical and systematic matrices, enforcing symmetry.

This function:

  • stores (key.first, key.second) → stat_val / syst_val
  • stores (key.second, key.first) → stat_val / syst_val

so that the resulting correlation matrices are symmetric by construction.

Parameters
keyThe pair of keys (T, T).
stat_valStatistical correlation value.
syst_valSystematic correlation value.

Definition at line 62 of file CorrelationRepo.h.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T >
template<typename U >
std::ostream & operator<< ( std::ostream &  os,
const CorrelationMatrixPair< U > &  cmp 
)
friend

Stream output operator for a CorrelationMatrixPair.

The output iterates over all entries in the statistical matrix and prints them together with their corresponding systematic values:

(i, j): rho_stat + rho_syst

The format is intended for debugging/logging rather than for machine parsing.

Template Parameters
UKey type.
Parameters
osOutput stream.
cmpThe CorrelationMatrixPair to print.
Returns
The output stream.

Definition at line 99 of file CorrelationRepo.cpp.

Member Data Documentation

◆ stat

template<typename T >
SparseMatrix<T> CorrelationMatrixPair< T >::stat

Statistical correlation matrix.

Definition at line 29 of file CorrelationRepo.h.

◆ syst

template<typename T >
SparseMatrix<T> CorrelationMatrixPair< T >::syst

Systematic correlation matrix.

Definition at line 30 of file CorrelationRepo.h.


The documentation for this struct was generated from the following file: