| 1 | /*
 | 
|---|
| 2 |  * Project: MoleCuilder
 | 
|---|
| 3 |  * Description: creates and alters molecular systems
 | 
|---|
| 4 |  * Copyright (C)  2010 University of Bonn. All rights reserved.
 | 
|---|
| 5 |  * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
 | 
|---|
| 6 |  */
 | 
|---|
| 7 | 
 | 
|---|
| 8 | /*
 | 
|---|
| 9 |  * \file RandomNumberDistribution_Encapsulation_impl.hpp
 | 
|---|
| 10 |  *
 | 
|---|
| 11 |  * Herein we place specializations of specific functions for specific distributions.
 | 
|---|
| 12 |  *
 | 
|---|
| 13 |  *  Created on: Jan 5, 2011
 | 
|---|
| 14 |  *      Author: heber
 | 
|---|
| 15 |  */
 | 
|---|
| 16 | 
 | 
|---|
| 17 | // include config.h
 | 
|---|
| 18 | #ifdef HAVE_CONFIG_H
 | 
|---|
| 19 | #include <config.h>
 | 
|---|
| 20 | #endif
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #include "CodePatterns/MemDebug.hpp"
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #include "RandomNumberDistribution_Encapsulation.hpp"
 | 
|---|
| 25 | 
 | 
|---|
| 26 | 
 | 
|---|
| 27 | /* ===============  min() ======================= */
 | 
|---|
| 28 | 
 | 
|---|
| 29 | template <>
 | 
|---|
| 30 | double RandomNumberDistribution_Encapsulation< boost::uniform_smallint<> >::min() const
 | 
|---|
| 31 | {
 | 
|---|
| 32 |         return distribution_type.min();
 | 
|---|
| 33 | }
 | 
|---|
| 34 | 
 | 
|---|
| 35 | template <>
 | 
|---|
| 36 | double RandomNumberDistribution_Encapsulation< boost::uniform_int<> >::min() const
 | 
|---|
| 37 | {
 | 
|---|
| 38 |         return distribution_type.min();
 | 
|---|
| 39 | }
 | 
|---|
| 40 | 
 | 
|---|
| 41 | template <>
 | 
|---|
| 42 | double RandomNumberDistribution_Encapsulation< boost::uniform_01<> >::min() const
 | 
|---|
| 43 | {
 | 
|---|
| 44 |         return distribution_type.min();
 | 
|---|
| 45 | }
 | 
|---|
| 46 | 
 | 
|---|
| 47 | template <>
 | 
|---|
| 48 | double RandomNumberDistribution_Encapsulation< boost::uniform_real<> >::min() const
 | 
|---|
| 49 | {
 | 
|---|
| 50 |         return distribution_type.min();
 | 
|---|
| 51 | }
 | 
|---|
| 52 | 
 | 
|---|
| 53 | 
 | 
|---|
| 54 | 
 | 
|---|
| 55 | /* ===============  max() ======================= */
 | 
|---|
| 56 | 
 | 
|---|
| 57 | template <>
 | 
|---|
| 58 | double RandomNumberDistribution_Encapsulation< boost::uniform_smallint<> >::max() const
 | 
|---|
| 59 | {
 | 
|---|
| 60 |   return distribution_type.max();
 | 
|---|
| 61 | }
 | 
|---|
| 62 | 
 | 
|---|
| 63 | template <>
 | 
|---|
| 64 | double RandomNumberDistribution_Encapsulation< boost::uniform_int<> >::max() const
 | 
|---|
| 65 | {
 | 
|---|
| 66 |   return distribution_type.max();
 | 
|---|
| 67 | }
 | 
|---|
| 68 | 
 | 
|---|
| 69 | template <>
 | 
|---|
| 70 | double RandomNumberDistribution_Encapsulation< boost::uniform_01<> >::max() const
 | 
|---|
| 71 | {
 | 
|---|
| 72 |   return distribution_type.max();
 | 
|---|
| 73 | }
 | 
|---|
| 74 | 
 | 
|---|
| 75 | template <>
 | 
|---|
| 76 | double RandomNumberDistribution_Encapsulation< boost::uniform_real<> >::max() const
 | 
|---|
| 77 | {
 | 
|---|
| 78 |   return distribution_type.max();
 | 
|---|
| 79 | }
 | 
|---|
| 80 | 
 | 
|---|
| 81 | 
 | 
|---|
| 82 | /* ===============  p() ======================= */
 | 
|---|
| 83 | 
 | 
|---|
| 84 | template <>
 | 
|---|
| 85 | double RandomNumberDistribution_Encapsulation< boost::bernoulli_distribution<> >::p() const
 | 
|---|
| 86 | {
 | 
|---|
| 87 |   return distribution_type.p();
 | 
|---|
| 88 | }
 | 
|---|
| 89 | 
 | 
|---|
| 90 | template <>
 | 
|---|
| 91 | double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::p() const
 | 
|---|
| 92 | {
 | 
|---|
| 93 |   return distribution_type.p();
 | 
|---|
| 94 | }
 | 
|---|
| 95 | 
 | 
|---|
| 96 | template <>
 | 
|---|
| 97 | double RandomNumberDistribution_Encapsulation< boost::geometric_distribution<> >::p() const
 | 
|---|
| 98 | {
 | 
|---|
| 99 |   return distribution_type.p();
 | 
|---|
| 100 | }
 | 
