Skip to content
Snippets Groups Projects
Commit 5cfa8569 authored by Simon Praetorius's avatar Simon Praetorius Committed by Oliver Sander
Browse files

Use the correct type for number of rows/columns/nonzeros

parent 81455070
No related branches found
No related tags found
No related merge requests found
......@@ -341,8 +341,8 @@ public:
void setMatrix(const Matrix& matrix, const Ignore* ignore)
{
// count the number of entries and diagonal entries
int nonZeros = 0;
int numberOfIgnoredDofs = 0;
size_t nonZeros = 0;
size_t numberOfIgnoredDofs = 0;
auto [flatRows,flatCols] = flatMatrixForEach( matrix, [&](auto&& /*entry*/, auto&& flatRowIndex, auto&& flatColIndex){
......@@ -358,16 +358,16 @@ public:
numberOfIgnoredDofs = std::count(flatIgnore.begin(),flatIgnore.end(),true);
}
// Total number of rows
int N = flatRows - numberOfIgnoredDofs;
nIsZero_ = (N <= 0);
nIsZero_ = (size_t(flatRows) <= numberOfIgnoredDofs);
if ( nIsZero_ )
{
return;
}
// Total number of rows
size_t N = flatRows - numberOfIgnoredDofs;
/*
* CHOLMOD uses compressed-column sparse matrices, but for symmetric
* matrices this is the same as the compressed-row sparse matrix used
......@@ -429,7 +429,7 @@ public:
// now accumulate
Ap[0] = 0;
for ( int i=0; i<N; i++ )
for ( size_t i=0; i<N; i++ )
{
Ap[i+1] += Ap[i];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment