The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

dgels for c

Open discussion regarding features, bugs, issues, vendors, etc.

dgels for c

Postby smazuelas » Thu May 15, 2008 12:45 pm

I have some problems with the memory using dgels in a c program.

I am very happy if someone could show me some examples of the use of dgels in c

Thanks
smazuelas
 
Posts: 4
Joined: Thu May 15, 2008 12:40 pm

Postby Julie » Thu May 15, 2008 12:56 pm

The best is to post the piece of code that causes you problem, along with the memory allocation.
We will try to solve your problem.
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Postby smazuelas » Fri May 16, 2008 5:42 am

Ok. We use dgels (transa,m, n, nrhs, a, lda, b ,ldb, work, lwork, info);

in this way:

char arg1='N';

int arg2 = cont_rest+2, arg3 = numeroAPs, arg4 = 1, arg6 = cont_rest+2, arg8 = cont_rest+2, arg10, arg11=0;

double arg9=0., *parg9;



arg10=-1;
dgels_(&arg1, &arg2, &arg3, &arg4, matrizfila, &arg6, exponentes, &arg8, &arg9, &arg10, &arg11 );

arg10=rint(arg9);
parg9=(double*)malloc(arg10*sizeof(double));


dgels_(&arg1, &arg2, &arg3, &arg4, matrizfila, &arg6, exponentes, &arg8, parg9, &arg10, &arg11 );
//free(parg9);
parg9=NULL;

where matrizfila and exponentes are (contrest+2)x2 and (contrest+2)x1 matrixes


Thank you very much
smazuelas
 
Posts: 4
Joined: Thu May 15, 2008 12:40 pm

Postby Julien Langou » Fri May 16, 2008 5:16 pm

I can not find any obvious mistake in the piece of code you sent.
What error message do you see?
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby smazuelas » Mon May 19, 2008 3:15 pm

This code works, but the problem is with the memory.

The memory used by this code increase, thus I think is a problem with the memory release
smazuelas
 
Posts: 4
Joined: Thu May 15, 2008 12:40 pm

Postby Julien Langou » Mon May 19, 2008 3:29 pm

Sure enough you will have problem with the code has written above,
since you are not 'freeing' parg9. You need to decomment the
free(parg9) statement.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby smazuelas » Mon May 19, 2008 4:35 pm

I try with and without the coment free and I always have a memory leak
smazuelas
 
Posts: 4
Joined: Thu May 15, 2008 12:40 pm

Postby Julien Langou » Mon May 19, 2008 5:13 pm

LAPACK does not perform any memory allocation, so the memory leak
comes from somewhere else in your code.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: dgels for c

Postby AlexanderEnaceanu » Wed May 28, 2008 9:32 am

smazuelas wrote:I have some problems with the memory using dgels in a c program.

I am very happy if someone could show me some examples of the use of dgels in c

Thanks



I was going to ask the same question until I found this thread.thanks for the clarification
AlexanderEnaceanu
 
Posts: 2
Joined: Tue May 27, 2008 5:06 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 6 guests