|---|
| 101 | 
 | 
|---|
| 102 | 
 | 
|---|
| 103 | /* ===============  t() ======================= */
 | 
|---|
| 104 | 
 | 
|---|
| 105 | template <>
 | 
|---|
| 106 | double RandomNumberDistribution_Encapsulation< boost::binomial_distribution<> >::t() const
 | 
|---|
| 107 | {
 | 
|---|
| 108 |   return distribution_type.t();
 | 
|---|
| 109 | }
 | 
|---|
| 110 | 
 | 
|---|
| 111 | /* ===============  median() ======================= */
 | 
|---|
| 112 | 
 | 
|---|
| 113 | template <>
 | 
|---|
| 114 | double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::median() const
 | 
|---|
| 115 | {
 | 
|---|
| 116 |   return distribution_type.median();
 | 
|---|
| 117 | }
 | 
|---|
| 118 | 
 | 
|---|
| 119 | /* ===============  sigma() ======================= */
 | 
|---|
| 120 | 
 | 
|---|
| 121 | template <>
 | 
|---|
| 122 | double RandomNumberDistribution_Encapsulation< boost::cauchy_distribution<> >::sigma() const
 | 
|---|
| 123 | {
 | 
|---|
| 124 |   return distribution_type.sigma();
 | 
|---|
| 125 | }
 | 
|---|
| 126 | 
 | 
|---|
| 127 | template <>
 | 
|---|
| 128 | double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::sigma() const
 | 
|---|
| 129 | {
 | 
|---|
| 130 |   return distribution_type.sigma();
 | 
|---|
| 131 | }
 | 
|---|
| 132 | 
 | 
|---|
| 133 | template <>
 | 
|---|
| 134 | double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::sigma() const
 | 
|---|
| 135 | {
 | 
|---|
| 136 |   return distribution_type.sigma();
 | 
|---|
| 137 | }
 | 
|---|
| 138 | 
 | 
|---|
| 139 | /* ===============  alpha() ======================= */
 | 
|---|
| 140 | 
 | 
|---|
| 141 | template <>
 | 
|---|
| 142 | double RandomNumberDistribution_Encapsulation< boost::gamma_distribution<> >::alpha() const
 | 
|---|
| 143 | {
 | 
|---|
| 144 |   return distribution_type.alpha();
 | 
|---|
| 145 | }
 | 
|---|
| 146 | 
 | 
|---|
| 147 | 
 | 
|---|
| 148 | /* ===============  mean() ======================= */
 | 
|---|
| 149 | 
 | 
|---|
| 150 | template <>
 | 
|---|
| 151 | double RandomNumberDistribution_Encapsulation< boost::poisson_distribution<> >::mean() const
 | 
|---|
| 152 | {
 | 
|---|
| 153 |   return distribution_type.mean();
 | 
|---|
| 154 | }
 | 
|---|
| 155 | 
 | 
|---|
| 156 | template <>
 | 
|---|
| 157 | double RandomNumberDistribution_Encapsulation< boost::normal_distribution<> >::mean() const
 | 
|---|
| 158 | {
 | 
|---|
| 159 |   return distribution_type.mean();
 | 
|---|
| 160 | }
 | 
|---|
| 161 | 
 | 
|---|
| 162 | template <>
 | 
|---|
| 163 | double RandomNumberDistribution_Encapsulation< boost::lognormal_distribution<> >::mean() const
 | 
|---|
| 164 | {
 | 
|---|
| 165 |   return distribution_type.mean();
 | 
|---|
| 166 | }
 | 
|---|
| 167 | 
 | 
|---|
| 168 | /* ===============  a() ======================= */
 | 
|---|
| 169 | 
 | 
|---|
| 170 | template <>
 | 
|---|
| 171 | double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::a() const
 | 
|---|
| 172 | {
 | 
|---|
| 173 |   return distribution_type.a();
 | 
|---|
| 174 | }
 | 
|---|
| 175 | 
 | 
|---|
| 176 | 
 | 
|---|
| 177 | /* ===============  b() ======================= */
 | 
|---|
| 178 | 
 | 
|---|
| 179 | template <>
 | 
|---|
| 180 | double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::b() const
 | 
|---|
| 181 | {
 | 
|---|
| 182 |   return distribution_type.b();
 | 
|---|
| 183 | }
 | 
|---|
| 184 | 
 | 
|---|
| 185 | 
 | 
|---|
| 186 | /* ===============  c() ======================= */
 | 
|---|
| 187 | 
 | 
|---|
| 188 | template <>
 | 
|---|
| 189 | double RandomNumberDistribution_Encapsulation< boost::triangle_distribution<> >::c() const
 | 
|---|
| 190 | {
 | 
|---|
| 191 |   return distribution_type.c();
 | 
|---|
| 192 | }
 | 
|---|
| 193 | 
 | 
|---|
| 194 | 
 | 
|---|
| 195 | /* ===============  lambda() ======================= */
 | 
|---|
| 196 | 
 | 
|---|
| 197 | template <>
 | 
|---|
| 198 | double RandomNumberDistribution_Encapsulation< boost::exponential_distribution<> >::lambda() const
 | 
|---|
| 199 | {
 | 
|---|
| 200 |   return distribution_type.lambda();
 | 
|---|
| 201 | }
 | 
|---|
| 202 | 
 | 
|---|
| 203 | 
 | 
|---|