[Top][All Lists]

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

Re: Copying C array to a GSL vector

From: Patrick Alken
Subject: Re: Copying C array to a GSL vector
Date: Thu, 10 Jun 2021 23:50:55 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

First you need to make a "vector view" of your array, and then you can treat it as a vector. Example:

gsl_vector_view v = gsl_vector_view_array(my_array, n);

gsl_vector_memcpy(dest, &v.vector);

On 6/10/21 11:48 PM, Fritz Sonnichsen wrote:
I am about to use some filtering routines and I am new to GSL. My C routine
creates a vector (1x1024) and I want to convert this to a gsl_vector type.
(In particular I want to use the /int gsl_vector_memcpy(gsl_vector *dest,
constgsl_vector *src) function.

I see copying routines in your document for copying gsl_vector types
     (for example int gsl_vector_memcpy(gsl_vector *dest, constgsl_vector
*src) )
  but I do not see one to copy my C vector to the gsl type for further
processing. Is there such a routine?


reply via email to

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