Commit 0347810b authored by David Frank's avatar David Frank Committed by Tobias Lasser
Browse files

change type of _indexMap in PartitionDescriptor to fix issue with older Eigen versions

parent 295a1d54
Pipeline #210705 passed with stages
in 23 minutes and 28 seconds
#include "PartitionDescriptor.h" #include "PartitionDescriptor.h"
#include <map> #include <unordered_map>
namespace elsa namespace elsa
{ {
...@@ -58,7 +58,7 @@ namespace elsa ...@@ -58,7 +58,7 @@ namespace elsa
throw std::invalid_argument("PartitionDescriptor: cumulative size of partitioned " throw std::invalid_argument("PartitionDescriptor: cumulative size of partitioned "
"descriptor does not match size of original descriptor"); "descriptor does not match size of original descriptor");
std::map<index_t, std::size_t> sizeToIndex; std::unordered_map<index_t, index_t> sizeToIndex;
_blockOffsets[0] = 0; _blockOffsets[0] = 0;
for (index_t i = 0; i < getNumberOfBlocks(); i++) { for (index_t i = 0; i < getNumberOfBlocks(); i++) {
auto it = sizeToIndex.find(slicesInBlock[i]); auto it = sizeToIndex.find(slicesInBlock[i]);
...@@ -127,4 +127,4 @@ namespace elsa ...@@ -127,4 +127,4 @@ namespace elsa
coeffsPerDim[_numberOfDimensions - 1] = numberOfSlices; coeffsPerDim[_numberOfDimensions - 1] = numberOfSlices;
return std::make_unique<DataDescriptor>(coeffsPerDim, getSpacingPerDimension()); return std::make_unique<DataDescriptor>(coeffsPerDim, getSpacingPerDimension());
} }
} // namespace elsa } // namespace elsa
\ No newline at end of file
#include "BlockDescriptor.h" #include "BlockDescriptor.h"
namespace elsa namespace elsa
{ {
/** /**
...@@ -67,7 +66,7 @@ namespace elsa ...@@ -67,7 +66,7 @@ namespace elsa
protected: protected:
/// maps a block index to the index of the corresponding descriptor in _blockDescriptors /// maps a block index to the index of the corresponding descriptor in _blockDescriptors
Eigen::VectorX<std::size_t> _indexMap; IndexVector_t _indexMap;
/// vector of unique DataDescriptors describing the individual blocks /// vector of unique DataDescriptors describing the individual blocks
std::vector<std::unique_ptr<DataDescriptor>> _blockDescriptors; std::vector<std::unique_ptr<DataDescriptor>> _blockDescriptors;
...@@ -88,4 +87,4 @@ namespace elsa ...@@ -88,4 +87,4 @@ namespace elsa
/// generates the descriptor of a partition containing numberOfSlices slices /// generates the descriptor of a partition containing numberOfSlices slices
std::unique_ptr<DataDescriptor> generateDescriptorOfPartition(index_t numberOfSlices) const; std::unique_ptr<DataDescriptor> generateDescriptorOfPartition(index_t numberOfSlices) const;
}; };
} // namespace elsa } // namespace elsa
\ No newline at end of file
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