Skip to content

Commit c9d2531

Browse files
committed
Fix errors in examples.
1 parent 4698662 commit c9d2531

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

example/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ add_subdirectory(random)
2424
add_subdirectory(selection)
2525
add_subdirectory(sorting)
2626
add_subdirectory(specialfunctions_gamma)
27+
add_subdirectory(specialmatrices)
2728
add_subdirectory(stats)
2829
add_subdirectory(stats_distribution_exponential)
2930
add_subdirectory(stats_distribution_normal)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ADD_EXAMPLE(specialmatrices_dp_spmv)
2+
ADD_EXAMPLE(tridiagonal_dp_type)

example/specialmatrices/example_specialmatrices_dp_spmv.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
program example_tridiagonal_matrix
2-
use stdlib_constants, only: dp
2+
use stdlib_linalg_constants, only: dp
33
use stdlib_specialmatrices
44
implicit none
55

66
integer, parameter :: n = 5
77
type(Tridiagonal_dp_type) :: A
8-
real(dp) :: dl(n), dv(n), du(n)
8+
real(dp) :: dl(n - 1), dv(n), du(n - 1)
99
real(dp) :: x(n), y(n), y_dense(n)
10+
integer :: i
1011

1112
! Create an arbitrary tridiagonal matrix.
12-
dl = [(i, i=1, n - 1)]; dv = [(2*i, i=1, n)]; du = [(3*i, i=1, n)]
13+
dl = [(i, i=1, n - 1)]; dv = [(2*i, i=1, n)]; du = [(3*i, i=1, n - 1)]
1314
A = Tridiagonal(dl, dv, du)
1415

1516
! Initialize vectors.

example/specialmatrices/example_tridiagonal_dp_type.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
program example_tridiagonal_matrix
2-
use stdlib_constants, only: dp
2+
use stdlib_linalg_constants, only: dp
33
use stdlib_specialmatrices
44
implicit none
55

66
integer, parameter :: n = 5
77
type(Tridiagonal_dp_type) :: A
8-
real(dp) :: dl(n), dv(n), du(n)
8+
real(dp) :: dl(n - 1), dv(n), du(n - 1)
99

1010
! Generate random tridiagonal elements.
1111
call random_number(dl)

0 commit comments

Comments
 (0)