Skip to content

Commit

Permalink
Update linalg.md and example_blas_gemv.f90 (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
perazz authored Apr 13, 2024
2 parents c26253a + 54eaecf commit 19f84ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/specs/stdlib_linalg.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ These can be enabled during the build process. For example, with CMake, one can
The same is possible from the `fpm` branch, where the `cpp` preprocessor is enabled by default. For example, the macros can be added to the project's manifest:

```toml
# Link against appropriate external BLAS and LAPACK libraries, if necessary
[build]
link = ["blas", "lapack"]

[dependencies]
stdlib="*"

Expand Down
6 changes: 3 additions & 3 deletions example/linalg/example_blas_gemv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ program example_gemv
use stdlib_linalg, only: eye
use stdlib_linalg_blas, only: sp,gemv
implicit none(type,external)
real(sp) :: A(2, 2), B(2)
real(sp) :: A(2, 2), B(2), C(2)
B = [1.0,2.0]
A = eye(2)

! Use legacy BLAS interface
call gemv('No transpose',m=size(A,1),n=size(A,2),alpha=1.0,a=A,lda=size(A,1),x=B,incx=1,beta=0.0,y=B,incy=1)
call gemv('No transpose',m=size(A,1),n=size(A,2),alpha=1.0,a=A,lda=size(A,1),x=B,incx=1,beta=0.0,y=C,incy=1)

print *, B ! returns 1.0 2.0
print *, C ! returns 1.0 2.0

end program example_gemv

0 comments on commit 19f84ce

Please sign in to comment.