mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
[bugfix] Prevent indexing an array of zero size for matrices with zero rows.
This commit is contained in:
@@ -85,6 +85,13 @@ namespace Opm
|
|||||||
template<class M, class CRS, class InvVector>
|
template<class M, class CRS, class InvVector>
|
||||||
void convertToCRS(const M& A, CRS& lower, CRS& upper, InvVector& inv )
|
void convertToCRS(const M& A, CRS& lower, CRS& upper, InvVector& inv )
|
||||||
{
|
{
|
||||||
|
// No need to do anything for 0 rows. Return to prevent indexing a
|
||||||
|
// a zero sized array.
|
||||||
|
if ( A.N() == 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
typedef typename M :: size_type size_type;
|
typedef typename M :: size_type size_type;
|
||||||
|
|
||||||
lower.resize( A.N() );
|
lower.resize( A.N() );
|
||||||
|
|||||||
Reference in New Issue
Block a user