Skip to content
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

implement Whitaker smoother and all the utilities to be used outside #292

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

jobo322
Copy link
Member

@jobo322 jobo322 commented Feb 18, 2025

This implement an expose:

  • xWhitakerSmoother
  • matrixCholeskySolver
  • matrixCuthillMckee
  • updateWeights

matrixCholeskySolver accepts optionally the permutation encoded array from matrixCuthillMckee to reduce the bandwidth of the matrix. Both of them uses matrix in the triplet form:

const matrix = [
 [rowIndex, columnInde, value]
  ...
  ...
]

the internal addWeights receives a matrix in the triplet form and a NumberArray of the same dimension (diagonal length === array length) and add the weights.

@jobo322 jobo322 linked an issue Feb 18, 2025 that may be closed by this pull request
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 97.99555% with 9 lines in your changes missing coverage. Please review.

Project coverage is 96.51%. Comparing base (bd9dc3e) to head (2926042).

Files with missing lines Patch % Lines
src/x/xWhitakerSmoother.ts 93.50% 5 Missing ⚠️
src/matrix/matrixCholeskySolver.ts 98.40% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #292      +/-   ##
==========================================
+ Coverage   96.38%   96.51%   +0.12%     
==========================================
  Files         184      190       +6     
  Lines        5152     5601     +449     
  Branches     1147     1214      +67     
==========================================
+ Hits         4966     5406     +440     
- Misses        186      195       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests

@jobo322
Copy link
Member Author

jobo322 commented Feb 19, 2025

reading again the code, the operation with lambda = 1 of lambda D^TD where D is the derivative of the identity matrix, with 10 rows

 [
    [1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [-1, 2, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, -1, 2, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, -1, 2, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, -1, 2, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, -1, 2, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, -1, 2, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, -1, 2, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, -1, 2, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, -1, 1],
  ];

It is a populated matrix of 10x10 by the indexes returned by createSystemMatrix, so it is already a lower triangular matrix.
I found:

  • the bandwidth is the minimal so the cuthill-mckee permutations is not needed.
  • the code of cholesky solver expect a upper triangular matrix instead of the lower triangular generated.

@jobo322 jobo322 force-pushed the 291-implement-whitaker-smooth branch from 746aa2e to 7203356 Compare February 19, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement Whitaker smooth
2 participants