Skip to content

Commit 18eaa5b

Browse files
authored
Test_Sparse_TestUtils_RandCsMat.hpp: tighten up types (#2443)
Signed-off-by: Carl Pearson <[email protected]>
1 parent 78f4efd commit 18eaa5b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sparse/unit_test/Test_Sparse_TestUtils_RandCsMat.hpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
namespace Test {
2020
template <class ScalarType, class LayoutType, class ExeSpaceType>
2121
void doCsMat(size_t m, size_t n, ScalarType min_val, ScalarType max_val) {
22-
using RandCs = RandCsMatrix<ScalarType, LayoutType, ExeSpaceType>;
23-
using ordinal_type = typename RandCs::ordinal_type;
24-
using size_type = typename RandCs::size_type;
25-
auto expected_min = ScalarType(1.0);
26-
ordinal_type expected_nnz = 0;
22+
using RandCs = RandCsMatrix<ScalarType, LayoutType, ExeSpaceType>;
23+
using size_type = typename RandCs::size_type;
24+
auto expected_min = ScalarType(1.0);
25+
size_type expected_nnz = 0;
2726
RandCs cm(m, n, min_val, max_val);
2827

2928
for (size_type i = 0; i < cm.get_nnz(); ++i) ASSERT_GE(cm(i), expected_min) << cm.info;
@@ -39,7 +38,7 @@ void doCsMat(size_t m, size_t n, ScalarType min_val, ScalarType max_val) {
3938
int64_t col_start = j < static_cast<int64_t>(m) ? map(j) : 0;
4039
ASSERT_FLOAT_EQ(cm(col_start + i), cm(expected_nnz + i)) << cm.info;
4140
}
42-
expected_nnz += col_len;
41+
expected_nnz += size_type(col_len);
4342
}
4443
ASSERT_EQ(cm.get_nnz(), expected_nnz) << cm.info;
4544

0 commit comments

Comments
 (0)