This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gsl Development Query


Brian Gough wrote:

> Randall Judd writes:
> 
> > In VSIPL every view contains a pointer to the block. 
> 
> I think we can accomodate this in GSL
> by not setting the block field to NULL for views
> and having a separate field in the struct to indicate ownership
> of the memory instead.  Then one would always be able
> to determine the underlying block for any view.
> 
> This seems straightforward to support, so I will do that --
> it only needs a change in the struct definition
> and a few associated routines.

Do you really need to tell us these details?
It's your implementation.  Do what you want.
But give us library functions that return

  1.) a pointer to the block,
  2.) the offset from the beginning of the block
      to the first element of the vector,
  3.) the length (extent) of the vector and
  4.) the stride between elements of the vector.

You can implement them as inline functions
or even C preprocessor macros if you like.
Take a look at
The ANSI C Numerical Class Library

	http://www.netwood.net/~edwin/svmt/

and read cncl/src/vector/vector.hP for an example
of how you might implement them.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]