|
From: | Eduardo Zacarías B. |
Subject: | Re: [Help-gsl] more than one submatrix of the same matrix? |
Date: | Mon, 02 Feb 2004 16:17:10 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 |
Hi!Yep, luckily I had come to the same conclusion, about the view in the satck being overwritten. However, the code compiles and runs. I hope that the compiler would have stopped me!
Anyway, making separate view objects and taking the pointer from them solves the problem.
Thank you very much! Best regards Eduardo Brian Gough wrote:
"Eduardo Zacarías B." writes: > gsl_matrix *secondRow = &gsl_matrix_submatrix(mat,1,0,1,mat->size2).matrix; Hello, Making a pointer to the return value of a function is not allowed in C. The return value is on the stack and will be overwritten. You need to copy the return value (see the LU example in the Linear Algebra chapter of the manual (2nd ed, p187)). regards
[Prev in Thread] | Current Thread | [Next in Thread] |