Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
mir.glas.l2
Level 2
This is a submodule of mir.glas.
The Level 2 BLAS perform matrix-vector operations.
Note GLAS is singe thread for now.
Function Name | Description |
---|---|
gemv | general matrix-vector multiplication, partially optimized |
License:
Authors:
Ilya Yaroshenko
- nothrow @nogc @system void
gemv
(A, B, C, SliceKind kindA, SliceKind kindB, SliceKind kindC)(Calpha
, Slice!(const(A)*, 2, kindA)asl
, Slice!(const(B)*, 1, kindB)xsl
, Cbeta
, Slice!(C*, 1, kindC)ysl
)
if (allSatisfy!(isNumeric, A, B, C)); - DRAFT Performs general matrix-vector multiplication.
Pseudo code y :=
alpha
A × x +beta
y.Parameters:C alpha
scalar Slice!(const(A)*, 2, kindA) asl
m ⨉ n matrix Slice!(const(B)*, 1, kindB) xsl
n ⨉ 1 vector C beta
scalar. When beta
is supplied as zero then the vectorysl
need not be set on input.Slice!(C*, 1, kindC) ysl
m ⨉ 1 vector Note GLAS does not require transposition parameters. Use transposed to perform zero cost Slice transposition.
BLAS SGEMV, DGEMV, (CGEMV, ZGEMV are not implemented for now)
Examples:import mir.ndslice; auto a = slice!double(3, 5); a[] = [[-5, 1, 7, 7, -4], [-1, -5, 6, 3, -3], [-5, -2, -3, 6, 0]]; auto b = slice!double(5); b[] = [-5.0, 4.0, -4.0, -1.0, 9.0]; auto c = slice!double(3); gemv!(double, double, double)(1.0, a, b, 0.0, c); assert(c == [-42.0, -69.0, 23.0]);
Copyright © 2016-2020 by Ilya Yaroshenko | Page generated by
Ddoc on Sun Nov 15 09:37:38 2020