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 : #include "AffineInvariantDifferentialDecision.h" 11 : 12 : registerMooseObject("StochasticToolsApp", AffineInvariantDifferentialDecision); 13 : 14 : InputParameters 15 180 : AffineInvariantDifferentialDecision::validParams() 16 : { 17 180 : InputParameters params = PMCMCDecision::validParams(); 18 180 : params.addClassDescription("Perform decision making for Affine Invariant differential MCMC."); 19 180 : return params; 20 0 : } 21 : 22 88 : AffineInvariantDifferentialDecision::AffineInvariantDifferentialDecision( 23 88 : const InputParameters & parameters) 24 88 : : PMCMCDecision(parameters), _aides(dynamic_cast<const AffineInvariantDES *>(&_sampler)) 25 : { 26 : // Check whether the selected sampler is a differential evolution sampler or not 27 88 : if (!_aides) 28 0 : paramError("sampler", "The selected sampler is not of type AffineInvariantDES."); 29 88 : } 30 : 31 : void 32 264 : AffineInvariantDifferentialDecision::computeTransitionVector(std::vector<Real> & tv, 33 : const std::vector<Real> & evidence) 34 : { 35 1584 : for (unsigned int i = 0; i < tv.size(); ++i) 36 1804 : tv[i] = std::exp(std::min(evidence[i], 0.0)); 37 264 : }