Changeset 2d00fbd in tol


Ignore:
Timestamp:
Apr 13, 2009, 7:21:33 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
291a836
Parents:
a0bfdeb
Message:

New method get.draw will call specialized draw after doing tasks that are common to all types of blocks

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@918 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/_blockSampler.tol

    ra0bfdeb r2d00fbd  
    3232  //Flag that enables/disables the block
    3333  Real enabled = True;
     34  Real refreshFrequency = 1;
    3435  //Work space stores all data needed to draw samples that are variant for
    3536  //each simulation
    … …  
    4849  VMatrix draw(Real numSim);
    4950
     51  //Method of sample generation
     52  VMatrix get.draw(Real numSim, Real force)
     53  {
     54    Real refresh = Case(
     55      force, 1,
     56      !enabled, 0,
     57      1==1, Rand(0,1)<=refreshFrequency);
     58    If(!refresh, Copy(_.store),
     59    {
     60      VMatrix b = draw(numSim);
     61      Real setStore(VMat2Mat(b));
     62      b
     63    })
     64  };
     65
    5066  //This method will be called for MCMC initialzation
    5167  //Default behaviour does nothing
    … …  
    5571  //Default behaviour does nothing
    5672  VMatrix filter(VMatrix Z) { Z };
    57 
    5873
    5974  ////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.