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


On Tuesday 21 July 2009 19:58:22 Thomas Schmitt wrote:
> My problem is that the
> pointer changes..... attached ist the code.... Hope someone can help
> me!!!! Thanks in advance!!!!

I don't really get what the problem is, to be honest. It might help if you 

* provide code (as short as possible) that can be compiled and run
* say what you expect from the code
* say what actually happens.

I noticed something strange though, maybe it's related to your problem:

>         GaussMatrix::p_matrix = gsl_matrix_calloc(rows,columns);
>         GaussMatrix::p_matrix = &a.matrix;

You allocate memory and assign a pointer to it to p_matrix and overwrite that 
pointer in the next line. Does not make any sense to me.

Moreover, it looks like your p_matrix member of the class, which is apparently 
supposed to point to the matrix, is static, right? That does not make much 
sense either - it means that every instance of the class has the same matrix 
data, which is probably not what you want.


reply via email to

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