docs: add band matrix storage format documentation in the README of lapack/base#8083
docs: add band matrix storage format documentation in the README of lapack/base#8083aayush0325 wants to merge 15 commits into
lapack/base#8083Conversation
---
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 <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
|
|
||
| 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.
It would be good to actually show matrices which are upper and lower triangular here.
There was a problem hiding this comment.
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.
This comment still needs to be resolved.
kgryte
left a comment
There was a problem hiding this comment.
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 <kgryte@gmail.com>
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
---
---
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
---
---
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
---
|
A few comments still need to be resolved before we can finally get this one in. :) |
---
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
---
|
cc @DivitJain26 Would you mind taking a look at this? Cheers! |
|
hello MKL describes two methods of packing a band matrix according to the layout in Matrix Storage Schemes for LAPACK Routines. A more descriptive explanation can be found in the cblas_?gbmv
This is true for BLAS routines as I have demonstrated here Layout Dependent Band Matrix Packing in However, it does not hold for LAPACK routines: routines that operate on band matrices expect the input matrix to be packed as defined for
This contradicts Matrix Storage Schemes for LAPACK Routines and warrants further investigation. The reason for this behaviour becomes clear when tracing the call chain. When As mentioned in Matrix Layout (Row Major and Column Major).
References: |
LAPACKE band routines always expect column-major style band packing; even when
|

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