[ADMB Users] problem with 2 selection periods in calculating F

Steve Martell s.martell at fisheries.ubc.ca
Tue Jan 4 05:37:09 PST 2011


Based on the error message, it looks like your are trying to use the .sub command on a vector.  Is log_fy a vector?  Also, it looks like F is a matrix based on the error message, so F(1,44) is pointing to row 1 column 44.

S.
On 2011-01-04, at 4:09 AM, Luis Ridao wrote:

> ADMB-users,
> 
> I get an error when calculating F for two different selection periods:
> The selection periods are from 1961 to 2004 (1:44) and from 2005 to 2009 (45:49)
> ........
>   F(1,44)=outer_prod(mfexp(log_fy.sub(1,44)),mfexp(log_sel1));      // LINE 156
>   F(45,49)=outer_prod(mfexp(log_fy.sub(45,49)),mfexp(log_sel2));  // LINE 157
> ........
> 
> The compiling fails:
> 
> sai6109_rm_pt_sr_2sel.cpp: In member function ‘void model_parameters::get_mortality_and_survivial_rates()’:
> sai6109_rm_pt_sr_2sel.cpp:156: error: no match for ‘operator=’ in ‘((model_parameters*)this)->model_parameters::F.named_dvar_matrix::<anonymous>.dvar_matrix::operator()(1, 44) = outer_prod(const dvar_vector&, const dvar_vector&)(((const dvar_vector&)((const dvar_vector*)(& mfexp(const dvar_vector&)()))))’
> /media/Data/ADMB/include/fvar.hpp:1695: note: candidates are: prevariable& prevariable::operator=(const prevariable&)
> /media/Data/ADMB/include/fvar.hpp:1696: note:                 prevariable& prevariable::operator=(double)
> sai6109_rm_pt_sr_2sel.cpp:157: error: no match for ‘operator=’ in ‘((model_parameters*)this)->model_parameters::F.named_dvar_matrix::<anonymous>.dvar_matrix::operator()(45, 49) = outer_prod(const dvar_vector&, const dvar_vector&)(((const dvar_vector&)((const dvar_vector*)(& mfexp(const dvar_vector&)()))))’
> /media/Data/ADMB/include/fvar.hpp:1695: note: candidates are: prevariable& prevariable::operator=(const prevariable&)
> /media/Data/ADMB/include/fvar.hpp:1696: note:                 prevariable& prevariable::operator=(double)
> 
> Thanks in advance
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users




More information about the Users mailing list