|  | 
| 33 | 33 |     sbmv!, | 
| 34 | 34 |     sbmv, | 
| 35 | 35 |     spmv!, | 
|  | 36 | +    spr!, | 
| 36 | 37 |     symv!, | 
| 37 | 38 |     symv, | 
| 38 | 39 |     trsv!, | 
| @@ -1145,6 +1146,71 @@ Return the updated `y`. | 
| 1145 | 1146 | """ | 
| 1146 | 1147 | spmv! | 
| 1147 | 1148 | 
 | 
|  | 1149 | +### spr!, (SP) symmetric packed matrix-vector operation defined as A := alpha*x*x' + A | 
|  | 1150 | +for (fname, elty) in ((:dspr_, :Float64), | 
|  | 1151 | +                      (:sspr_, :Float32)) | 
|  | 1152 | +    @eval begin | 
|  | 1153 | +        function spr!(uplo::AbstractChar, | 
|  | 1154 | +                      n::Integer, | 
|  | 1155 | +                      α::$elty, | 
|  | 1156 | +                      x::Union{Ptr{$elty}, AbstractArray{$elty}}, | 
|  | 1157 | +                      incx::Integer, | 
|  | 1158 | +                      AP::Union{Ptr{$elty}, AbstractArray{$elty}}) | 
|  | 1159 | + | 
|  | 1160 | +            ccall((@blasfunc($fname), libblastrampoline), Cvoid, | 
|  | 1161 | +                  (Ref{UInt8},     # uplo, | 
|  | 1162 | +                   Ref{BlasInt},   # n, | 
|  | 1163 | +                   Ref{$elty},     # α, | 
|  | 1164 | +                   Ptr{$elty},     # x, | 
|  | 1165 | +                   Ref{BlasInt},   # incx, | 
|  | 1166 | +                   Ptr{$elty},     # AP, | 
|  | 1167 | +                   Clong),         # length of uplo | 
|  | 1168 | +                  uplo, | 
|  | 1169 | +                  n, | 
|  | 1170 | +                  α, | 
|  | 1171 | +                  x, | 
|  | 1172 | +                  incx, | 
|  | 1173 | +                  AP, | 
|  | 1174 | +                  1) | 
|  | 1175 | +            return AP | 
|  | 1176 | +        end | 
|  | 1177 | +    end | 
|  | 1178 | +end | 
|  | 1179 | + | 
|  | 1180 | +function spr!(uplo::AbstractChar, | 
|  | 1181 | +              α::Real, x::Union{DenseArray{T}, AbstractVector{T}}, | 
|  | 1182 | +              AP::Union{DenseArray{T}, AbstractVector{T}}) where {T <: BlasReal} | 
|  | 1183 | +    require_one_based_indexing(AP, x) | 
|  | 1184 | +    N = length(x) | 
|  | 1185 | +    if 2*length(AP) < N*(N + 1) | 
|  | 1186 | +        throw(DimensionMismatch("Packed symmetric matrix A has size smaller than length(x) = $(N).")) | 
|  | 1187 | +    end | 
|  | 1188 | +    return spr!(uplo, N, convert(T, α), x, stride(x, 1), AP) | 
|  | 1189 | +end | 
|  | 1190 | + | 
|  | 1191 | +""" | 
|  | 1192 | +    spr!(uplo, α, x, AP) | 
|  | 1193 | +
 | 
|  | 1194 | +Update matrix `A` as `α*A*x*x'`, where `A` is a symmetric matrix provided | 
|  | 1195 | +in packed format `AP` and `x` is a vector. | 
|  | 1196 | +
 | 
|  | 1197 | +With `uplo = 'U'`, the array AP must contain the upper triangular part of the | 
|  | 1198 | +symmetric matrix packed sequentially, column by column, so that `AP[1]` | 
|  | 1199 | +contains `A[1, 1]`, `AP[2]` and `AP[3]` contain `A[1, 2]` and `A[2, 2]` | 
|  | 1200 | +respectively, and so on. | 
|  | 1201 | +
 | 
|  | 1202 | +With `uplo = 'L'`, the array AP must contain the lower triangular part of the | 
|  | 1203 | +symmetric matrix packed sequentially, column by column, so that `AP[1]` | 
|  | 1204 | +contains `A[1, 1]`, `AP[2]` and `AP[3]` contain `A[2, 1]` and `A[3, 1]` | 
|  | 1205 | +respectively, and so on. | 
|  | 1206 | +
 | 
|  | 1207 | +The scalar input `α` must be real. | 
|  | 1208 | +
 | 
|  | 1209 | +The array inputs `x` and `AP` must all be of `Float32` or `Float64` type. | 
|  | 1210 | +Return the updated `AP`. | 
|  | 1211 | +""" | 
|  | 1212 | +spr! | 
|  | 1213 | + | 
| 1148 | 1214 | ### hbmv, (HB) Hermitian banded matrix-vector multiplication | 
| 1149 | 1215 | for (fname, elty) in ((:zhbmv_,:ComplexF64), | 
| 1150 | 1216 |                       (:chbmv_,:ComplexF32)) | 
|  | 
0 commit comments