Commit 97db8072 authored by Lynn Garren's avatar Lynn Garren
Browse files

add RandSkewNormal to save and restore tests

parent 452150c9
// $Id: Randomize.h,v 1.3 2003/10/23 21:29:51 garren Exp $
// $Id: Randomize.h,v 1.4 2011/05/31 20:57:00 garren Exp $
// -*- C++ -*-
//
// -----------------------------------------------------------------------
......@@ -55,6 +55,7 @@
#include "CLHEP/Random/RandLandau.h"
#include "CLHEP/Random/RandPoissonQ.h"
#include "CLHEP/Random/RandPoissonT.h"
#include "CLHEP/Random/RandSkewNormal.h"
#include "CLHEP/Random/RandStudentT.h"
namespace CLHEP {
......
// -*- C++ -*-
// $Id: ranRestoreTest.cc,v 1.5 2010/06/16 17:24:53 garren Exp $
// $Id: ranRestoreTest.cc,v 1.6 2011/05/31 20:57:01 garren Exp $
// ----------------------------------------------------------------------
#include "CLHEP/Random/Randomize.h"
#include "CLHEP/Random/NonRandomEngine.h"
......@@ -287,6 +287,7 @@ int fileNotThereEngine() {
stat |= fileNotThere <E, RandPoisson>();
stat |= fileNotThere <E, RandPoissonQ>();
stat |= fileNotThere <E, RandPoissonT>();
stat |= fileNotThere <E, RandSkewNormal>();
stat |= fileNotThere <E, RandStudentT>();
return stat;
}
......@@ -561,6 +562,8 @@ int checkDistributions() {
stat |= checkSaveDistribution<E,RandGamma> (d,33); }
{RandLandau d(new E(125714));
stat |= checkSaveDistribution<E,RandLandau> (d,33); }
{RandSkewNormal d(new E(125713),8.00);
stat |= checkSaveDistribution<E,RandSkewNormal> (d,33); }
{RandStudentT d(new E(125715),5);
stat |= checkSaveDistribution<E,RandStudentT> (d,33); }
......@@ -934,6 +937,7 @@ void randomizeStatics(int n) {
RandExponential::shoot();
RandGamma::shoot();
RandLandau::shoot();
RandSkewNormal::shoot();
RandStudentT::shoot();
}
}
......@@ -958,6 +962,7 @@ std::vector<double> captureStatics() {
c.push_back( RandExponential::shoot() );
c.push_back( RandGamma::shoot() );
c.push_back( RandLandau::shoot() );
c.push_back( RandSkewNormal::shoot() );
c.push_back( RandStudentT::shoot() );
return c;
}
......@@ -1405,6 +1410,7 @@ int main() {
stat |= staticSave <RandPoisson>(7);
stat |= staticSave <RandPoissonQ>(7);
stat |= staticSave <RandPoissonT>(7);
stat |= staticSave <RandSkewNormal>(7);
stat |= staticSave <RandStudentT>(7);
#endif
......
......@@ -69,6 +69,7 @@ void randomizeStatics(int n) {
RandExponential::shoot();
RandGamma::shoot();
RandLandau::shoot();
RandSkewNormal::shoot();
RandStudentT::shoot();
}
}
......@@ -93,6 +94,7 @@ std::vector<double> captureStatics() {
c.push_back( RandExponential::shoot() );
c.push_back( RandGamma::shoot() );
c.push_back( RandLandau::shoot() );
c.push_back( RandSkewNormal::shoot() );
c.push_back( RandStudentT::shoot() );
return c;
}
......
// -*- C++ -*-
// $Id: testDistCopy.cc,v 1.2 2010/06/16 17:24:53 garren Exp $
// $Id: testDistCopy.cc,v 1.3 2011/05/31 20:57:01 garren Exp $
// ----------------------------------------------------------------------
// ======================================================================
......@@ -29,6 +29,7 @@
#include "CLHEP/Random/RandLandau.h" // CLHEP::RandLandau
#include "CLHEP/Random/RandPoissonQ.h" // CLHEP::RandPoissonQ
#include "CLHEP/Random/RandPoissonT.h" // CLHEP::RandPoissonT
#include "CLHEP/Random/RandSkewNormal.h" // CLHEP::RandSkewNormal
#include "CLHEP/Random/RandStudentT.h" // CLHEP::RandStudentT
// ----------------------------------------------------------------------
......@@ -116,6 +117,7 @@ static uint const Poisson_failure = 1u << 12;
static uint const PoissonQ_failure = 1u << 13;
static uint const PoissonT_failure = 1u << 14;
static uint const StudentT_failure = 1u << 15;
static uint const SkewNormal_failure = 1u << 16;
// ----------------------------------------------------------------------
......@@ -358,6 +360,23 @@ uint testRandPoissonT()
} // testRandPoissonT
// ----------------------------------------------------------------------
// RandSkewNormal
uint testRandSkewNormal()
{
MTwistEngine r1( 97531L );
RandSkewNormal d1( r1 );
if( ! copy_constructor_is_okay(d1) ) return SkewNormal_failure;
DualRand r2( 13579L );
RandSkewNormal d2( r2 );
if( ! copy_assignment_is_okay(d1,d2) ) return SkewNormal_failure;
return 0u;
} // testRandSkewNormal
// ----------------------------------------------------------------------
// RandStudentT
......@@ -395,6 +414,7 @@ int main()
| testRandPoisson ()
| testRandPoissonQ ()
| testRandPoissonT ()
| testRandSkewNormal ()
| testRandStudentT ()
;
......
......@@ -297,6 +297,7 @@ int fileNotThereEngine() {
stat |= fileNotThere <E, RandPoisson>();
stat |= fileNotThere <E, RandPoissonQ>();
stat |= fileNotThere <E, RandPoissonT>();
stat |= fileNotThere <E, RandSkewNormal>();
stat |= fileNotThere <E, RandStudentT>();
return stat;
}
......
......@@ -257,6 +257,7 @@ void randomizeStatics(int n) {
RandExponential::shoot();
RandGamma::shoot();
RandLandau::shoot();
RandSkewNormal::shoot();
RandStudentT::shoot();
}
}
......@@ -281,6 +282,7 @@ std::vector<double> captureStatics() {
c.push_back( RandExponential::shoot() );
c.push_back( RandGamma::shoot() );
c.push_back( RandLandau::shoot() );
c.push_back( RandSkewNormal::shoot() );
c.push_back( RandStudentT::shoot() );
return c;
}
......@@ -329,6 +331,7 @@ int main() {
stat |= staticSave <RandPoisson>(7);
stat |= staticSave <RandPoissonQ>(7);
stat |= staticSave <RandPoissonT>(7);
stat |= staticSave <RandSkewNormal>(7);
stat |= staticSave <RandStudentT>(7);
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment