Changeset 3f1b78ca in tol


Ignore:
Timestamp:
Dec 3, 2008, 4:53:10 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
4b82a48
Parents:
bd324f8
Message:

Adding optional method gsl_rtabnorm_combo to generate scalar truncated normally distributed random variables

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/bmath/bprdist/multvar.cpp

    rbd324f8 r3f1b78ca  
    3030#include <tol/tol_blinalg.h>
    3131#include <tol/tol_bmfstpro.h>
     32#include "gsl_ext.h"
    3233#include <gsl/gsl_randist.h>
     34#include <gsl/gsl_math.h>
    3335#include <tol/tol_lapack.h>
    3436
    3537BTraceInit("multvar.cpp");
     38
     39#define USE_BTruncatedNormalDist
    3640
    3741//--------------------------------------------------------------------
    … …  
    275279    for(i=0; i<n; i++)
    276280    {
     281# ifdef USE_BTruncatedNormalDist
    277282      BTruncatedNormalDist tni(a(i,0), b(i,0), 0, 1);
    278283      y(i,0) = tni.Random();
     284# else
     285      y(i,0) = gsl_rtabnorm_combo(BProbDist::rng(), 0.0, 1.0,
     286                                  a(i,0).Value(), b(i,0).Value(), 10);
     287# endif
    279288    }
    280289    x = (y*s)+nu;
Note: See TracChangeset for help on using the changeset viewer.