Skip to content

Commit

Permalink
Merge pull request #237 from nonhermitian/remove-flags
Browse files Browse the repository at this point in the history
Remove flags
  • Loading branch information
nonhermitian authored Oct 1, 2024
2 parents ea3af1a + 1462e4e commit 09285fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions mthree/src/col_renorm.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ void compute_col_norms(float * col_norms,
#pragma omp parallel for
for (col = 0; col < num_elems; ++col)
{
bool flag = false;
float col_norm = 0.0F;
size_t row;
int terms = 0;
for (row = 0; row < num_elems; ++row)
{
if (flag) continue;
if (MAX_DIST || within_distance(row, col, bitstrings, num_bits, distance))
{
col_norm += compute_element(row, col, bitstrings, cals, num_bits);
terms += 1;
if (terms == num_terms)
{
flag = true;
break;
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions mthree/src/matvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ void matvec(const float * __restrict x,
{
float temp_elem, row_sum = 0;
size_t col;
bool flag = false;
int terms = 0;
for (col = 0; col < num_elems; ++col)
{
if (flag) continue;
if (MAX_DIST || within_distance(row, col, bitstrings, num_bits, distance))
{
temp_elem = compute_element(row, col, bitstrings, cals, num_bits);
Expand All @@ -64,7 +62,7 @@ void matvec(const float * __restrict x,
terms += 1;
if (terms == num_terms)
{
flag = true;
break;
}
}
}
Expand Down Expand Up @@ -106,11 +104,9 @@ void rmatvec(const float * __restrict x,
{
float temp_elem, row_sum = 0;
size_t row;
bool flag = false;
int terms = 0;
for (row = 0; row < num_elems; ++row)
{
if (flag) continue;
if (MAX_DIST || within_distance(row, col, bitstrings, num_bits, distance))
{
temp_elem = compute_element(row, col, bitstrings, cals, num_bits);
Expand All @@ -119,7 +115,7 @@ void rmatvec(const float * __restrict x,
terms += 1;
if (terms == num_terms)
{
flag = true;
break;
}
}
}
Expand Down

0 comments on commit 09285fd

Please sign in to comment.