|
28 | 28 | gemv,
|
29 | 29 | hemv!,
|
30 | 30 | hemv,
|
| 31 | + hpmv!, |
31 | 32 | sbmv!,
|
32 | 33 | sbmv,
|
33 | 34 | symv!,
|
@@ -823,6 +824,82 @@ Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used.
|
823 | 824 | """
|
824 | 825 | hemv(ul, A, x)
|
825 | 826 |
|
| 827 | +### hpmv!, (HP) Hermitian packed matrix-vector operation defined as y := alpha*A*x + beta*y. |
| 828 | +for (fname, elty) in ((:zhpmv_, :ComplexF64), |
| 829 | + (:chpmv_, :ComplexF32)) |
| 830 | + @eval begin |
| 831 | + # SUBROUTINE ZHPMV(UPLO,N,ALPHA,AP,X,INCX,BETA,Y,INCY) |
| 832 | + # Y <- ALPHA*AP*X + BETA*Y |
| 833 | + # * .. Scalar Arguments .. |
| 834 | + # DOUBLE PRECISION ALPHA,BETA |
| 835 | + # INTEGER INCX,INCY,N |
| 836 | + # CHARACTER UPLO |
| 837 | + # * .. Array Arguments .. |
| 838 | + # DOUBLE PRECISION A(N,N),X(N),Y(N) |
| 839 | + function hpmv!(uplo::AbstractChar, |
| 840 | + n::BlasInt, |
| 841 | + α::$elty, |
| 842 | + AP::Union{Ptr{$elty}, AbstractArray{$elty}}, |
| 843 | + x::Union{Ptr{$elty}, AbstractArray{$elty}}, |
| 844 | + incx::Integer, |
| 845 | + β::$elty, |
| 846 | + y::Union{Ptr{$elty}, AbstractArray{$elty}}, |
| 847 | + incy::Integer) |
| 848 | + |
| 849 | + ccall((@blasfunc($fname), libblas), Cvoid, |
| 850 | + (Ref{UInt8}, # uplo, |
| 851 | + Ref{BlasInt}, # n, |
| 852 | + Ref{$elty}, # α, |
| 853 | + Ptr{$elty}, # AP, |
| 854 | + Ptr{$elty}, # x, |
| 855 | + Ref{BlasInt}, # incx, |
| 856 | + Ref{$elty}, # β, |
| 857 | + Ptr{$elty}, # y, output |
| 858 | + Ref{BlasInt}), # incy |
| 859 | + uplo, |
| 860 | + n, |
| 861 | + α, |
| 862 | + AP, |
| 863 | + x, |
| 864 | + incx, |
| 865 | + β, |
| 866 | + y, |
| 867 | + incy) |
| 868 | + end |
| 869 | + end |
| 870 | +end |
| 871 | + |
| 872 | +function hpmv!(uplo::AbstractChar, |
| 873 | + α::Number, AP::Union{DenseArray{T}, AbstractVector{T}}, x::Union{DenseArray{T}, AbstractVector{T}}, |
| 874 | + β::Number, y::Union{DenseArray{T}, AbstractVector{T}}) where {T <: BlasComplex} |
| 875 | + require_one_based_indexing(AP, x, y) |
| 876 | + N = length(x) |
| 877 | + if N != length(y) |
| 878 | + throw(DimensionMismatch("x has length $(N), but y has length $(length(y))")) |
| 879 | + end |
| 880 | + if length(AP) < Int64(N*(N+1)/2) |
| 881 | + throw(DimensionMismatch("Packed Hermitian matrix A has size smaller than length(x) = $(N).")) |
| 882 | + end |
| 883 | + GC.@preserve x y AP hpmv!(uplo, N, convert(T, α), AP, pointer(x), BlasInt(stride(x, 1)), convert(T, β), pointer(y), BlasInt(stride(y, 1))) |
| 884 | + y |
| 885 | +end |
| 886 | + |
| 887 | +""" |
| 888 | + hpmv!(uplo, α, AP, x, β, y) |
| 889 | +
|
| 890 | +Update vector `y` as `α*AP*x + β*y` where `AP` is a packed Hermitian matrix. |
| 891 | +The storage layout for `AP` is described in the reference BLAS module, level-2 BLAS at |
| 892 | +<http://www.netlib.org/lapack/explore-html/>. |
| 893 | +
|
| 894 | +The scalar inputs `α` and `β` shall be numbers. |
| 895 | +
|
| 896 | +The array inputs `x`, `y` and `AP` must be complex one-dimensional julia arrays of the |
| 897 | +same type that is either `ComplexF32` or `ComplexF64`. |
| 898 | +
|
| 899 | +Return the updated `y`. |
| 900 | +""" |
| 901 | +hpmv! |
| 902 | + |
826 | 903 | ### sbmv, (SB) symmetric banded matrix-vector multiplication
|
827 | 904 | for (fname, elty) in ((:dsbmv_,:Float64),
|
828 | 905 | (:ssbmv_,:Float32))
|
|
0 commit comments