help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] segmentation fault while using gsl_linalg_complex_LU_deco


From: Владимир Дрынкин
Subject: Re: [Help-gsl] segmentation fault while using gsl_linalg_complex_LU_decomposition
Date: Tue, 9 Aug 2011 16:42:44 +0400

Yeah, really, it works!! I forgot to initialise signum pointer :(
That's why there was segmentation fault error, as Greg Lyukshin
posted.

Thank you and thanks to all gsl community!
Best regards, Vladimir.

2011/8/9 Jordi Gutiérrez Hermoso <address@hidden>:
> On 8 August 2011 17:04, Владимир Дрынкин <address@hidden> wrote:
>
>> Can you help me, what's wrong with my code?
> [snip]
>> matrix matrix::inverse()
>> {
>>    int *signum;
>>    gsl_permutation *p;
>>    p = gsl_permutation_alloc(rows);
>>    matrix temp = *this;
>>    matrix temp_inv(rows, cols);
>>    gsl_linalg_complex_LU_decomp(temp.mtrx, p, signum);
>>    temp.print();
>>    gsl_linalg_complex_LU_invert(temp.mtrx, p, temp_inv.mtrx);
>>    return temp_inv;
>> }
>
> You need to allocate signum here. Change the first line to
>
>     int *signum = new int;
>
> and at the end of this function put
>
>     delete signum
>
> There may be other errors, but I didn't try to find more.
>
> HTH,
> - Jordi G. H.
>



reply via email to

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