[Developers] init_bounded_number_matrix
John Sibert
sibert at hawaii.edu
Fri Jun 4 12:49:51 PDT 2010
Thanks for the hint. I have immediate application for such a class.
Johnoel and I will have a go at implementing.
John
On 06/02/2010 08:34 PM, dave fournier wrote:
> a sketch of what need to be done.
>
> Well you could start with the param_init_bunded_vector class
> and modify it like this.
> The main thing to notice is that the param_init_bunded_vector class
> never had reference counting implemented. (See say the dvector class and
> how ncopies is used. to be safe one should protect the copy constructor
> so that shallow copies are not made. Then onme needs to add the class
> to the tpl2cpp by modifying the lex input.
>
>
>
>
>
>> class param_init_bounded_number_matrix
>> {
>> param_init_bounded_number_vector * v;
>> int index_min;
>> int index_max;
>> double_index_type * it;
>>
>> public:
>>
>> void set_scalefactor(double s);
>> void set_scalefactor(const dvector& s);
>> dvector get_scalefactor(void);
>> param_init_bounded_number_matrix();
>>
>> #if defined(OPT_LIB)
>> param_init_bounded_number_vector& operator [] (int i) { return v[i];}
>> param_init_bounded_number_vector& operator () (int i) { return v[i];}
>> #else
>> param_init_bounded_number_vector& operator [] (int i);
>> param_init_bounded_number_vector& operator () (int i);
>> #endif
>> 1,1 Top
>>
>>
>> void allocate(int min1,int max1,const double_index_type& bmin,
>> const double_index_type& bmax,const index_type& phase_start,
>> const char * s);
>>
>> void allocate(int min1,int max1,const double_index_type& bmin,
>> const double_index_type& bmax,const char * s);
>>
>> int allocated(void) { return (v!=NULL); }
>> int indexmin(void) {return (index_min);}
>> int indexmax(void) {return (index_max);}
>> ~param_init_bounded_number_matrix();
>> void set_initial_value(const double_index_type& it);
>> void deallocate(void);
>> };
>>
>>
>>
>
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers
>
>
--
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Visit the ADMB project http://admb-project.org/
More information about the Developers
mailing list