Skip to content

Simplify generation of test matrix in testRandGmres.cpp example #223

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

Open
pelesh opened this issue Feb 7, 2025 · 0 comments
Open

Simplify generation of test matrix in testRandGmres.cpp example #223

pelesh opened this issue Feb 7, 2025 · 0 comments

Comments

@pelesh
Copy link
Collaborator

pelesh commented Feb 7, 2025

Consider simplifying/documenting better the logic for generating sparse matrix for testing randomized GMRES solvers in function generateMatrix. It is hard to parse what that function does and why.

Also, consider simplifying if statement in that function

if (((!c) && (((j - rowptr[i]) * N/nnz_per_row + (N%(N/nnz_per_row))) >= i)) || ((!c) && (j == (rowptr[i+1] - 1)) )) {

with something like this:

if ((!c) && (((j - rowptr[i]) * N/nnz_per_row + (N%(N/nnz_per_row))) >= i)) || (j == (rowptr[i+1] - 1)) ))

(same meaning, more readable) Maybe even nest the or inside the and

Originally posted by @shakedregev in #218 (comment)

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

No branches or pull requests

1 participant