File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Sources/AccelerateLinux/MatrixOps Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ The package is structured as follows:
3535- ` Sources/AccelerateLinux/MatrixOps` : Contains matrix operations:
3636 - ` BasicOps` - Basic matrix operations:
3737 - [x] ` vDSP_mtransD` - Transpose a matrix
38- - [ ] ` vDSP_mmulD` - Matrix multiplication
38+ - [x ] ` vDSP_mmulD` - Matrix multiplication
3939 - ` LAPACK` - LAPACK functions:
4040 - [x] ` dgesv_` - Solve a system of linear equations
4141 - [x] ` dgesvd_` - Singular Value Decomposition
Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ public func vDSP_mmulD(
5353 _ __N: vDSP_Length ,
5454 _ __P: vDSP_Length
5555) {
56-
56+ var a = __A
57+ for i in 0 ..< __M {
58+ var b = __B
59+ for _ in 0 ..< __P {
60+ var c = __C. advanced ( by: Int ( i) * __IC * Int( __N) )
61+ for _ in 0 ..< __N {
62+ c. pointee += a. pointee * b. pointee
63+ b = b. advanced ( by: __IB)
64+ c = c. advanced ( by: __IC)
65+ }
66+ a = a. advanced ( by: __IA)
67+ }
68+ }
5769}
5870#endif // canImport(Accelerate)
You can’t perform that action at this time.
0 commit comments