help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Resizing vectors and matrices


From: Brian Gough
Subject: Re: [Help-gsl] Resizing vectors and matrices
Date: Fri, 17 Sep 2004 16:52:08 +0100

address@hidden writes:
 > I have looked briefly at init_source.c in the block and vector directory of 
 > gsl-1.5, and it seems to me that all one needs to do is to add functions 
 > gsl_vector_realloc and gsl_block_realloc. The latter function should 
 > reallocate space for block->data and update block->size. Then 
 > gsl_vector_realloc calls gsl_block_realloc and makes appropriate changes if 
 > need to vector->data, vector->size and vector->block. That should be all, 
 > or have I missed something of importance?

Hello,

I have hesitated to include realloc functions because of the problem
that the user might have pointers to rows or columns which would
become "dangling references" if realloc moves the block.

Note that you can allocate any arrays in your program as normal and
create the appropriate gsl_vector/gsl_matrix views on the fly when
calling gsl functions.  It is not essential to the use gsl alloc
functions.

-- 
Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]