fix ParCSRDiagScaleVector (#752)

This PR fixed a check in ParCSRDiagScaleVector.
This commit is contained in:
Rui Peng Li 2022-10-12 14:37:35 -07:00 committed by GitHub
parent 1664a340f8
commit 50de6a4756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6420,13 +6420,13 @@ hypre_ParCSRDiagScaleVector( hypre_ParCSRMatrix *par_A,
return hypre_error_flag;
}
if (x_vecstride <= 0)
if (x_size > 0 && x_vecstride <= 0)
{
hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! non-positive x vector stride!\n");
return hypre_error_flag;
}
if (y_vecstride <= 0)
if (y_size > 0 && y_vecstride <= 0)
{
hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Error! non-positive y vector stride!\n");
return hypre_error_flag;