LCOV - code coverage report
Current view: top level - src/reporters - AffineInvariantDifferentialDecision.C (source / functions) Hit Total Coverage
Test: idaholab/moose stochastic_tools: f45d79 Lines: 13 15 86.7 %
Date: 2025-07-25 05:00:46 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14