Main Page
Namespaces
Classes
Files
File List
File Members
include
amcl
pf
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
31
#include "
pf_vector.h
"
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
48
pf_vector_t
x
;
49
pf_matrix_t
cx
;
50
//pf_matrix_t cxi;
51
double
cxdet
;
52
53
// Decomposed covariance matrix (rotation * diagonal)
54
pf_matrix_t
cr
;
55
pf_vector_t
cd
;
56
57
// A random number generator
58
//gsl_rng *rng;
59
60
}
pf_pdf_gaussian_t
;
61
62
63
// Create a gaussian pdf
64
pf_pdf_gaussian_t
*
pf_pdf_gaussian_alloc
(
pf_vector_t
x,
pf_matrix_t
cx);
65
66
// Destroy the pdf
67
void
pf_pdf_gaussian_free
(
pf_pdf_gaussian_t
*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.
79
pf_vector_t
pf_pdf_gaussian_sample
(
pf_pdf_gaussian_t
*pdf);
80
81
#ifdef __cplusplus
82
}
83
#endif
84
85
#endif
pf_pdf_gaussian_t::x
pf_vector_t x
Definition:
pf_pdf.h:48
pf_pdf_gaussian_t::cr
pf_matrix_t cr
Definition:
pf_pdf.h:54
pf_pdf_gaussian_t
Definition:
pf_pdf.h:45
pf_pdf_gaussian_free
void pf_pdf_gaussian_free(pf_pdf_gaussian_t *pdf)
Definition:
pf_pdf.c:74
pf_pdf_gaussian_t::cx
pf_matrix_t cx
Definition:
pf_pdf.h:49
pf_pdf_gaussian_alloc
pf_pdf_gaussian_t * pf_pdf_gaussian_alloc(pf_vector_t x, pf_matrix_t cx)
Definition:
pf_pdf.c:46
pf_pdf_gaussian_t::cxdet
double cxdet
Definition:
pf_pdf.h:51
pf_pdf_gaussian_t::cd
pf_vector_t cd
Definition:
pf_pdf.h:55
pf_matrix_t
Definition:
pf_vector.h:45
pf_ran_gaussian
double pf_ran_gaussian(double sigma)
Definition:
pf_pdf.c:132
pf_vector.h
pf_pdf_gaussian_sample
pf_vector_t pf_pdf_gaussian_sample(pf_pdf_gaussian_t *pdf)
Definition:
pf_pdf.c:105
pf_vector_t
Definition:
pf_vector.h:38
amcl
Author(s): Brian P. Gerkey, contradict@gmail.com
autogenerated on Sun Mar 3 2019 03:44:09