issues
search
scivision
/
fortran2018-examples
Fortran 2018 standard examples with broad applications
MIT License
395
stars
68
forks
source link
issues
Newest
Newest
Most commented
Recently updated
Oldest
Least commented
Least recently updated
fortran program svd_example ! Declare variables integer, parameter :: m = 4, n = 3, lda = 4, ldu = 4, ldvt = 3 integer :: i, j, info real(kind=8) :: a(lda,n), s(n), u(ldu,m), vt(ldvt,n), superb(min(m,n)-1) ! Initialize matrix A with some random values do j=1,n do i=1,m a(i,j) = dble((i-1) + (j-1)*m) end do end do ! Compute the SVD of matrix A using LAPACK routine DGESVD call dgesvd('A', 'A', m, n, a, lda, s, u, ldu, vt, ldvt, superb, info) ! Print the results: matrices U and Vt and vector S. write(*,'(a)') 'Matrix U:' do i=1,m write(*,'(4f8.2)') (u(i,j),j=1,min(m,n)) end do write(*,*) write(*,'(a)') 'Vector S:' write(*,'(3f8.2)') (s(j),j=1,min(m,n)) write(*,*) write(*,'(a)') 'Matrix Vt:' do i=1,min(m,n) write(*,'(3f8.2,a,f8.2)') (vt(i,j),' ',char(10),superb(i)) end do end program svd_example
#9
aarav7834
closed
10 months ago
0
add fortran-tutorial tag
#6
Beliavsky
closed
2 years ago
1
cmake errors
#5
iajzenszmi
closed
2 years ago
0
use mpi_f08 module, etc
#4
jeffhammond
closed
2 years ago
2
MAINT: keeping test counts same cmake/meson/ compilers / os
#3
scivision
closed
2 years ago
0
Fix wrong path for the CMake folder
#2
Alexsaphir
closed
4 years ago
1
libISO
#1
bsbhro
closed
5 years ago
21