Routine: DPOSV -> matrix format?

Post here if you have a question about LAPACK or ScaLAPACK algorithm or data format

Routine: DPOSV -> matrix format?

Postby MatGentoo » Tue May 10, 2011 3:30 am


i have a linear system which i want to solve via dposv_(). But i have problem to understand how to give the matrix.
Until now i linearized all matrices in a simple array and put it as an argument. For example:

A = [1,2;3,4] -> A[1,2,3,4].

So for general formats i linearized row-wise. The routine dposv needs only:
On entry, the symmetric matrix A. If UPLO = 'U', the leading
* N-by-N upper triangular part of A contains the upper
* triangular part of the matrix A, and the strictly lower
* triangular part of A is not referenced.

How should i put the matrix in the array? Is lapack that intelligent that it internally extract the correct column values?
So for example if i have the matrix:
A= [1,0,0;

would that be:

A[1,2,3,-1,-2,-3] with the character UPLO="L"

a correct input for dposv? How should i linearize a triangular matrix?

Thanks for any advice.
Greetings Mat
Posts: 1
Joined: Tue May 10, 2011 3:25 am

Re: Routine: DPOSV -> matrix format?

Postby admin » Tue May 10, 2011 3:42 am

I do not believe you could linearized and remove elements at the same time
A= [1,0,0;

would be:

A[1,0,0,2,3,0,-1,-2,-3] with the character UPLO="L"
The 0 could actually be anything, LAPACK won't use/change them.

1D or 2D array are fine for LAPACK. So even you can just give the matrix A in 2D
A= [1,0,0;
Site Admin
Posts: 612
Joined: Wed Dec 08, 2004 7:07 pm

Return to Algorithm / Data

Who is online

Users browsing this forum: No registered users and 3 guests