[Top][All Lists]

[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 21:43:49 +0200
User-agent: KMail/1.11.4 (Linux/2.6.28-11-generic; KDE/4.2.4; i686; ; )


On Tuesday 21 July 2009 21:12:25 Thomas Schmitt wrote:
> you're right, the calloc doesn't make sense!! But the line
> GaussMatrix::p_matrix = &a.matrix;
> should give me a pointer to the view i create.....but if i try to call
> the pointer later in a function of the class(it just prints out the
> matrix) 
> i get different values than the ones i initialized.

the calloc made more sense to me than this very strange thing you're doing 
with the gsl_matrix_view and the vector<double> in the class constructor. If 
you pass the same "init_vector" to the constructor of each class instance, all 
instances will share the same matrix data, so manipulations of one instance 
will also affect the others.

But again, it's impossible to fully analyse your problem without the code.


reply via email to

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