1 // Copyright ©2015 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 import "gonum.org/v1/gonum/blas"
9 // Dlacpy copies the elements of A specified by uplo into B. Uplo can specify
10 // a triangular portion with blas.Upper or blas.Lower, or can specify all of the
11 // elemest with blas.All.
13 // Dlacpy is an internal routine. It is exported for testing purposes.
14 func (impl Implementation) Dlacpy(uplo blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) {
15 checkMatrix(m, n, a, lda)
16 checkMatrix(m, n, b, ldb)
21 for i := 0; i < m; i++ {
22 for j := i; j < n; j++ {
23 b[i*ldb+j] = a[i*lda+j]
28 for i := 0; i < m; i++ {
29 for j := 0; j < min(i+1, n); j++ {
30 b[i*ldb+j] = a[i*lda+j]
34 for i := 0; i < m; i++ {
35 for j := 0; j < n; j++ {
36 b[i*ldb+j] = a[i*lda+j]