- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Can anyone see why I am getting all zeroes back in when calling the MKL dpotrf function below? Info comes back as 0 which indicates success, but A is ...

SUBROUTINE MatrixTest

IMPLICIT NONE

INCLUDE 'mkl.fi'

INTEGER n

PARAMETER (n=4)

REAL*8 A(n,n)

INTEGER info,i,j

c Fill the upper triangle

A(1,1)=11.0d0

A(1,2)=-5.0d0

A(1,3)=3.0d0

A(1,4)=2.0d0

A(2,2)=13.0d0

A(2,3)=4.0d0

A(2,4)=-6.0d0

A(3,3)=16.0d0

A(3,4)=7.0d0

A(4,4)=19.0d0

c Make it symmetrical

do i=2,n

do j=1,i-1

A(i,j)=A(j,i)

enddo

enddo

call dpotrf ('L',n,A,n,info)

end

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

The code posted by Schulzey merits a couple of comments.

First of all, the dpotrf routine is appropriate to use only if the matrix A is positive-definite -- it is necessary but not sufficient that A be symmetric. The particular matrix values do satisfy this requirement.

Secondly, only the lower triangle of A is used if the first argument passed to the routine dpotrf is 'L'. What is contained in the upper triangular part, not including the main diagonal, is immaterial. Therefore, there is no need for the "make it symmetrical" part of the posted code. It would be more efficient to fill in only the lower triangle of A if the intent is to call dpotrf with 'L' as the first argument.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thanks guys, I started a new project and now it's working properly. I must have had a setting in Visual Studio that was stopping it.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page