On Wed, 4 Feb 2004, Peter Vanroose wrote:
> > The vnl_rnpoly_solve::compute method has these local variables:
> > int ideg[M_], terms[M_], polyn[M_][T_][M_];
> > double coeff[M_][T_];
> > vnl_rnpoly_solve_cmplx ans[LEN_][M_];
> > where
> > LEN_= 3080
> > M_ = 11
> > T_ = 250
> > The large arrays should probably be allocated dynamically. Does anyone
> > know of a problem with making this change?
>
> Should be no problem. These are remainders from a C implementation, and
> are intrinsically unsafe. This would also be the right moment to replace
> these arrays by C++style dynamic storage so as to (1) remove the built
> in limit of e.g. 11 dimensions, and (2) don't pay for large storage when
> solving a smallsize set of equations.
>
> Brad, were you planning to make this change?
I've made a quickhack version of the change in the ITK version of vnl to
clean up the dashboard. It just moved all the variables into a struct
like this:
struct vnl_rnpoly_solve_compute_data
{
int ideg[M_], terms[M_], polyn[M_][T_][M_];
double coeff[M_][T_];
vnl_rnpoly_solve_cmplx ans[LEN_][M_];
};
and then dynamically allocated the structure at the beginning of the
function. If you would like to implement the changes to remove the
builtin limits then that would probably be a better approach.
Brad
