/*
* Project: MoleCuilder
* Description: creates and alters molecular systems
* Copyright (C) 2010-2012 University of Bonn. All rights reserved.
*
*
* This file is part of MoleCuilder.
*
* MoleCuilder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* MoleCuilder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MoleCuilder. If not, see .
*/
/*
* \file RandomNumberDistribution_Encapsulation_impl.hpp
*
* Herein we place specializations of specific functions for specific distributions.
*
* Created on: Jan 5, 2011
* Author: heber
*/
// include config.h
#ifdef HAVE_CONFIG_H
#include
#endif
//#include "CodePatterns/MemDebug.hpp"
#include
#include "RandomNumberDistribution_Encapsulation.hpp"
/* ========= manipulatedclone() ================ */
template <>
RandomNumberDistribution_Encapsulation< boost::uniform_smallint<> >::
RandomNumberDistribution_Encapsulation (const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.min, _params.max)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::uniform_int<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.min, _params.max)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::uniform_real<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.min, _params.max)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::bernoulli_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.p)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type((int)_params.t, _params.p)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.median, _params.sigma)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::gamma_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.alpha)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::poisson_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.mean)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::geometric_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.p)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.a, _params.b, _params.c)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::exponential_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.lambda)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.mean, _params.sigma)
{}
template <>
RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::
RandomNumberDistribution_Encapsulation(const RandomNumberDistribution_Parameters&_params) :
distribution_type(_params.mean, _params.sigma)
{}
/* =============== min() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_smallint<> >::min() const
{
return distribution_type.min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_int<> >::min() const
{
return distribution_type.min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_01<> >::min() const
{
return distribution_type.min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_real<> >::min() const
{
return distribution_type.min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::bernoulli_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::min() const
{
return std::numeric_limits::min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::gamma_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::poisson_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::geometric_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::min() const
{
return distribution_type.a();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::exponential_distribution<> >::min() const
{
return 0.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::min() const
{
return std::numeric_limits::min();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::min() const
{
return 0.;
}
/* =============== max() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_smallint<> >::max() const
{
return distribution_type.max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_int<> >::max() const
{
return distribution_type.max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_01<> >::max() const
{
return distribution_type.max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::uniform_real<> >::max() const
{
return distribution_type.max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::bernoulli_distribution<> >::max() const
{
return 1.;
}
template <>
double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::max() const
{
return distribution_type.t();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::gamma_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::poisson_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::geometric_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::max() const
{
return distribution_type.c();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::exponential_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::max() const
{
return std::numeric_limits::max();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::max() const
{
return std::numeric_limits::max();
}
/* =============== p() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::bernoulli_distribution<> >::p() const
{
return distribution_type.p();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::p() const
{
return distribution_type.p();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::geometric_distribution<> >::p() const
{
return distribution_type.p();
}
/* =============== t() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::t() const
{
return distribution_type.t();
}
/* =============== median() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::median() const
{
return distribution_type.median();
}
/* =============== sigma() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::sigma() const
{
return distribution_type.sigma();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::sigma() const
{
return distribution_type.sigma();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::sigma() const
{
return distribution_type.sigma();
}
/* =============== alpha() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::gamma_distribution<> >::alpha() const
{
return distribution_type.alpha();
}
/* =============== mean() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::poisson_distribution<> >::mean() const
{
return distribution_type.mean();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::mean() const
{
return distribution_type.mean();
}
template <>
double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::mean() const
{
return distribution_type.mean();
}
/* =============== a() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::a() const
{
return distribution_type.a();
}
/* =============== b() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::b() const
{
return distribution_type.b();
}
/* =============== c() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::c() const
{
return distribution_type.c();
}
/* =============== lambda() ======================= */
template <>
double RandomNumberDistribution_Encapsulation< boost::exponential_distribution<> >::lambda() const
{
return distribution_type.lambda();
}