Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "PMCMCBase.h" 13 : 14 : /** 15 : * A class for performing Affine Invariant Ensemble MCMC with stretch sampler 16 : */ 17 : class AffineInvariantStretchSampler : public PMCMCBase 18 : { 19 : public: 20 : static InputParameters validParams(); 21 : 22 : AffineInvariantStretchSampler(const InputParameters & parameters); 23 : 24 2200 : virtual int decisionStep() const override { return 2; } 25 : 26 : /** 27 : * Return the vector of step size for decision making 28 : */ 29 : const std::vector<Real> & getAffineStepSize() const; 30 : 31 : protected: 32 : virtual void proposeSamples(const unsigned int seed_value) override; 33 : 34 : /// The step size for the stretch sampler 35 : const Real _step_size; 36 : 37 : /// Reporter value with the previous state of all the walkers 38 : const std::vector<std::vector<Real>> & _previous_state; 39 : 40 : /// Reporter value with the previous state of all the walkers for variance 41 : const std::vector<Real> & _previous_state_var; 42 : 43 : /// Vector of affine step sizes 44 : std::vector<Real> _affine_step; 45 : };