Commit f2c25631 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 GlobalMatrix: broaden AssertMatrixRespectPattern() to allow empty lines.

parent 2b7fc640
......@@ -56,7 +56,7 @@ namespace HappyHeart
{
try
{
const auto Nrow = matrix.GetProcessorWiseSize(__FILE__, __LINE__).first;
const auto Nrow = matrix.GetProcessorWiseSize(invoking_file, invoking_line).first;
if (Nrow != static_cast<int>(pattern.Nrow()))
throw Exception("Number of rows in pattern and matrix is not the same!",
......@@ -75,7 +75,7 @@ namespace HappyHeart
std::vector<PetscInt> position_list_in_matrix;
std::vector<PetscScalar> value_list_in_matrix;
matrix.GetRow(i, position_list_in_matrix, value_list_in_matrix, __FILE__, __LINE__);
matrix.GetRow(i, position_list_in_matrix, value_list_in_matrix, invoking_file, invoking_line);
const auto Nvalue_in_pattern_row =
static_cast<std::size_t>(iCsr[static_cast<std::size_t>(i + 1)] - iCsr[static_cast<std::size_t>(i)]);
......
......@@ -421,12 +421,14 @@ namespace HappyHeart
if (error_code)
throw ExceptionNS::Exception(error_code, "MatGetRow", invoking_file, invoking_line);
assert((values == nullptr) == (columns == nullptr) && "If one is 0x0, the other should also be.");
const auto size = static_cast<std::size_t>(Nnon_zero_cols);
row_content_position_list.resize(size);
row_content_value_list.resize(size);
assert(values != nullptr);
for (auto i = 0ul; i < size; ++i)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment