ORNL / ORNL/ReSolve

Implement A := c*A+B method in `MatrixHandler`

Open
#393 4 comments 0 reactions 1 assignee View on GitHub

@quantumsteve is already working on this.

Since Nov 12, 2025.

cuda enhancement hip
Dominant language
C++
Stars
84
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Summary

Implement following operation in MatrixHandler class for all three suported hardware backends:

  • $A := cA + I$ - Multiply all matrix element by a constant and add identity matrix to it.
  • $A := cA + B$ - Multiply all matrix element by a constant and add another matrix to it.
Rationale

These methods are needed for interfacing with SUNDIALS, which requires matrix objects to implement following methods

Description

Add methods to the existing MatrixHandler implementations. Test on CPU, CUDA and HIP backends. Add unit tests to the MatrixHandlerTests class.

Additional information

Please keep in mind that this operation will be called repeatedly for matrices with the same sparsity pattern. Make sure the analysis part to compute the sparsity pattern of the resulting matrix is done once and available for reuse whenever the same operation is called.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.