Skip to content

Clean up problem#19

Merged
dance858 merged 4 commits intomainfrom
problem-refactor
Jan 13, 2026
Merged

Clean up problem#19
dance858 merged 4 commits intomainfrom
problem-refactor

Conversation

@dance858
Copy link
Collaborator

No description provided.

Comment on lines -156 to 170
int i, j, ii, jj;
for (i = 0; i < C->m; i++)
int j, ii, jj;
for (ii = 0; ii < C->m; ii++)
{
for (jj = C->p[i]; jj < C->p[i + 1]; jj++)
for (jj = C->p[ii]; jj < C->p[ii + 1]; jj++)
{
j = C->i[jj];

if (j < i)
if (j < ii)
{
C->x[jj] = csr_get_value(C, j, i);
C->x[jj] = csr_get_value(C, j, ii);
}
else
{
int nnz_ai = A->p[i + 1] - A->p[i];
int nnz_ai = A->p[ii + 1] - A->p[ii];
int nnz_aj = A->p[j + 1] - A->p[j];
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you explain these changes? what is ii and why can it replace i here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just an integer variable. We could call it i, but sometimes I do ii instead because A->i[i] looks more confusing than A->i[ii] according to me

Copy link
Collaborator

@Transurgeon Transurgeon left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding the timers!

@dance858 dance858 merged commit 749420d into main Jan 13, 2026
0 of 9 checks passed
@dance858 dance858 deleted the problem-refactor branch February 1, 2026 23:16
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.

2 participants