亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? udflt.cpp

?? Bayesian Filtering Classe C++source
?? CPP
字號:
/* * Bayes++ the Bayesian Filtering Library * Copyright (c) 2002 Michael Stevens * See accompanying Bayes++.htm for terms and conditions of use. * * $Id: UDFlt.cpp 562 2006-04-05 20:46:23 +0200 (Wed, 05 Apr 2006) mistevens $ *//* * UdU' Factorisation of Covariance Filter. * * For efficiency UD_scheme requires to know the maximum q_size of the predict_model * ISSUES: *  observe functions: returned rcond is the minimum of each sequential update, an overall conditioning would be better */#include "UDFlt.hpp"#include "matSup.hpp"#include <boost/limits.hpp>/* Filter namespace */namespace Bayesian_filter{	using namespace Bayesian_filter_matrix;UD_scheme::UD_scheme (std::size_t x_size, std::size_t q_maxsize, std::size_t z_initialsize) :		Kalman_state_filter(x_size),		q_max(q_maxsize),		UD(x_size,x_size+q_max),		s(Empty), Sd(Empty),		d(x_size+q_max), dv(x_size+q_max), v(x_size+q_max),		a(x_size), b(x_size),		h1(x_size), w(x_size),		znorm(Empty),		zpdecol(Empty),		Gz(Empty),		GIHx(Empty)/* * Initialise filter and set the size of things we know about */{	last_z_size = 0;	// Leave z_size dependants Empty if z_initialsize==0	observe_size (z_initialsize);}UD_scheme& UD_scheme::operator= (const UD_scheme& a)/* Optimise copy assignment to only copy filter state * Precond: matrix size conformance */{	Kalman_state_filter::operator=(a);	q_max = a.q_max;	UD = a.UD;	return *this;}void UD_scheme::init ()/* * Initialise from a state and state coveriance * Computes UD factor from initial covaiance * Predcond: *  X * Postcond: *  X *  UD=X, d is PSD */{					// Factorise X into left partition of UD	std::size_t x_size = UD.size1();	UD.sub_matrix(0,x_size, 0,x_size) .assign (X);	Float rcond = UdUfactor (UD, x_size);	rclimit.check_PSD(rcond, "Initial X not PSD");}void UD_scheme::update ()/* * Defactor UD back into X * Precond: *  UD * Postcond: *  X=UD  PSD iff UD is PSD */{	UdUrecompose (X, UD);}UD_scheme::Float UD_scheme::predict (Linrz_predict_model& f)/* * Prediction using a diagonalised noise q, and its coupling G *  q can have order less then x and a matching G so GqG' has order of x * Precond: *	UD * Postcond: *  UD is PSD */{	x = f.f(x);			// Extended Kalman state predict is f(x) directly						// Predict UD from model	Float rcond = predictGq (f.Fx, f.G, f.q);	rclimit.check_PSD(rcond, "X not PSD in predict");	return rcond;}UD_scheme::Float UD_scheme::predictGq (const Matrix& Fx, const Matrix& G, const FM::Vec& q)/* * MWG-S prediction from Bierman  p.132 *  q can have order less then x and a matching G so GqG' has order of x * Precond: *  UD * Postcond: *  UD * * Return: *		reciprocal condition number, -1 if negative, 0 if semi-definite (including zero) */{	std::size_t i,j,k;	const std::size_t n = x.size();	const std::size_t Nq = q.size();	const std::size_t N = n+Nq;	Float e;					// Check preallocated space for q size	if (Nq > q_max)		error (Logic_exception("Predict model q larger than preallocated space"));	if (n > 0)		// Simplify reverse loop termination	{						// Augment d with q, UD with G		for (i = 0; i < Nq; ++i)		// 0..Nq-1		{			d[i+n] = q[i];		}		for (j = 0; j < n; ++j)		// 0..n-1		{			Matrix::Row UDj(UD,j);			Matrix::const_Row  Gj(G,j);			for (i = 0; i < Nq; ++i)		// 0..Nq-1				UDj[i+n] = Gj[i];		}						// U=Fx*U and diagonals retrived		for (j = n-1; j > 0; --j)		// n-1..1		{						// Prepare d(0)..d(j) as temporary			for (i = 0; i <= j; ++i)	// 0..j				d[i] = Float(UD(i,j));	// ISSUE mixed type proxy assignment						// Lower triangle of UD is implicity empty			for (i = 0; i < n; ++i) 	// 0..n-1			{				Matrix::Row UDi(UD,i);				Matrix::const_Row Fxi(Fx,i);				UDi[j] = Fxi[j];				for (k = 0; k < j; ++k)	// 0..j-1					UDi[j] += Fxi[k] * d[k];			}		}		d[0] = Float(UD(0,0));	// ISSUE mixed type proxy assignment						//  Complete U = Fx*U		for (j = 0; j < n; ++j)			// 0..n-1		{			UD(j,0) = Fx(j,0);		}						// The MWG-S algorithm on UD transpose		j = n-1;		do {							// n-1..0			Matrix::Row UDj(UD,j);			e = 0;			for (k = 0; k < N; ++k)		// 0..N-1			{				v[k] = Float(UDj[k]);	// ISSUE mixed type proxy assignment				dv[k] = d[k] * v[k];				e += v[k] * dv[k];			}			// Check diagonal element			if (e > 0)			{				// Positive definite				UDj[j] = e;				Float diaginv = 1 / e;				for (k = 0; k < j; ++k)	// 0..j-1				{					Matrix::Row UDk(UD,k);					e = 0;					for (i = 0; i < N; ++i)	// 0..N-1						e += UDk[i] * dv[i];					e *= diaginv;					UDj[k] = e;					for (i = 0; i < N; ++i)	// 0..N-1						UDk[i] -= e * v[i];				}			}//PD			else if (e == 0)			{				// Possibly semi-definite, check not negative				UDj[j] = e;				// 1 / e is infinite				for (k = 0; k < j; ++k)	// 0..j-1				{					Matrix::Row UDk(UD,k);					for (i = 0; i < N; ++i)	// 0..N-1					{						e = UDk[i] * dv[i];						if (e != 0)							goto Negative;					}					// UD(j,k) uneffected				}			}//PD			else			{				// Negative				goto Negative;			}		} while (j-- > 0); //MWG-S loop						// Transpose and Zero lower triangle		for (j = 1; j < n; ++j)			// 0..n-1		{			Matrix::Row UDj(UD,j);			for (i = 0; i < j; ++i)			{				UD(i,j) = UDj[i];				UDj[i] = 0;			// Zeroing unnecessary as lower only used as a scratch			}		}	}	// Estimate the reciprocal condition number from upper triangular part	return UdUrcond(UD,n);Negative:	return -1;}void UD_scheme::observe_size (std::size_t z_size)/* * Optimised dyamic observation sizing */{	if (z_size != last_z_size) {		last_z_size = z_size;		s.resize(z_size, false);		Sd.resize(z_size, false);		znorm.resize(z_size, false);	}}Bayes_base::Float UD_scheme::observe (Linrz_uncorrelated_observe_model& h, const Vec& z)/* * Standard linrz observe *  Uncorrelated observations are applied sequentialy in the order they appear in z *  The sequential observation updates state x *  Therefore the model of each observation needs to be computed sequentially. Generally this *  is inefficient and observe (UD_sequential_observe_model&) should be used instead * Precond: *	 UD *	 Zv is PSD * Postcond: *  UD is PSD * Return: Minimum rcond of all squential observe */{	const std::size_t z_size = z.size();	Float s, S;			// Innovation and covariance								// Dynamic sizing	observe_size (z_size);								// Apply observations sequentialy as they are decorrelated	Float rcondmin = std::numeric_limits<Float>::max();	for (std::size_t o = 0; o < z_size; ++o)	{								// Observation model, extracted for a single z element		const Vec& zp = h.h(x);		h.normalise(znorm = z, zp);		h1 = row(h.Hx,o);								// Check Z precondition		if (h.Zv[o] < 0)			error (Numeric_exception("Zv not PSD in observe"));								// Update UD and extract gain		Float rcond = observeUD (w, S, h1, h.Zv[o]);		rclimit.check_PSD(rcond, "S not PD in observe");	// -1 implies S singular		if (rcond < rcondmin) rcondmin = rcond;								// State update using normalised non-linear innovation		s = znorm[o] - zp[o];		noalias(x) += w * s;								// Copy s and Sd		UD_scheme::s[o] = s;		UD_scheme::Sd[o] = S;	}	return rcondmin;}Bayes_base::Float UD_scheme::observe (Linrz_correlated_observe_model& /*h*/, const Vec& /*z*/)/* No solution for Correlated noise and Linearised model */{	error (Logic_exception("observe no Linrz_correlated_observe_model solution"));	return 0;	// never reached}Bayes_base::Float UD_scheme::observe (Linear_correlated_observe_model& h, const Vec& z)/* * Special Linear Hx observe for correlated Z *  Z must be PD and will be decorrelated * Applies observations sequentialy in the order they appear in z * Creates temporary Vec and Matrix to decorelate z,Z * Predcondition: *  UD *  Z is PSD * Postcondition: *  UD is PSD * Return: Minimum rcond of all squential observe */{	std::size_t i, j, k;	const std::size_t x_size = x.size();	const std::size_t z_size = z.size();	Float s, S;			// Innovation and covariance					// Dynamic sizing	observe_size (z_size);	if (z_size != zpdecol.size()) {		zpdecol.resize(z_size, false);		Gz.resize(z_size,z_size, false);		GIHx.resize(z_size, x_size, false);	}					// Factorise process noise as GzG'	{	Float rcond = FM::UdUfactor (Gz, h.Z);		rclimit.check_PSD(rcond, "Z not PSD in observe");	}								// Observation prediction and normalised observation	const Vec& zp = h.h(x);	h.normalise(znorm = z, zp);		if (z_size > 0)	{							// Solve G* GIHx = Hx for GIHx in-place		GIHx = h.Hx;		for (j = 0; j < x_size; ++j)		{			i = z_size-1;			do {				for (k = i+1; k < z_size; ++k)				{					GIHx(i,j) -= Gz(i,k) * GIHx(k,j);				}			} while (i-- > 0);		}							zpdecol = zp;			// Solve G zp~ = z, G z~ = z  for zp~,z~ in-place		i = z_size-1;		do {			for (k = i+1; k < z_size; ++k)			{				znorm[i] -= Gz(i,k) * znorm[k];				zpdecol[i] -= Gz(i,k) * zpdecol[k];			}		} while (i-- > 0);	}//if (z_size>0)								// Apply observations sequentialy as they are decorrelated	Float rcondmin = std::numeric_limits<Float>::max();	for (std::size_t o = 0; o < z_size; ++o)	{		h1 = row(GIHx,o);								// Update UD and extract gain		Float rcond = observeUD (w, S, h1, Gz(o,o));		rclimit.check_PSD(rcond, "S not PD in observe");	// -1 implies S singular		if (rcond < rcondmin) rcondmin = rcond;								// State update using linear innovation		s = znorm[o]-zpdecol[o];		noalias(x) += w * s;								// Copy s and Sd		UD_scheme::s[o] = s;		UD_scheme::Sd[o] = S;	}	return rcondmin;}Bayes_base::Float UD_scheme::observe (UD_sequential_observe_model& h, const Vec& z)/* * Special observe using observe_model_sequential for fast uncorrelated linrz operation * Uncorrelated observations are applied sequentialy in the order they appear in z * The sequential observation updates state x. Therefore the model of * each observation needs to be computed sequentially * Predcondition: *  UD *  Z is PSD * Postcondition: *  UD is PSD * Return: Minimum rcond of all squential observe */{	std::size_t o;	const std::size_t z_size = z.size();	Float s, S;			// Innovation and covariance								// Dynamic sizing	observe_size (z_size);								// Apply observations sequentialy as they are decorrelated	Float rcondmin = std::numeric_limits<Float>::max();	for (o = 0; o < z_size; ++o)	{								// Observation prediction and model		const Vec& zp = h.ho(x, o);		h.normalise(znorm = z, zp);								// Check Z precondition		if (h.Zv[o] < 0)			error (Numeric_exception("Zv not PSD in observe"));								// Update UD and extract gain		Float rcond = observeUD (w, S, h.Hx_o, h.Zv[o]);		rclimit.check_PSD(rcond, "S not PD in observe");	// -1 implies S singular		if (rcond < rcondmin) rcondmin = rcond;								// State update using non-linear innovation		s = znorm[o]-zp[o];		noalias(x) += w * s;								// Copy s and Sd		UD_scheme::s[o] = s;		UD_scheme::Sd[o] = S;	}	return rcondmin;}UD_scheme::Float UD_scheme::observeUD (FM::Vec& gain, Float & alpha, const Vec& h, const Float r)/* * Linear UD factorisation update *  Bierman UdU' factorisation update. Bierman p.100 * Input *  h observation coeficients *  r observation variance * Output *  gain  observation Kalman gain *  alpha observation innovation variance * Variables with physical significance *  gamma becomes covariance of innovation * Predcondition: *  UD *  r is PSD (not checked) * Postcondition: *  UD (see return value) * Return: *  reciprocal condition number of UD, -1 if alpha singular (negative or zero) */{	std::size_t i,j,k;	const std::size_t n = UD.size1();	Float gamma, alpha_jm1, lamda;	// a(n) is U'a	// b(n) is Unweighted Kalman gain					// Compute b = DU'h, a = U'h	a = h;	for (j = n-1; j >= 1; --j)	// n-1..1	{		for (k = 0; k < j; ++k)	// 0..j-1		{			a[j] += UD(k,j) * a[k];		}		b[j] = UD(j,j) * a[j];	}	b[0] = UD(0,0) * a[0];					// Update UD(0,0), d(0) modification	alpha = r + b[0] * a[0];	if (alpha <= 0) goto alphaNotPD;	gamma = 1 / alpha;	UD(0,0) *= r * gamma;					// Update rest of UD and gain b	for (j = 1; j < n; ++j)		// 1..n-1	{					// d modification		alpha_jm1 = alpha;	// alpha at j-1		alpha += b[j] * a[j];		lamda = -a[j] * gamma;		if (alpha <= 0) goto alphaNotPD;		gamma = 1 / alpha;		UD(j,j) *= alpha_jm1 * gamma;					// U modification		for (i = 0; i < j; ++i)		// 0..j-1		{			Float UD_jm1 = UD(i,j);			UD(i,j) = UD_jm1 + lamda * b[i];			b[i] += b[j] * UD_jm1;		}	}					// Update gain from b	noalias(gain) = b * gamma; 	// Estimate the reciprocal condition number from upper triangular part	return UdUrcond(UD,n);alphaNotPD:	return -1;}}//namespace

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品乱码久久久久久久久| 日本亚洲三级在线| 麻豆中文一区二区| 色综合久久久久网| 久久亚洲精品国产精品紫薇| 亚洲图片欧美视频| 99热这里都是精品| 久久日韩精品一区二区五区| 婷婷丁香激情综合| 欧美在线高清视频| 成人97人人超碰人人99| 欧美老年两性高潮| 91浏览器打开| 欧美激情一区二区三区不卡| 毛片av一区二区三区| 777xxx欧美| 亚洲国产日韩a在线播放| 97超碰欧美中文字幕| 26uuu另类欧美| 免费在线观看精品| 欧美精品在欧美一区二区少妇| 椎名由奈av一区二区三区| 从欧美一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 久久国产精品区| 日韩一区二区免费在线电影| 天天av天天翘天天综合网色鬼国产 | 色婷婷久久久亚洲一区二区三区| 国产无人区一区二区三区| 久久99国产精品久久99果冻传媒| 日韩欧美国产综合| 国内偷窥港台综合视频在线播放| 日韩欧美国产一区在线观看| 久久精品av麻豆的观看方式| 精品卡一卡二卡三卡四在线| 美女精品自拍一二三四| 精品国产百合女同互慰| 久久精品免费观看| 久久综合九色综合97婷婷女人| 国内精品久久久久影院色| xnxx国产精品| 福利一区在线观看| 中文字幕制服丝袜一区二区三区 | 麻豆高清免费国产一区| 日韩三级视频中文字幕| 免费欧美在线视频| 国产亚洲午夜高清国产拍精品| 国产露脸91国语对白| 18成人在线观看| 色欧美片视频在线观看| 日韩av电影免费观看高清完整版 | 亚洲1区2区3区4区| 精品视频1区2区| 免费成人在线影院| 久久久久久久久久久99999| 不卡一二三区首页| 亚洲一区在线观看视频| 精品久久久三级丝袜| 国产99精品国产| 一区二区三区免费在线观看| 欧美一级午夜免费电影| 国产成都精品91一区二区三| 亚洲国产精品综合小说图片区| 91精品免费在线| 粉嫩久久99精品久久久久久夜 | 欧美久久久影院| 激情小说欧美图片| 亚洲一区二区高清| 精品久久久久99| 毛片基地黄久久久久久天堂| 成人一区二区在线观看| 成人欧美一区二区三区| 欧美性色黄大片| 国产一二精品视频| 亚洲一区av在线| 久久蜜桃av一区二区天堂| 日本韩国欧美在线| 精品一区中文字幕| 亚洲女人小视频在线观看| 日韩午夜激情av| 色呦呦网站一区| 亚洲第一二三四区| 精品动漫一区二区三区在线观看| 91女神在线视频| 国产精品一卡二卡在线观看| 亚洲地区一二三色| 欧美激情一区在线| 精品999久久久| 欧美精品久久99久久在免费线| 不卡av在线网| 韩国一区二区视频| 蜜臀国产一区二区三区在线播放| 亚洲乱码国产乱码精品精小说| 久久精品一区二区| 欧美一级理论性理论a| 在线视频中文字幕一区二区| 99精品国产99久久久久久白柏| 极品少妇一区二区三区精品视频| 婷婷六月综合亚洲| 亚洲五月六月丁香激情| 亚洲精品成人a在线观看| 亚洲国产精品二十页| 久久欧美一区二区| 精品裸体舞一区二区三区| 日韩欧美一二三| 欧美一级精品在线| 日韩一级二级三级| 777亚洲妇女| 色女孩综合影院| 在线观看亚洲精品视频| 色一情一乱一乱一91av| 在线看一区二区| 日本高清视频一区二区| 色噜噜夜夜夜综合网| 99热精品一区二区| 91在线精品一区二区| 91老师国产黑色丝袜在线| 色偷偷成人一区二区三区91| 色欧美乱欧美15图片| 欧美午夜电影在线播放| 欧美日韩国产精选| 欧美一区二区三区四区在线观看| 91精品视频网| 久久亚洲一区二区三区明星换脸| 精品国产91洋老外米糕| 欧美无乱码久久久免费午夜一区| 最好看的中文字幕久久| 中文字幕在线不卡国产视频| 成人欧美一区二区三区小说| 国产精品久久久久久久久久免费看 | 精品久久久久久久人人人人传媒| 制服丝袜日韩国产| 久久人人97超碰com| 中文字幕在线一区免费| 亚洲精品免费播放| 天天av天天翘天天综合网色鬼国产| 久久精品噜噜噜成人88aⅴ| 国产一区二区三区四区五区入口 | 欧美精品一区二区高清在线观看| 久久伊99综合婷婷久久伊| 国产精品天干天干在观线| 一区二区高清视频在线观看| 日本美女视频一区二区| 国产成人精品影院| 欧美艳星brazzers| 久久日韩粉嫩一区二区三区| 亚洲激情成人在线| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产在线看一区| 日本精品一级二级| 精品国产乱码久久久久久久久| 中文字幕一区二区三区在线不卡 | 国产精品国模大尺度视频| 亚洲一区二区在线视频| 激情综合一区二区三区| 色视频成人在线观看免| 久久久久久电影| 亚洲第一福利视频在线| 国v精品久久久网| 91精品黄色片免费大全| 中文字幕一区二区日韩精品绯色| 首页欧美精品中文字幕| 99久久婷婷国产| 欧美不卡一区二区| 亚洲成人精品一区| 福利视频网站一区二区三区| 911精品国产一区二区在线| 国产精品久久久久婷婷| 国产一区二区三区| 欧美男男青年gay1069videost| 久久精子c满五个校花| 午夜成人在线视频| 91丨九色丨黑人外教| 久久毛片高清国产| 麻豆一区二区三| 欧美久久一区二区| 亚洲国产中文字幕在线视频综合| 成人夜色视频网站在线观看| 精品sm在线观看| 蜜桃视频免费观看一区| 欧美精品粉嫩高潮一区二区| 一区二区三区免费| av中文字幕不卡| 国产农村妇女精品| 国模冰冰炮一区二区| 欧美一区二区三区在线| 午夜久久久久久久久 | 成人精品小蝌蚪| 国产欧美一区二区精品性| 激情亚洲综合在线| 日韩欧美成人激情| 麻豆精品蜜桃视频网站| 制服丝袜激情欧洲亚洲| 水蜜桃久久夜色精品一区的特点| 欧美日韩一级黄| 午夜电影一区二区三区| 3d成人h动漫网站入口| 亚洲第一激情av| 制服丝袜在线91| 看电影不卡的网站|