Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CopulaFactory Class Reference

Factory for constructing concrete copulas from a type tag and configuration. More...

#include <CopulaFactory.h>

Static Public Member Functions

static std::unique_ptr< ICopulacreate (CopulaType name, CopulaConfig config, unsigned int seed=std::random_device{}())
 Creates a concrete copula instance.
 

Detailed Description

Factory for constructing concrete copulas from a type tag and configuration.

CopulaFactory creates heap-allocated concrete implementations of ICopula and returns them through std::unique_ptr<ICopula>.

Supported constructions currently include:

Typical usage:

cfg.R = corr;
cfg.nu = 5;
@ STUDENT_T
Student-t copula, defined by a correlation matrix and degrees of freedom.
static std::unique_ptr< ICopula > create(CopulaType name, CopulaConfig config, unsigned int seed=std::random_device{}())
Creates a concrete copula instance.
Configuration object for a Student-t copula.
int nu
Correlation matrix of the latent Student-t vector.
Warning
In the current implementation, the actual constructed type is selected by the active alternative stored in CopulaConfig. The name argument is only used to select a switch branch, but does not itself enforce consistency with the variant content. For example, passing CopulaType::GAUSSIAN together with a StudentTCopulaConfig still constructs a Student-t copula.

If stricter behavior is desired, the implementation should check that name matches the active type of config and throw otherwise.

Definition at line 88 of file CopulaFactory.h.

Member Function Documentation

◆ create()

std::unique_ptr< ICopula > CopulaFactory::create ( CopulaType  name,
CopulaConfig  config,
unsigned int  seed = std::random_device{}() 
)
static

Creates a concrete copula instance.

This method builds a concrete ICopula implementation using:

  • a user-level copula family tag (name),
  • a typed configuration payload (config),
  • and an optional RNG seed (seed).

Supported pairs are:

Parameters
nameRequested copula family.
configConfiguration object stored in a CopulaConfig variant.
seedOptional random seed used to initialize the underlying RNG.
Returns
A unique pointer to the created copula.
Exceptions
std::invalid_argumentIf the copula type is unknown.
Warning
In the current implementation, no runtime consistency check is performed between name and the active alternative stored in config. The variant content effectively determines the class that is instantiated.

Definition at line 23 of file CopulaFactory.cpp.


The documentation for this class was generated from the following files: