Calculator for computing Sobol sensitivity indices according to the paper by Saltelli (2002) https://doi.org/10.1016/S0010-4655(02)00280-1. More...
#include <SobolCalculators.h>
Public Member Functions | |
SobolCalculator (const libMesh::ParallelObject &other, const std::string &name, bool resample) | |
std::vector< OutType > | compute (const std::vector< InType > &, bool) |
Evaluate the calculator on the full vector of data. More... | |
void | initializeCalculator () |
Public function that must be called before updateCalculator and finalizeCalculator. More... | |
void | updateCalculator (const typename std::vector< InType > ::value_type &) |
Public function to update calculator with a piece of data. More... | |
void | finalizeCalculator (bool) |
Public function to finalize the resulting calculator value. More... | |
std::vector< OutType > | getValue () const |
Public function to return the calculated value _state must be FINALIZED. More... | |
const std::string & | name () const |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Protected Member Functions | |
virtual void | initialize () override |
This function is used to reset the calculator to its initial state and prepare it for another evaluation. More... | |
virtual void | update (const InType &data) override |
virtual void | finalize (bool is_distributed) override |
This is used to compute the resulting calculator value by performing necessary arithmetic and parallel communication. More... | |
virtual std::vector< OutType > | get () const override |
Returns the resulting calculator value. More... | |
virtual void | update (const typename std::vector< InType > ::value_type &)=0 |
Updating the calculator with a piece of data. More... | |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Private Attributes | |
const bool | _resample |
Set to true if the resampling matrix exists for computing second-order indices. More... | |
DenseMatrix< OutType > | _amat |
Matrix containing dot products of data. More... | |
std::vector< OutType > | _sobol |
The returned sobol indices. More... | |
Calculator for computing Sobol sensitivity indices according to the paper by Saltelli (2002) https://doi.org/10.1016/S0010-4655(02)00280-1.
The data provided is stacked vectors provided by the SobolSampler. Example use of this object is also available in the stochastic_tools unit testing.
Definition at line 24 of file SobolCalculators.h.
StochasticTools::SobolCalculator< InType, OutType >::SobolCalculator | ( | const libMesh::ParallelObject & | other, |
const std::string & | name, | ||
bool | resample | ||
) |
Definition at line 14 of file SobolCalculators.C.
|
inherited |
Evaluate the calculator on the full vector of data.
This is basically a convenient wrapper around initializeCalculator, updateCalculator, finalizeCalculator, and getvalue.
Definition at line 288 of file Calculators.h.
Referenced by SobolStatistics::execute(), and TEST().
|
overrideprotectedvirtual |
This is used to compute the resulting calculator value by performing necessary arithmetic and parallel communication.
This only called once after all the input data is entered through update.
Implements StochasticTools::Calculator< std::vector< InType >, std::vector< OutType > >.
Definition at line 47 of file SobolCalculators.C.
|
inherited |
Public function to finalize the resulting calculator value.
_state must be INITLIALIZED Sets _state to FINALIZED
Definition at line 315 of file Calculators.h.
|
inlineoverrideprotectedvirtual |
Returns the resulting calculator value.
It is important to not modify member data here so the calculator can retain its state.
Implements StochasticTools::Calculator< std::vector< InType >, std::vector< OutType > >.
Definition at line 33 of file SobolCalculators.h.
|
inherited |
Public function to return the calculated value _state must be FINALIZED.
Definition at line 325 of file Calculators.h.
|
overrideprotectedvirtual |
This function is used to reset the calculator to its initial state and prepare it for another evaluation.
This usually involves clearing class members.
Implements StochasticTools::Calculator< std::vector< InType >, std::vector< OutType > >.
Definition at line 23 of file SobolCalculators.C.
|
inherited |
Public function that must be called before updateCalculator and finalizeCalculator.
Sets _state to INITIALIZED
Definition at line 299 of file Calculators.h.
|
inlineinherited |
Definition at line 99 of file Calculators.h.
|
overrideprotectedvirtual |
Definition at line 30 of file SobolCalculators.C.
|
protectedpure virtualinherited |
Updating the calculator with a piece of data.
Sometimes some clever arithmetic is required to avoid storing data.
|
inherited |
Public function to update calculator with a piece of data.
_state mush be INITIALIZED
Definition at line 307 of file Calculators.h.
|
private |
Matrix containing dot products of data.
Definition at line 39 of file SobolCalculators.h.
|
private |
Set to true if the resampling matrix exists for computing second-order indices.
Definition at line 37 of file SobolCalculators.h.
|
private |
The returned sobol indices.
Definition at line 41 of file SobolCalculators.h.
Referenced by StochasticTools::SobolCalculator< InType, OutType >::get().