pf_pdf.h
Go to the documentation of this file.
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2000 Brian Gerkey & Kasper Stoy
4  * gerkey@usc.edu kaspers@robotics.usc.edu
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 /**************************************************************************
22  * Desc: Useful pdf functions
23  * Author: Andrew Howard
24  * Date: 10 Dec 2002
25  * CVS: $Id: pf_pdf.h 6345 2008-04-17 01:36:39Z gerkey $
26  *************************************************************************/
27 
28 #ifndef PF_PDF_H
29 #define PF_PDF_H
30 
32 
33 //#include <gsl/gsl_rng.h>
34 //#include <gsl/gsl_randist.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /**************************************************************************
41  * Gaussian
42  *************************************************************************/
43 
44 // Gaussian PDF info
45 typedef struct
46 {
47  // Mean, covariance and inverse covariance
50  //pf_matrix_t cxi;
51  double cxdet;
52 
53  // Decomposed covariance matrix (rotation * diagonal)
56 
57  // A random number generator
58  //gsl_rng *rng;
59 
61 
62 
63 // Create a gaussian pdf
65 
66 // Destroy the pdf
68 
69 // Compute the value of the pdf at some point [z].
70 //double pf_pdf_gaussian_value(pf_pdf_gaussian_t *pdf, pf_vector_t z);
71 
72 // Draw randomly from a zero-mean Gaussian distribution, with standard
73 // deviation sigma.
74 // We use the polar form of the Box-Muller transformation, explained here:
75 // http://www.taygeta.com/random/gaussian.html
76 double pf_ran_gaussian(double sigma);
77 
78 // Generate a sample from the the pdf.
80 
81 
82 #if 0
83 
84 /**************************************************************************
85  * Discrete
86  *************************************************************************/
87 
88 // Discrete PDF info
89 typedef struct
90 {
91  // The list of discrete probs
92  int prob_count;
93  double *probs;
94 
95  // A random number generator
96  gsl_rng *rng;
97 
98  // The discrete prob generator
99  gsl_ran_discrete_t *ran;
100 
101 } pf_pdf_discrete_t;
102 
103 
104 // Create a discrete pdf
105 pf_pdf_discrete_t *pf_pdf_discrete_alloc(int count, double *probs);
106 
107 // Destroy the pdf
108 void pf_pdf_discrete_free(pf_pdf_discrete_t *pdf);
109 
110 // Compute the value of the probability of some element [i]
111 double pf_pdf_discrete_value(pf_pdf_discrete_t *pdf, int i);
112 
113 // Generate a sample from the the pdf.
114 int pf_pdf_discrete_sample(pf_pdf_discrete_t *pdf);
115 #endif
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif
pf_vector_t x
Definition: pf_pdf.h:48
pf_matrix_t cr
Definition: pf_pdf.h:54
void pf_pdf_gaussian_free(pf_pdf_gaussian_t *pdf)
Definition: pf_pdf.c:74
pf_matrix_t cx
Definition: pf_pdf.h:49
pf_pdf_gaussian_t * pf_pdf_gaussian_alloc(pf_vector_t x, pf_matrix_t cx)
Definition: pf_pdf.c:46
double cxdet
Definition: pf_pdf.h:51
pf_vector_t cd
Definition: pf_pdf.h:55
double pf_ran_gaussian(double sigma)
Definition: pf_pdf.c:132
pf_vector_t pf_pdf_gaussian_sample(pf_pdf_gaussian_t *pdf)
Definition: pf_pdf.c:105


nav2d_localizer
Author(s): Sebastian Kasperski
autogenerated on Thu Jun 6 2019 19:20:19