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

undefined reference to CLAPACK functions

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

Postby Julien Langou » Mon Apr 21, 2008 12:29 pm

Here is the receipt to generate a "somewhat random" symmetric positive
definite matrix:

0- fix your n
1- allocate an n-by-n array
2- set the upper part of A to random values (negative or positive)
arrange such that the elements have magnitude of 1 about
3- set the lower part of A such that A is symmetric
(Note this step is not necessary with LAPACK since LAPACK accesses
one half of the matrix and assumes symmetry.)
4- set the diagonal to positive (>0) value,
arrange such that the diagonal elements are bigger than the off-
diagonal ones. For example sqrt(n) times bigger

Julie's code will run fine with these modifications incorporated.

julien.
Julien Langou
 
Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Postby the-shifter » Tue Apr 22, 2008 3:49 am

Thanks Julien for the explanation.

Can you just please clarify these 2 steps as I couldn't understand properly:

- arrange such that the elements have magnitude of 1 about

- arrange such that the diagonal elements are bigger than the off-
diagonal ones. For example sqrt(n) times bigger


Maho
the-shifter
 
Posts: 7
Joined: Mon Apr 14, 2008 2:25 am

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

the-shifter wrote:Thanks Julie...I passed my linking too.
One more question though...in your code you suggested an order 2 matrix, I would like to go bigger and work on variable matrices lengths.
So do you happen to have a sample algorithm that generates real symmetric positive definite matrices? or if not, can you point out from the test files source code the part which generates this matrix?

Thank you
Maho




could someone please post some help.thanks






Monitoare LCD
AlexanderEnaceanu
 
Posts: 2
Joined: Tue May 27, 2008 5:06 pm

Re: undefined reference to CLAPACK functions

Postby nl2219 » Fri Aug 01, 2008 12:48 am

Thanks to Ankur. I also compiled successfully for the little code given by Julie.

If using C++ rather that C, then we should not include "CLAPACK.h" in the main program, or else it will cause some error like

"previous declaration of ‘int spotrf_(char*, integer*, real*, integer*, integer*)’ with ‘C++’ linkage
test.cpp:5: error: conflicts with new declaration with ‘C’ linkage"
nl2219
 
Posts: 5
Joined: Tue Jul 29, 2008 12:43 pm

Re: undefined reference to CLAPACK functions

Postby unadulterated » Tue Aug 03, 2010 3:42 pm

thanks a lot Julie.. that code for able to compile the clapack basic program helped.
unadulterated
 
Posts: 8
Joined: Tue Aug 03, 2010 3:36 pm

Previous

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests