1 // Copyright ©2017 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/blas64"
9 // Dlapmt rearranges the columns of the m×n matrix X as specified by the
10 // permutation k_0, k_1, ..., k_n-1 of the integers 0, ..., n-1.
12 // If forward is true a forward permutation is performed:
14 // X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1.
16 // otherwise a backward permutation is performed:
18 // X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1.
20 // k must have length n, otherwise Dlapmt will panic. k is zero-indexed.
21 func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) {
22 checkMatrix(m, n, x, ldx)
36 bi := blas64.Implementation()
46 bi.Dswap(m, x[j:], ldx, x[i:], ldx)
61 bi.Dswap(m, x[j:], ldx, x[i:], ldx)