You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: cgo/lapack.go
+111Lines changed: 111 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -327,3 +327,114 @@ func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64
327
327
}
328
328
clapack.Dgetrs(trans, n, nrhs, a, lda, ipiv32, b, ldb)
329
329
}
330
+
331
+
// Dormlq multiplies the matrix C by the othogonal matrix Q defined by the
332
+
// slices a and tau. A and tau are as returned from Dgelqf.
333
+
// C = Q * C if side == blas.Left and trans == blas.NoTrans
334
+
// C = Q^T * C if side == blas.Left and trans == blas.Trans
335
+
// C = C * Q if side == blas.Right and trans == blas.NoTrans
336
+
// C = C * Q^T if side == blas.Right and trans == blas.Trans
337
+
// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right
338
+
// A is of size k×n. This uses a blocked algorithm.
339
+
//
340
+
// Work is temporary storage, and lwork specifies the usable memory length.
341
+
// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right,
342
+
// and this function will panic otherwise.
343
+
// Dormlq uses a block algorithm, but the block size is limited
344
+
// by the temporary space available. If lwork == -1, instead of performing Dormlq,
345
+
// the optimal work length will be stored into work[0].
346
+
//
347
+
// tau contains the householder scales and must have length at least k, and
348
+
// this function will panic otherwise.
349
+
func (implImplementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, kint, a []float64, ldaint, tau, c []float64, ldcint, work []float64, lworkint) {
350
+
ifside!=blas.Left&&side!=blas.Right {
351
+
panic(badSide)
352
+
}
353
+
iftrans!=blas.Trans&&trans!=blas.NoTrans {
354
+
panic(badTrans)
355
+
}
356
+
left:=side==blas.Left
357
+
ifleft {
358
+
checkMatrix(k, m, a, lda)
359
+
} else {
360
+
checkMatrix(k, n, a, lda)
361
+
}
362
+
checkMatrix(m, n, c, ldc)
363
+
iflen(tau) <k {
364
+
panic(badTau)
365
+
}
366
+
iflwork==-1 {
367
+
ifleft {
368
+
work[0] =float64(n)
369
+
return
370
+
}
371
+
work[0] =float64(m)
372
+
return
373
+
}
374
+
ifleft {
375
+
iflwork<n {
376
+
panic(badWork)
377
+
}
378
+
} else {
379
+
iflwork<m {
380
+
panic(badWork)
381
+
}
382
+
}
383
+
clapack.Dormlq(side, trans, m, n, k, a, lda, tau, c, ldc)
384
+
}
385
+
386
+
// Dormqr multiplies the matrix C by the othogonal matrix Q defined by the
387
+
// slices a and tau. a and tau are as returned from Dgeqrf.
388
+
// C = Q * C if side == blas.Left and trans == blas.NoTrans
389
+
// C = Q^T * C if side == blas.Left and trans == blas.Trans
390
+
// C = C * Q if side == blas.Right and trans == blas.NoTrans
391
+
// C = C * Q^T if side == blas.Right and trans == blas.Trans
392
+
// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right
393
+
// A is of size k×n. This uses a blocked algorithm.
394
+
//
395
+
// tau contains the householder scales and must have length at least k, and
396
+
// this function will panic otherwise.
397
+
//
398
+
// The C interface does not support providing temporary storage. To provide compatibility
399
+
// with native, lwork == -1 will not run Dgeqrf but will instead write the minimum
400
+
// work necessary to work[0]. If len(work) < lwork, Dgeqrf will panic.
401
+
func (implImplementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, kint, a []float64, ldaint, tau, c []float64, ldcint, work []float64, lworkint) {
402
+
left:=side==blas.Left
403
+
ifleft {
404
+
checkMatrix(m, k, a, lda)
405
+
} else {
406
+
checkMatrix(n, k, a, lda)
407
+
}
408
+
checkMatrix(m, n, c, ldc)
409
+
410
+
iflen(tau) <k {
411
+
panic(badTau)
412
+
}
413
+
414
+
iflwork==-1 {
415
+
ifleft {
416
+
work[0] =float64(m)
417
+
return
418
+
}
419
+
work[0] =float64(n)
420
+
return
421
+
}
422
+
423
+
ifleft {
424
+
iflwork<n {
425
+
panic(badWork)
426
+
}
427
+
} else {
428
+
iflwork<m {
429
+
panic(badWork)
430
+
}
431
+
}
432
+
433
+
clapack.Dormqr(side, trans, m, n, k, a, lda, tau, c, ldc)
434
+
}
435
+
436
+
// Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. Dtrtrs
437
+
// returns whether the solve completed successfully. If A is singular, no solve is performed.
438
+
func (implImplementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhsint, a []float64, ldaint, b []float64, ldbint) (okbool) {
439
+
returnclapack.Dtrtrs(uplo, trans, diag, n, nrhs, a, lda, b, ldb)
Copy file name to clipboardExpand all lines: native/dormlq.go
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ import (
9
9
"github.com/gonum/lapack"
10
10
)
11
11
12
-
// Dormlq multiplies the matrix c by the othogonal matrix q defined by the
12
+
// Dormlq multiplies the matrix C by the othogonal matrix Q defined by the
13
13
// slices a and tau. A and tau are as returned from Dgelqf.
14
14
// C = Q * C if side == blas.Left and trans == blas.NoTrans
15
15
// C = Q^T * C if side == blas.Left and trans == blas.Trans
16
16
// C = C * Q if side == blas.Right and trans == blas.NoTrans
17
17
// C = C * Q^T if side == blas.Right and trans == blas.Trans
18
-
// If side == blas.Left, a is a matrix of side k×m, and if side == blas.Right
19
-
// a is of size k×n. This uses a blocked algorithm.
18
+
// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right
19
+
// A is of size k×n. This uses a blocked algorithm.
20
20
//
21
21
// Work is temporary storage, and lwork specifies the usable memory length.
22
22
// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right,
@@ -25,7 +25,7 @@ import (
25
25
// by the temporary space available. If lwork == -1, instead of performing Dormlq,
26
26
// the optimal work length will be stored into work[0].
27
27
//
28
-
// Tau contains the householder scales and must have length at least k, and
28
+
// tau contains the householder scales and must have length at least k, and
29
29
// this function will panic otherwise.
30
30
func (implImplementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, kint, a []float64, ldaint, tau, c []float64, ldcint, work []float64, lworkint) {
Copy file name to clipboardExpand all lines: native/dormqr.go
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ import (
9
9
"github.com/gonum/lapack"
10
10
)
11
11
12
-
// Dormqr multiplies the matrix c by the othogonal matrix q defined by the
12
+
// Dormqr multiplies the matrix C by the othogonal matrix Q defined by the
13
13
// slices a and tau. A and tau are as returned from Dgeqrf.
14
14
// C = Q * C if side == blas.Left and trans == blas.NoTrans
15
15
// C = Q^T * C if side == blas.Left and trans == blas.Trans
16
16
// C = C * Q if side == blas.Right and trans == blas.NoTrans
17
17
// C = C * Q^T if side == blas.Right and trans == blas.Trans
18
-
// If side == blas.Left, a is a matrix of side k×m, and if side == blas.Right
19
-
// a is of size k×n. This uses a blocked algorithm.
18
+
// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right
19
+
// A is of size k×n. This uses a blocked algorithm.
20
20
//
21
21
// Work is temporary storage, and lwork specifies the usable memory length.
22
22
// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right,
@@ -25,7 +25,7 @@ import (
25
25
// by the temporary space available. If lwork == -1, instead of performing Dormqr,
26
26
// the optimal work length will be stored into work[0].
27
27
//
28
-
// Tau contains the householder scales and must have length at least k, and
28
+
// tau contains the householder scales and must have length at least k, and
29
29
// this function will panic otherwise.
30
30
func (implImplementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, kint, a []float64, ldaint, tau, c []float64, ldcint, work []float64, lworkint) {
31
31
left:=side==blas.Left
@@ -37,6 +37,10 @@ func (impl Implementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, k
Copy file name to clipboardExpand all lines: native/dtrtrs.go
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,8 @@ import (
9
9
"github.com/gonum/blas/blas64"
10
10
)
11
11
12
-
// Dtrtrs solves a triangular system of the form a * x = b or a^T * x = b. Dtrtrs
13
-
// checks for singularity in a. If a is singular, false is returned and no solve
14
-
// is performed. True is returned otherwise.
12
+
// Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. Dtrtrs
13
+
// returns whether the solve completed successfully. If A is singular, no solve is performed.
15
14
func (implImplementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhsint, a []float64, ldaint, b []float64, ldbint) (okbool) {
0 commit comments