F90 - diagnolize square matrix subroutine

In summary, the conversation suggests checking the lapack library for fortran for inversion routines that can return the diagonalized matrix of a square, real array. The numerical recipes web page may also have examples for writing your own subroutine.
  • #1
natski
267
2
Hi all,

Does anyone have/know the location of a subroutine for returning the diagonalized matrix of square, real array? The array is a covariance matrix so should be diagonalizable in all cases.

Thanks,

Natski
 
Technology news on Phys.org
  • #2
This is a week old, so probably too late, but check out the lapack library for fortran. There should be several inversion routines. I don't do much/any fortran but here is a webpage that outlines some of the routines -- more than 1 should be able to do what you'd like.

http://physics.orst.edu/~rubin/nacphy/lapack/linear.html

Also if you want to write your own, you can check out examples from places like the numerical recipes web page. I think their book on fortran is open to all now.
 

What is F90?

F90 stands for Fortran 90, which is a programming language commonly used for scientific and engineering applications.

What does it mean to "diagonalize" a matrix?

Diagonalization refers to the process of finding a new matrix that is similar to the original matrix, but with all non-diagonal elements set to zero. This new matrix is called a diagonal matrix, and it has several useful properties for solving mathematical problems.

What is a square matrix?

A square matrix is a matrix with the same number of rows and columns. This means that it has an equal number of elements in each row and column, and can be represented as a square grid.

What is a subroutine?

A subroutine is a section of code that performs a specific task within a larger program. It can be called upon multiple times within the program to perform the same task without needing to rewrite the code each time.

How does the F90 diagonalize square matrix subroutine work?

The F90 diagonalize square matrix subroutine uses various mathematical algorithms to calculate the diagonal matrix of a given square matrix. These algorithms involve finding eigenvalues and eigenvectors of the matrix and using them to construct the diagonal matrix.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
2
Replies
59
Views
9K
  • Programming and Computer Science
Replies
18
Views
6K
  • Programming and Computer Science
Replies
14
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
12
Views
3K
  • Programming and Computer Science
Replies
15
Views
3K
Back
Top