Add symmetric tridiagonal matrices module#1091
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1091 +/- ##
==========================================
- Coverage 68.04% 68.00% -0.04%
==========================================
Files 404 405 +1
Lines 12948 12955 +7
Branches 1395 1395
==========================================
Hits 8810 8810
- Misses 4138 4145 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It looks pretty nice. One little thing though (even if I overlooked it when implementing the I'll go through the code a bit more thoroughly tomorrow but it looks pretty good to me already. |
Thanks for the suggestion! You’re right, I implemented so. Now the tridiagonal and symtridiagonal construction is now handled by two pure helper routines(one from arrays and one from constants), which is called by both the pure and impure constructors. |
loiseaujc
left a comment
There was a problem hiding this comment.
I'll take a deeper look at it by the end of the week, but it looks quite good to me so far.
jvdp1
left a comment
There was a problem hiding this comment.
Thank you @Mahmood-Sinan for this PR. Please find below some comments and suggestions.
|
|
||
| `A = ` [[stdlib_specialmatrices(module):sym_tridiagonal(interface)]] `(du, dv)` | ||
|
|
||
| - To construct a symmetric tridiagonal matrix of size `n x n` with constant diagonal elements `du` and `dv`: |
There was a problem hiding this comment.
by "constant" do you mean "scalar"
There was a problem hiding this comment.
Yes, I changed it so scalar now.
| allocate(y1(n), source = 0.0_wp) ; allocate(y2(n), source=0.0_wp) | ||
|
|
||
| ! Test y = A @ x | ||
| y1 = matmul(Amat, x) ; call spmv(A, x, y2) |
There was a problem hiding this comment.
| y1 = matmul(Amat, x) ; call spmv(A, x, y2) | |
| y1 = matmul(Amat, x) | |
| call spmv(A, x, y2) |
Thank you so much for reviewing. I have made those changes. Please take a look at them. |
|
@jvdp1 I have made the changes you asked for, please check |
jvdp1
left a comment
There was a problem hiding this comment.
Thank you @Mahmood-Sinan for this PR (sorry for my delayed review). LGTM, and this PR is ready to be merged IMO.
|
I'll bother you for one last set of changes and then we can merge. Following #1162, can you make sure the |
|
@Mahmood-Sinan : LGTM. Thanks for reacting rapidly to the 1x1 edge case. @jvdp1 : Do you mind if I merge this today so that @Mahmood-Sinan can include it in their GSoC application ? |
@jvdp1 please check. |
|
Sorry @Mahmood-Sinan and @loiseaujc for this late answer. I will merge it. |
This draft PR adds support for symmetric tridiagonal matrices inside
specialmatricesin stdlib.It includes implementation, tests, documentation and examples.
The PR implements the same arithmetic and matrix operations as the existing tridiagonal module.
Remaining tasks:
(this will be added here once that implementation is merged).
Feedback is welcome.