JWS C Library
C language utility library
|
00001 /* 00002 * This work is licensed under a Creative Commons 00003 * Attribution-Noncommercial-Share Alike 3.0 United States License. 00004 * 00005 * http://creativecommons.org/licenses/by-nc-sa/3.0/us/ 00006 * 00007 * You are free: 00008 * 00009 * to Share - to copy, distribute, display, and perform the work 00010 * to Remix - to make derivative works 00011 * 00012 * Under the following conditions: 00013 * 00014 * Attribution. You must attribute the work in the manner specified by the 00015 * author or licensor (but not in any way that suggests that they endorse you 00016 * or your use of the work). 00017 * 00018 * Noncommercial. You may not use this work for commercial purposes. 00019 * 00020 * Share Alike. If you alter, transform, or build upon this work, you may 00021 * distribute the resulting work only under the same or similar license to 00022 * this one. 00023 * 00024 * For any reuse or distribution, you must make clear to others the license 00025 * terms of this work. The best way to do this is by including this header. 00026 * 00027 * Any of the above conditions can be waived if you get permission from the 00028 * copyright holder. 00029 * 00030 * Apart from the remix rights granted under this license, nothing in this 00031 * license impairs or restricts the author's moral rights. 00032 */ 00033 00034 00046 #ifndef PDF_H 00047 #define PDF_H 00048 00049 00050 #include <jwsc/config.h> 00051 00052 #include <stdlib.h> 00053 00054 00055 #ifdef __cplusplus 00056 namespace jwsc { 00057 extern "C" { 00058 #endif 00059 00060 00072 float standard_gaussian_pdf_f(float x); 00073 00078 double standard_gaussian_pdf_d(double x); 00079 00091 float gaussian_pdf_f(float mu, float sigma, float x); 00092 00094 double gaussian_pdf_d(double mu, double sigma, double x); 00095 00110 float log_standard_gaussian_pdf_f(float x); 00111 00116 double log_standard_gaussian_pdf_d(double x); 00117 00132 float log_gaussian_pdf_f(float mu, float sigma, float x); 00133 00138 double log_gaussian_pdf_d(double mu, double sigma, double x); 00139 00143 #if defined JWSC_HAVE_SLATEC || defined JWSC_HAVE_ERF 00144 00155 float integrate_gaussian_pdf_f 00156 ( 00157 float mu, 00158 float sigma, 00159 float a, 00160 float b 00161 ); 00162 00163 00168 double integrate_gaussian_pdf_d 00169 ( 00170 double mu, 00171 double sigma, 00172 double a, 00173 double b 00174 ); 00175 00177 #endif 00178 00179 00191 float sample_standard_gaussian_pdf_f(float a, float b); 00192 00197 double sample_standard_gaussian_pdf_d(double a, double b); 00198 00210 float sample_gaussian_pdf_f 00211 ( 00212 float mu, 00213 float sigma, 00214 float a, 00215 float b 00216 ); 00217 00219 double sample_gaussian_pdf_d 00220 ( 00221 double mu, 00222 double sigma, 00223 double a, 00224 double b 00225 ); 00226 00230 #if defined JWSC_HAVE_TGAMMA 00231 00239 float gamma_pdf_f(float alpha, float beta, float x); 00240 00242 double gamma_pdf_d(double alpha, double beta, double x); 00243 00245 #endif 00246 00247 00248 #if defined JWSC_HAVE_LGAMMA 00249 00260 float log_gamma_pdf_f(float alpha, float beta, float x); 00261 00266 double log_gamma_pdf_d(double alpha, double beta, double x); 00267 00269 #endif 00270 00271 00272 #if defined JWSC_HAVE_TGAMMA 00273 00281 float sample_gamma_pdf_f 00282 ( 00283 float alpha, 00284 float beta, 00285 float a, 00286 float b 00287 ); 00288 00290 double sample_gamma_pdf_d 00291 ( 00292 double alpha, 00293 double beta, 00294 double a, 00295 double b 00296 ); 00297 00299 #endif 00300 00301 00310 float sample_uniform_pdf_f(float a, float b); 00311 00313 double sample_uniform_pdf_d(double a, double b); 00314 00329 float sample_sine_pdf_f(); 00330 00335 double sample_sine_pdf_d(); 00336 00340 #ifdef __cplusplus 00341 } 00342 } 00343 #endif 00344 00345 00346 #endif