![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 16, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef CONSTANZE_BAUMWELCH_HPP 00029 #define CONSTANZE_BAUMWELCH_HPP 00030 00031 #include <CONSTANZE/HMM.hpp> 00032 00033 namespace constanze 00034 { 00035 00040 // implementation with templete is possible 00041 //template baumWelchDataType 00042 //class BaumWelch<baumWelchDataType> 00043 class BaumWelch 00044 { 00045 public: 00046 BaumWelch(); 00047 00048 ~BaumWelch(); 00049 00056 HMM* baumWelch(HMM *initialHMM, std::vector<int> *observationVector,int iterations); 00057 00059 HMM* getHMM(); 00060 00061 private: 00062 00064 HMM *hmm; 00065 00071 std::vector<std::vector<baumWelchDataType>*>* 00072 forward(HMM *initialHMM, std::vector<int> *observationVector); 00073 00079 std::vector<std::vector<baumWelchDataType>*>* 00080 backward(HMM *initialHMM, std::vector<int> *observationVector); 00081 00090 baumWelchDataType 00091 calculateGamma(int i, int t, std::vector<std::vector<baumWelchDataType>*> *forwardMatrix, std::vector<std::vector<baumWelchDataType>*> *backwardMatrix, HMM *h); 00092 00102 baumWelchDataType 00103 calculateXi(int t,int i,int j,std::vector<int> *observationVector,std::vector<std::vector<baumWelchDataType>*> *forwardMatrix,std::vector<std::vector<baumWelchDataType>*> *backwardMatrix,HMM *h); 00104 00110 baumWelchDataType 00111 divide(baumWelchDataType num,baumWelchDataType denom); 00112 00113 }; 00114 } 00115 00116 #endif // NOT defined CONSTANZE_BAUMWELCH_HPP 00117 00118 /* 00119 Local Variables: 00120 mode: c++ 00121 fill-column: 80 00122 c-basic-offset: 8 00123 c-comment-only-line-offset: 0 00124 c-tab-always-indent: t 00125 indent-tabs-mode: t 00126 tab-width: 8 00127 End: 00128 */
1.5.5