Skip to content
Snippets Groups Projects
Commit 3247ca34 authored by Lukas Cejka's avatar Lukas Cejka Committed by Tomáš Oberhuber
Browse files

Added checking for negative number of elements

parent 61ce1e68
No related branches found
No related tags found
1 merge request!45Matrices revision
......@@ -813,6 +813,11 @@ template< typename Real,
typename Index >
void EllpackSymmetricGraph< Real, Device, Index >::allocateElements()
{
IndexType numberOfMatrixElements = this->alignedRows * this->rowLengths;
TNL_ASSERT_TRUE( this->alignedRows != 0 && numberOfMatrixElements / this->alignedRows == this->rowLengths,
"Ellpack cannot store this matrix. The number of matrix elements has overflown the value that IndexType is capable of storing" );
Sparse< Real, Device, Index >::allocateMatrixElements( this->alignedRows * this->rowLengths );
}
......
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