Page 2 of 2

PostPosted: Mon Apr 21, 2008 12:29 pm
by Julien Langou
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.

PostPosted: Tue Apr 22, 2008 3:49 am
by the-shifter
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

PostPosted: Wed May 28, 2008 9:34 am
by AlexanderEnaceanu
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

Re: undefined reference to CLAPACK functions

PostPosted: Fri Aug 01, 2008 12:48 am
by nl2219
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"

Re: undefined reference to CLAPACK functions

PostPosted: Tue Aug 03, 2010 3:42 pm
by unadulterated
thanks a lot Julie.. that code for able to compile the clapack basic program helped.