C++ implementation of particle-filter
修订版 | 1dd1843035478539108dfed17e318f6739aebb3f (tree) |
---|---|
时间 | 2013-09-09 13:38:06 |
作者 | Tetsu R. Satoh <tetsu.sato@nhn-...> |
Commiter | Tetsu R. Satoh |
Fix taking into account of results of CppChecker
@@ -162,9 +162,7 @@ bool Filter::resampling() | ||
162 | 162 | // for(int i=1;i<((int)m-2);++i) |
163 | 163 | for(int i=1;i<=x.size();++i) |
164 | 164 | { |
165 | - double a1=0.0, a2=0.0; | |
166 | - a1 = psuma[i-1]; | |
167 | - a2 = psuma[i]; | |
165 | + double a1 = psuma[i-1], a2 = psuma[i]; | |
168 | 166 | //cout<<a1<<"<"<<u*alphasum<<"<="<<a2<<"?"<<endl; |
169 | 167 | //cout<<a1/alphasum<<"<"<<u<<"<="<<a2/alphasum<<"?"<<endl; |
170 | 168 | //cout<<(u<=a2/alphasum)<<"?"<<endl; |
@@ -183,4 +181,4 @@ bool Filter::resampling() | ||
183 | 181 | } |
184 | 182 | x = f; |
185 | 183 | return(true); |
186 | -} | |
\ No newline at end of file | ||
184 | +} |