Hi Kevin,
Thanks for you reply! That was pretty much what I was
looking for :-)
But it seems it doesn't work well. The conversion from
gsl_vector_complex * to gsl_vector * is done fine. But the
error handler of GSL just complains about accessing an out-
of-range index. Even if I deactivate it with a
gsl_set_error_handler_off(), the vector only has half the
values added.
for( i=0; i<N; i++ )
{
gsl_vector_set( (gsl_vector *)x, 2*i, -L/2 +
i*(L/(N-1)) );
}
Just in case you wonder if I'm doing something weird with
the loop. Is there something I'm missing?
Thanks again.
- Alejandro Cámara
Kevin Channon escribió:
> Hi Alejandro,
>
> > gsl_vector_complex *F = gsl_vector_complex_alloc( 5 );
> > gsl_vector_complex_set_zero( F );
> > gsl_vector_complex_set( F, 0, 2.0 );
>
> you can set the real part of element i of a complex
> vector to "value" using something like
>
> gsl_vector_set( (gsl_vector *)F, 2*i, value);
>
> and the imaginary part in a similar way
>
> gsl_vector_set( (gsl_vector *)F, 2*i + 1, value);
>
> Hope that helps!
--
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl