This repository was archived by the owner on Nov 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,60 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok | |
| return clapack.Dpotrf(ul, n, a, lda) | ||
| } | ||
|
|
||
| // Dgelq2 computes the LQ factorization of the m×n matrix A. | ||
| // | ||
| // In an LQ factorization, L is a lower triangular m×n matrix, and Q is an n×n | ||
| // orthornormal matrix. | ||
| // | ||
| // a is modified to contain the information to construct L and Q. | ||
| // The lower triangle of a contains the matrix L. The upper triangular elements | ||
| // (not including the diagonal) contain the elementary reflectors. Tau is modified | ||
| // to contain the reflector scales. tau must have length of at least k = min(m,n) | ||
| // and this function will panic otherwise. | ||
| // | ||
| // See Dgeqr2 for a description of the elementary reflectors and orthonormal | ||
| // matrix Q. Q is constructed as a product of these elementary reflectors, | ||
| // Q = H_k ... H_2*H_1. | ||
| // | ||
| // Work is temporary storage of length at least m and this function will panic otherwise. | ||
| func (impl Implementation) Dgelq2(m, n int, a []float64, lda int, tau, work []float64) { | ||
| checkMatrix(m, n, a, lda) | ||
| if len(tau) < min(m, n) { | ||
| panic(badTau) | ||
| } | ||
| if len(work) < m { | ||
| panic(badWork) | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this going now without changes?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because nothing can be done about the implementation of this routine in C. The comment remains in the Go code (which we could do something about).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hate reviewing in github. I should have noticed that, sorry. |
||
| clapack.Dgelq2(m, n, a, lda, tau) | ||
| } | ||
|
|
||
| // Dgelqf computes the LQ factorization of the m×n matrix A using a blocked | ||
| // algorithm. See the documentation for Dgelq2 for a description of the | ||
| // parameters at entry and exit. | ||
| // | ||
| // The C interface does not support providing temporary storage. To provide compatibility | ||
| // with native, lwork == -1 will not run Dgeqrf but will instead write the minimum | ||
| // work necessary to work[0]. If len(work) < lwork, Dgeqrf will panic. | ||
| // | ||
| // tau must have length at least min(m,n), and this function will panic otherwise. | ||
| func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { | ||
| if lwork == -1 { | ||
| work[0] = float64(m) | ||
| return | ||
| } | ||
| checkMatrix(m, n, a, lda) | ||
| if len(work) < lwork { | ||
| panic(shortWork) | ||
| } | ||
| if lwork < m { | ||
| panic(badWork) | ||
| } | ||
| if len(tau) < min(m, n) { | ||
| panic(badTau) | ||
| } | ||
| clapack.Dgelqf(m, n, a, lda, tau) | ||
| } | ||
|
|
||
| // Dgeqr2 computes a QR factorization of the m×n matrix A. | ||
| // | ||
| // In a QR factorization, Q is an m×m orthonormal matrix, and R is an | ||
|
|
@@ -100,9 +154,6 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok | |
| // | ||
| // Work is temporary storage of length at least n and this function will panic otherwise. | ||
| func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []float64) { | ||
| // TODO(btracey): This is oriented such that columns of a are eliminated. | ||
| // This likely could be re-arranged to take better advantage of row-major | ||
| // storage. | ||
| checkMatrix(m, n, a, lda) | ||
| if len(work) < n { | ||
| panic(badWork) | ||
|
|
@@ -120,7 +171,7 @@ func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []fl | |
| // | ||
| // The C interface does not support providing temporary storage. To provide compatibility | ||
| // with native, lwork == -1 will not run Dgeqrf but will instead write the minimum | ||
| // work necessary to work[0]. If len(work) < lwork, Dgels will panic. | ||
| // work necessary to work[0]. If len(work) < lwork, Dgeqrf will panic. | ||
| // | ||
| // tau must have length at least min(m,n), and this function will panic otherwise. | ||
| func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tau