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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,3 +47,29 @@ func Potrf(a blas64.Symmetric) (t blas64.Triangular, ok bool) { | |
| t.Diag = blas.NonUnit | ||
| return | ||
| } | ||
|
|
||
| // Geqrf computes the QR factorization of the m×n matrix A using a blocked | ||
| // algorithm. A is modified to contain the information to construct Q and R. | ||
| // The upper triangle of a contains the matrix R. The lower triangular elements | ||
| // (not including the diagonal) contain the elementary reflectors. Tau is modified | ||
| // to contain the reflector scales. Tau must have length at least min(m,n), and | ||
| // this function will panic otherwise. | ||
| // | ||
| // The ith elementary reflector can be explicitly constructed by first extracting | ||
| // the | ||
| // v[j] = 0 j < i | ||
| // v[j] = i j == i | ||
| // v[j] = a[i*lda+j] j > i | ||
| // and computing h_i = I - tau[i] * v * v^T. | ||
| // | ||
| // The orthonormal matrix Q can be constucted from a product of these elementary | ||
| // reflectors, Q = H_1*H_2 ... H_k, where k = min(m,n). | ||
| // | ||
| // Work is temporary storage, and lwork specifies the usable memory length. | ||
| // At minimum, lwork >= m and this function will panic otherwise. | ||
|
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. s/this function// |
||
| // Dgeqrf is a blocked LQ factorization, but the block size is limited | ||
| // by the temporary space available. If lwork == -1, instead of performing Dgelqf, | ||
| // the optimal work length will be stored into work[0]. | ||
| func Geqrf(a blas64.General, tau, work []float64, lwork int) { | ||
| lapack64.Dgeqrf(a.Rows, a.Cols, a.Data, a.Stride, tau, work, lwork) | ||
| } | ||
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 |
|---|---|---|
|
|
@@ -6,15 +6,15 @@ package native | |
|
|
||
| import "github.com/gonum/blas" | ||
|
|
||
| // Dgeqr2 computes a QR factorization of the m×n matrix a. | ||
| // 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 | ||
| // upper triangular m×n matrix. | ||
| // | ||
| // During Dgeqr2, a is modified to contain the information to construct Q and R. | ||
| // A is modified to contain the information to construct Q and R. | ||
|
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 think the original is correct here, "a" is modified, "A" is not. |
||
| // The upper triangle of a contains the matrix R. The lower triangular elements | ||
| // (not including the diagonal) contain the elementary reflectors. Tau is modified | ||
| // to contain the reflector scales. Tau must have length at least k = min(m,n), and | ||
| // to contain the reflector scales. tau must have length at least min(m,n), and | ||
| // this function will panic otherwise. | ||
| // | ||
| // The ith elementary reflector can be explicitly constructed by first extracting | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ import ( | |
| ) | ||
|
|
||
| // Dgeqrf computes the QR factorization of the m×n matrix A using a blocked | ||
| // algorithm. Please see the documentation for Dgeqr2 for a description of the | ||
| // algorithm. See the documentation for Dgeqr2 for a description of the | ||
| // parameters at entry and exit. | ||
| // | ||
| // Work is temporary storage, and lwork specifies the usable memory length. | ||
|
|
@@ -19,7 +19,7 @@ import ( | |
| // by the temporary space available. If lwork == -1, instead of performing Dgelqf, | ||
| // the optimal work length will be stored into work[0]. | ||
| // | ||
| // tau must be at least len min(m,n), and this function will panic otherwise. | ||
| // tau must have length at least min(m,n), and this function will panic otherwise. | ||
|
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. s/this function// |
||
| func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { | ||
| // nb is the optimal blocksize, i.e. the number of columns transformed at a time. | ||
| nb := impl.Ilaenv(1, "DGEQRF", " ", m, n, -1, -1) | ||
|
|
||
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.
s/this function//
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.
I think the "this function"s are fine. @vladimir-ch originally asked me to put them in. It's the function that will panic, not the []float64.
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.
Fair enough.