help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] gsl_matrix *p Pointer in Object


From: Frank Reininghaus
Subject: Re: [Help-gsl] gsl_matrix *p Pointer in Object
Date: Tue, 21 Jul 2009 22:40:10 +0200
User-agent: KMail/1.11.4 (Linux/2.6.28-11-generic; KDE/4.2.4; i686; ; )

Hi,

On Tuesday 21 July 2009 22:00:24 Thomas Schmitt wrote:
> Hi,
> the gsl_matrix_view makes sense because i want to parse from a vector
> that i read from a csv-file. Every instance of the class gets an
> different vector. I attach the complete code.....

it can't be built though...

>       _array = &init_vector[0];
>       gsl_matrix_view a = gsl_matrix_view_array( _array, _rows, _columns );

This is only one of the things I find strange - I don't know if it's actually 
guaranteed that this will give you a valid double* _array which can then be 
used by gsl_matrix_view_array.

And I would actually store the data in memory which is owned by the class 
instance itself - you seem to reuse the vector<double> which comes from 
main().

And I don't understand why your class GaussMatrix inherits gsl_matrix - it 
seems it's not using the gsl_matrix inside it in any way.

Unless anyone else has an idea, I'd suggest to look at some example code in 
the manual to see how to work with matrices.

Good luck,
Frank





reply via email to

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