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 MV_PDF_H 00047 #define MV_PDF_H 00048 00049 00050 #include <jwsc/config.h> 00051 00052 #include <stdlib.h> 00053 #include <inttypes.h> 00054 00055 #include "jwsc/base/error.h" 00056 #include "jwsc/vector/vector.h" 00057 #include "jwsc/matrix/matrix.h" 00058 00059 00060 #ifdef __cplusplus 00061 namespace jwsc { 00062 extern "C" { 00063 #endif 00064 00065 00066 #if defined JWSC_HAVE_LAPACK 00067 00077 Error* mv_gaussian_pdf_f 00078 ( 00079 float* p_out, 00080 const Vector_f* mu, 00081 const Matrix_f* sigma, 00082 const Vector_f* x 00083 ); 00084 00088 Error* mv_gaussian_pdf_d 00089 ( 00090 double* p_out, 00091 const Vector_d* mu, 00092 const Matrix_d* sigma, 00093 const Vector_d* x 00094 ); 00095 00097 #endif 00098 00099 00100 #if defined JWSC_HAVE_LAPACK 00101 00112 Error* set_mv_gaussian_pdf_f 00113 ( 00114 Vector_f** p_out, 00115 const Vector_f* mu, 00116 const Matrix_f* sigma, 00117 const Matrix_f* x 00118 ); 00119 00124 Error* set_mv_gaussian_pdf_d 00125 ( 00126 Vector_d** p_out, 00127 const Vector_d* mu, 00128 const Matrix_d* sigma, 00129 const Matrix_d* x 00130 ); 00131 00133 #endif 00134 00135 00136 #if defined JWSC_HAVE_LAPACK 00137 00148 Error* log_mv_gaussian_pdf_f 00149 ( 00150 float* p_out, 00151 const Vector_f* mu, 00152 const Matrix_f* sigma, 00153 const Vector_f* x 00154 ); 00155 00160 Error* log_mv_gaussian_pdf_d 00161 ( 00162 double* p_out, 00163 const Vector_d* mu, 00164 const Matrix_d* sigma, 00165 const Vector_d* x 00166 ); 00167 00169 #endif 00170 00171 00183 void sample_standard_mv_gaussian_pdf_f 00184 ( 00185 Vector_f** x_out, 00186 uint32_t D 00187 ); 00188 00193 void sample_standard_mv_gaussian_pdf_d 00194 ( 00195 Vector_d** x_out, 00196 uint32_t D 00197 ); 00198 00213 void set_sample_standard_mv_gaussian_pdf_f 00214 ( 00215 Matrix_f** x_out, 00216 uint32_t N, 00217 uint32_t D 00218 ); 00219 00224 void set_sample_standard_mv_gaussian_pdf_d 00225 ( 00226 Matrix_d** x_out, 00227 uint32_t N, 00228 uint32_t D 00229 ); 00230 00234 #if defined JWSC_HAVE_LAPACK 00235 00246 Error* sample_mv_gaussian_pdf_f 00247 ( 00248 Vector_f** x_out, 00249 const Vector_f* mu, 00250 const Matrix_f* sigma 00251 ); 00252 00257 Error* sample_mv_gaussian_pdf_d 00258 ( 00259 Vector_d** x_out, 00260 const Vector_d* mu, 00261 const Matrix_d* sigma 00262 ); 00263 00265 #endif 00266 00267 00268 #if defined JWSC_HAVE_LAPACK 00269 00280 Error* set_sample_mv_gaussian_pdf_f 00281 ( 00282 Matrix_f** x_out, 00283 uint32_t N, 00284 const Vector_f* mu, 00285 const Matrix_f* sigma 00286 ); 00287 00292 Error* set_sample_mv_gaussian_pdf_d 00293 ( 00294 Matrix_d** x_out, 00295 uint32_t N, 00296 const Vector_d* mu, 00297 const Matrix_d* sigma 00298 ); 00299 00301 #endif 00302 00303 00304 #ifdef __cplusplus 00305 } 00306 } 00307 #endif 00308 00309 00310 #endif