⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bayesflt_8hpp-source.html

📁 Bayes滤波器算法C++类说明文档,源码见Bayes滤波器算法
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Bayes++ Bayesian Filtering Classes: bayesFlt.hpp Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><h1>bayesFlt.hpp</h1><a href="bayesFlt_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef _BAYES_FILTER</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define _BAYES_FILTER</span>00003 <span class="preprocessor"></span>00004 <span class="comment">/*</span>00005 <span class="comment"> * Bayes++ the Bayesian Filtering Library</span>00006 <span class="comment"> * Copyright (c) 2002 Michael Stevens</span>00007 <span class="comment"> * See accompanying Bayes++.htm for terms and conditions of use.</span>00008 <span class="comment"> *</span>00009 <span class="comment"> * $Header: /cvsroot/bayesclasses/Bayes++/BayesFilter/bayesFlt.hpp,v 1.24.2.1 2004/02/11 21:06:42 mistevens Exp $</span>00010 <span class="comment"> * $NoKeywords: $</span>00011 <span class="comment"> */</span>00012 00013 <span class="comment">/*</span>00014 <span class="comment"> * Bayesian filtering reresented as Dual heirarchy of:</span>00015 <span class="comment"> *  Prediction and Observation models</span>00016 <span class="comment"> *  Filtering Schemes</span>00017 <span class="comment"> */</span>00018  00019 <span class="comment">// Common headers required for declerations</span>00020 <span class="preprocessor">#include "<a class="code" href="bayesException_8hpp.html">bayesException.hpp</a>"</span>   <span class="comment">// exception types</span>00021 <span class="preprocessor">#include "<a class="code" href="matSupSub_8hpp.html">matSupSub.hpp</a>"</span>            <span class="comment">// matrix support subsystem</span>00022 00023 <span class="comment">/* Filter namespace */</span>00024 <span class="keyword">namespace </span>Bayesian_filter00025 {00026     <span class="comment">// Allow use of a short name for matrix namespace</span>00027     <span class="keyword">namespace </span>FM = Bayesian_filter_matrix;00028 00029 00030 <span class="comment">/*</span>00031 <span class="comment"> * Abstraction support classes, at the base of the heirarchy</span>00032 <span class="comment"> */</span>00033 <a name="l00034"></a><a class="code" href="classBayesian__filter_1_1Bayes__base.html">00034</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Bayes__base.html">Bayes_base</a> {00035 <span class="comment">/*</span>00036 <span class="comment"> * A very abstract Polymorphic base representation!</span>00037 <span class="comment"> * Interface provides: type, internal error handing, and destruction</span>00038 <span class="comment"> */</span>00039 <span class="keyword">public</span>:<a name="l00040"></a><a class="code" href="classBayesian__filter_1_1Bayes__base.html#w0">00040</a>     <span class="keyword">typedef</span> Bayesian_filter_matrix::Float <a class="code" href="classBayesian__filter_1_1Bayes__base.html#w0">Float</a>;00041     <span class="comment">// Type used thoughout as a number representation for state etc</span>00042 00043     <span class="keyword">virtual</span> <a class="code" href="classBayesian__filter_1_1Bayes__base.html#a0">~Bayes_base</a>() = 0;00044     <span class="comment">// Polymorphic</span>00045 00046     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Bayes__base.html#e0">error</a> (<span class="keyword">const</span> <a class="code" href="classBayesian__filter_1_1Numeric__exception.html">Numeric_exception</a>&amp; a);00047     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Bayes__base.html#e0">error</a> (<span class="keyword">const</span> <a class="code" href="classBayesian__filter_1_1Logic__exception.html">Logic_exception</a>&amp; a);00048     <span class="comment">// Report a filter, throw a Filter_exception</span>00049     <span class="comment">//  No exception saftey rules are specified, assume the object is invalid</span>00050     <span class="comment">// May have side effects for debuging</span>00051 };00052 00053 <a name="l00054"></a><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html">00054</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html">Numerical_rcond</a>00055 <span class="comment">/*</span>00056 <span class="comment"> * Numerical comparison of reciprocal condition numbers</span>00057 <span class="comment"> *  Required for all linear algebra in models and filters</span>00058 <span class="comment"> *  Implements minimum allowable reciprocal condition number for PD Matrix factorisations</span>00059 <span class="comment"> */</span>00060 {00061 <span class="keyword">public</span>:<a name="l00062"></a><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a0">00062</a>     <a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a0">Numerical_rcond</a>()00063     {   limit_PD = limit_PD_init;00064     }<a name="l00065"></a><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a1">00065</a>     <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a1">set_limit_PD</a>(Bayes_base::Float nl)00066     {   limit_PD = nl;00067     }<a name="l00068"></a><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a2">00068</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a2">check_PSD</a> (Bayes_base::Float rcond, <span class="keyword">const</span> <span class="keywordtype">char</span>* error_description) <span class="keyword">const</span>00069     <span class="comment">/* Checks a the reciprocal condition number</span>00070 <span class="comment">     * Generates a Bayes_filter_exception if value represents a NON PSD matrix</span>00071 <span class="comment">     * Inverting condition provides a test for IEC 559 NaN values</span>00072 <span class="comment">     */</span>00073     {   <span class="keywordflow">if</span> (!(rcond &gt;= 0))00074             Bayes_base::error (<a class="code" href="classBayesian__filter_1_1Numeric__exception.html">Numeric_exception</a> (error_description));00075     }00076 <a name="l00077"></a><a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a3">00077</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Numerical__rcond.html#a3">check_PD</a> (Bayes_base::Float rcond, <span class="keyword">const</span> <span class="keywordtype">char</span>* error_description) <span class="keyword">const</span>00078     <span class="comment">/* Checks a reciprocal condition number</span>00079 <span class="comment">     * Generates a Bayes_filter_exception if value represents a NON PD matrix</span>00080 <span class="comment">     * I.e. rcond is bellow given conditioning limit</span>00081 <span class="comment">     * Inverting condition provides a test for IEC 559 NaN values</span>00082 <span class="comment">     */</span>00083     {   <span class="keywordflow">if</span> (!(rcond &gt;= limit_PD))00084             Bayes_base::error (<a class="code" href="classBayesian__filter_1_1Numeric__exception.html">Numeric_exception</a> (error_description));00085     }00086 <span class="keyword">private</span>:00087     Bayes_base::Float limit_PD;     00088     <span class="keyword">const</span> <span class="keyword">static</span> Bayes_base::Float limit_PD_init;   <span class="comment">// Initial common value for limit_PD</span>00089 };00090 00091 00092 <span class="comment">/*</span>00093 <span class="comment"> * Abstract Prediction models</span>00094 <span class="comment"> *  Predict models are used to parameterise predict functions of filters</span>00095 <span class="comment"> */</span><a name="l00096"></a><a class="code" href="classBayesian__filter_1_1Predict__model__base.html">00096</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Predict__model__base.html">Predict_model_base</a> : <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Bayes__base.html">Bayes_base</a>00097 {00098     <span class="comment">// Empty</span>00099 };00100 00101 <a name="l00102"></a><a class="code" href="classBayesian__filter_1_1Sampled__predict__model.html">00102</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Sampled__predict__model.html">Sampled_predict_model</a> : <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Predict__model__base.html">Predict_model_base</a>00103 <span class="comment">/* Sampled stochastic predict model</span>00104 <span class="comment">    x*(k) = fw(x(k-1), w(k))</span>00105 <span class="comment">   fw should generate samples from the stochastic variable w(k)</span>00106 <span class="comment">   This fundamental model is used instead of the predict likelihood function L(x*|x)</span>00107 <span class="comment">   Since drawing samples from an arbitary L is non-trivial (see MCMC theory)</span>00108 <span class="comment">   the burden is place on the model to generate these samples.</span>00109 <span class="comment">   Defines an Interface without data members</span>00110 <span class="comment"> */</span>00111 {00112 <span class="keyword">public</span>:00113     <span class="keyword">virtual</span> <span class="keyword">const</span> FM::Vec&amp; <a class="code" href="classBayesian__filter_1_1Sampled__predict__model.html#a0">fw</a>(<span class="keyword">const</span> FM::Vec&amp; x) <span class="keyword">const</span> = 0;00114     <span class="comment">// Note: Reference return value as a speed optimisation, MUST be copied by caller.</span>00115 };00116 <a name="l00117"></a><a class="code" href="classBayesian__filter_1_1Functional__predict__model.html">00117</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Functional__predict__model.html">Functional_predict_model</a> :<span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Predict__model__base.html">Predict_model_base</a>00118 <span class="comment">/* Functional (non-stochastic) predict model f</span>00119 <span class="comment">    x*(k) = fx(x(k-1))</span>00120 <span class="comment">   This fundamental model is used instead of the predict likelihood function L(x*|x)</span>00121 <span class="comment">   Since L is a delta function which isn't much use for numerical systems.</span>00122 <span class="comment">   Defines an Interface without data members</span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -