Re: [Bayes++] Deriving observe likelihood model from Likelihood_observe_model for SIR_scheme
Brought to you by:
mistevens
|
From: Michael S. <ma...@mi...> - 2007-05-10 15:19:18
|
On Wednesday 09 May 2007 17:54, yon wrote:
> Dear List,
>
> Apologies for the email I'm replying to.. this was the error I'd
> meant to send:
>
> /Developer/YV-dev/DcpTest/vecDcp.cpp: In constructor
> 'CDcp_observe_likelihood::CDcp_observe_likelihood(int, int, int, int,
> float, float)':
> /Developer/YV-dev/DcpTest/vecDcp.cpp:490: error: no matching function
> for call to
> 'Bayesian_filter_matrix::detail::FMVec<Bayesian_filter_matrix::detail::B
> aseVector>::FMVec()'
>
> The constructor for FMVec() appears not to be found, so I would guess
> I have an includes problem.
>
> The code is below, followed by the includes. The class has a member
>
> bf::FM::Vec mvecRawWeights; // Non-normalized weights
OK easy fix. FM::Vec does not have a default constructor. Which is what the
compiler is complaining about.
In your CDcp_observe_likelihood construct you need to explictly construct
mvecRawWeights with a specific size. If you want it to be empty use
mvecRawWeights( Bayesian_filter_matrix::Empty )
Personally I find default constructing vectors or matrix to 0 size is rarely
what you want and therefore rather error prone. When you come to use these
variables you get a runtime error. Therefore in the derived classes I use I
don't provide a default construtor.
All the best,
Michael
--
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation and
Bayesian Filtering
http://bayesclasses.sf.net
___________________________________
|