Fix cell storage for tiny maps

This commit is contained in:
Michael Krasnyk 2017-03-11 09:25:13 +01:00
parent c648711f30
commit 81771a3bfd
No known key found for this signature in database
GPG Key ID: 49C12AD0F43D2108
2 changed files with 6 additions and 8 deletions

View File

@ -939,10 +939,6 @@ class ContiguousInternalMemoryAlgorithmDataFacade<algorithm::MLD>
if (data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_WEIGHTS) > 0)
{
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_SOURCE_BOUNDARY) >
0);
BOOST_ASSERT(
data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_DESTINATION_BOUNDARY) > 0);
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELLS) > 0);
BOOST_ASSERT(data_layout.GetBlockSize(storage::DataLayout::MLD_CELL_LEVEL_OFFSETS) > 0);

View File

@ -172,8 +172,8 @@ template <bool UseShareMemory> class CellStorageImpl
destination_boundary{all_destinations + data.destination_boundary_offset}
{
BOOST_ASSERT(all_weight != nullptr);
BOOST_ASSERT(all_sources != nullptr);
BOOST_ASSERT(all_destinations != nullptr);
BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr);
BOOST_ASSERT(num_destination_nodes == 0 || all_destinations != nullptr);
}
};
@ -333,8 +333,10 @@ template <bool UseShareMemory> class CellStorageImpl
const auto offset = level_to_cell_offset[level_index];
const auto cell_index = offset + id;
BOOST_ASSERT(cell_index < cells.size());
return ConstCell{
cells[cell_index], weights.data(), source_boundary.data(), destination_boundary.data()};
return ConstCell{cells[cell_index],
weights.data(),
source_boundary.empty() ? nullptr : source_boundary.data(),
destination_boundary.empty() ? nullptr : destination_boundary.data()};
}
template <typename = std::enable_if<!UseShareMemory>> Cell GetCell(LevelID level, CellID id)