[Top][All Lists]

[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: Jordi Gutiérrez Hermoso
Subject: Re: [Help-gsl] segmentation fault while using gsl_linalg_complex_LU_decomposition
Date: Mon, 8 Aug 2011 21:21:02 -0500

On 8 August 2011 17:04, Владимир Дрынкин <address@hidden> wrote:

> Can you help me, what's wrong with my code?
> 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.

- Jordi G. H.

reply via email to

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