-
-
Notifications
You must be signed in to change notification settings - Fork 920
docs: add band matrix storage format documentation in the README of lapack/base
#8083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: na
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
Signed-off-by: Athan <[email protected]>
|
|
||
| Triangular band matrices are stored in the same format as general band matrices: | ||
|
|
||
| - If `KL = 0`, the matrix is upper triangular. |
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.
It would be good to actually show matrices which are upper and lower triangular here.
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.
Overall, this is looking good. It's a more readable version of https://netlib.org/lapack/lug/node124.html. That stated, one thing which needs to be changed is that currently everything is written using one-based indexing. We need to update everything to zero-based indexing.
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.
One question I have: how do row- and column-major orders factor in here. For example, in dgbbrd, the routine accepts a layout argument.
It may be good to also show how the band storage matrices are stored in linear memory for the two supported layouts. IIRC, this was a point of confusion during development.
Signed-off-by: Athan <[email protected]>
|
|
||
| Let `M = N = 5`, `KL = 2`, and `KU = 1`. Given an original band matrix `A` | ||
|
|
||
| <!-- <equation class="equation" label="eq:band_matrix_a" align="center" raw="A = \left[\begin{array}{rrrrr}a_{11} & a_{12} & 0 & 0 & 0 \\a_{21} & a_{22} & a_{23} & 0 & 0 \\a_{31} & a_{32} & a_{33} & a_{34} & 0 \\0 & a_{42} & a_{43} & a_{44} & a_{45} \\0 & 0 & a_{53} & a_{54} & a_{55}\end{array}\right]" alt="Representation of band matrix A."> --> |
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.
In these comments, you do not need to preserve extra whitespace for aligning array elements. In fact, removing is preferred.
this is how i understand the row and column major interpretations of these matrices: for column major: {
"order": "column-major",
"type": "banded",
"M": 5,
"N": 5,
"KL": 2,
"KU": 1,
"A": [
0.0, 0.0, 0.0, 1.1, 2.1, 3.1,
0.0, 0.0, 1.2, 2.2, 3.2, 4.2,
0.0, 0.0, 2.3, 3.3, 4.3, 5.3,
0.0, 0.0, 3.4, 4.4, 5.4, 0.0,
0.0, 0.0, 4.5, 5.5, 0.0, 0.0
],
"A_mat": [
[ 1.1, 1.2, 0.0, 0.0, 0.0 ],
[ 2.1, 2.2, 2.3, 0.0, 0.0 ],
[ 3.1, 3.2, 3.3, 3.4, 0.0 ],
[ 0.0, 4.2, 4.3, 4.4, 4.5 ],
[ 0.0, 0.0, 5.3, 5.4, 5.5 ]
],
}for row major: {
"order": "row-major",
"type": "banded",
"M": 5,
"N": 5,
"KL": 2,
"KU": 1,
"A": [
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.2, 2.3, 3.4, 4.5,
1.1, 2.2, 3.3, 4.4, 5.5,
2.1, 3.2, 4.3, 5.4, 0.0,
3.1, 4.2, 5.3, 0.0, 0.0
],
"A_mat": [
[ 1.1, 1.2, 0.0, 0.0, 0.0 ],
[ 2.1, 2.2, 2.3, 0.0, 0.0 ],
[ 3.1, 3.2, 3.3, 3.4, 0.0 ],
[ 0.0, 4.2, 4.3, 4.4, 4.5 ],
[ 0.0, 0.0, 5.3, 5.4, 5.5 ]
]
}
i am basically reading this column-by-column for col-major and row-by-row for row-major |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: na
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
|
@aayush0325 What you are displaying is specific for LU correct with the extra cols/rows? Regardless, I suggest making explicit with a couple of brief examples showing how banded matrices are stored according to layouts. |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: na
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
| ### General Band Matrix Storage | ||
|
|
||
| A general band matrix of size `M`-by-`N` with `KL` subdiagonals and `KU` superdiagonals is stored in a two-dimensional array `AB` with `KL+KU+1` rows and `N` columns. | ||
| A general band matrix of size `M`-by-`N` with `KL` subdiagonals and `KU` superdiagonals is stored in a two-dimensional array `A` with `KL+KU+1` rows and `N` columns. |
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.
@aayush0325 What was the rationale for changing A to AB here and below? Now at, e.g., L101, you have
Element `A[i, j]` is stored in `A[1+i-j, j]`.
which no longer makes sense.
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.
ran a silly search and replace here, sorry!! fixing
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: na
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---

Description
This pull request:
lapack/baseas discussedRelated Issues
No.
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers