|
52 | 52 | # xTBSV
|
53 | 53 | # xTPSV
|
54 | 54 | ger!,
|
| 55 | + geru!, |
55 | 56 | # xGERU
|
56 | 57 | # xGERC
|
57 | 58 | her!,
|
@@ -1417,6 +1418,41 @@ for (fname, elty) in ((:dger_,:Float64),
|
1417 | 1418 | end
|
1418 | 1419 | end
|
1419 | 1420 |
|
| 1421 | +### geru |
| 1422 | + |
| 1423 | +""" |
| 1424 | + geru!(alpha, x, y, A) |
| 1425 | +
|
| 1426 | +Rank-1 update of the matrix `A` with vectors `x` and `y` as `alpha*x*transpose(y) + A`. |
| 1427 | +""" |
| 1428 | +function geru! end |
| 1429 | + |
| 1430 | +for (fname, elty) in ((:zgeru_,:ComplexF64), (:cgeru_,:ComplexF32)) |
| 1431 | + @eval begin |
| 1432 | + function geru!(α::$elty, x::AbstractVector{$elty}, y::AbstractVector{$elty}, A::AbstractMatrix{$elty}) |
| 1433 | + require_one_based_indexing(A, x, y) |
| 1434 | + m, n = size(A) |
| 1435 | + if m != length(x) || n != length(y) |
| 1436 | + throw(DimensionMismatch(lazy"A has size ($m,$n), x has length $(length(x)), y has length $(length(y))")) |
| 1437 | + end |
| 1438 | + px, stx = vec_pointer_stride(x, ArgumentError("input vector with 0 stride is not allowed")) |
| 1439 | + py, sty = vec_pointer_stride(y, ArgumentError("input vector with 0 stride is not allowed")) |
| 1440 | + GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid, |
| 1441 | + (Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty}, |
| 1442 | + Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, |
| 1443 | + Ref{BlasInt}), |
| 1444 | + m, n, α, px, stx, py, sty, A, max(1,stride(A,2))) |
| 1445 | + A |
| 1446 | + end |
| 1447 | + end |
| 1448 | +end |
| 1449 | +for elty in (:Float64, :Float32) |
| 1450 | + @eval begin |
| 1451 | + geru!(α::$elty, x::AbstractVector{$elty}, y::AbstractVector{$elty}, A::AbstractMatrix{$elty}) = |
| 1452 | + ger!(α, x, y, A) |
| 1453 | + end |
| 1454 | +end |
| 1455 | + |
1420 | 1456 | ### syr
|
1421 | 1457 |
|
1422 | 1458 | """
|
|
0 commit comments