Commit 34243643 authored by Jens Petit's avatar Jens Petit
Browse files

Extend draft to Operators

parent 13011618
Pipeline #211226 failed with stages
in 25 seconds
...@@ -37,9 +37,9 @@ endif() ...@@ -37,9 +37,9 @@ endif()
# add the elsa modules # add the elsa modules
add_subdirectory(core) add_subdirectory(core)
#add_subdirectory(logging) add_subdirectory(logging)
#add_subdirectory(io) add_subdirectory(io)
#add_subdirectory(operators) add_subdirectory(operators)
#add_subdirectory(functionals) #add_subdirectory(functionals)
#add_subdirectory(problems) #add_subdirectory(problems)
#add_subdirectory(solvers) #add_subdirectory(solvers)
......
...@@ -45,7 +45,8 @@ namespace elsa ...@@ -45,7 +45,8 @@ namespace elsa
} }
template <> template <>
DataContainer<float, 0>::DataContainer(const DataDescriptor& dataDescriptor, const Eigen::Matrix<float, Eigen::Dynamic, 1>& data) DataContainer<float, 0>::DataContainer(const DataDescriptor& dataDescriptor,
const Eigen::Matrix<float, Eigen::Dynamic, 1>& data)
: _dataDescriptor{dataDescriptor.clone()}, : _dataDescriptor{dataDescriptor.clone()},
_dataHandler{_dataDescriptor->getNumberOfCoefficients()} _dataHandler{_dataDescriptor->getNumberOfCoefficients()}
{ {
...@@ -57,7 +58,8 @@ namespace elsa ...@@ -57,7 +58,8 @@ namespace elsa
} }
template <> template <>
DataContainer<double, 0>::DataContainer(const DataDescriptor& dataDescriptor, const Eigen::Matrix<double, Eigen::Dynamic, 1>& data) DataContainer<double, 0>::DataContainer(const DataDescriptor& dataDescriptor,
const Eigen::Matrix<double, Eigen::Dynamic, 1>& data)
: _dataDescriptor{dataDescriptor.clone()}, : _dataDescriptor{dataDescriptor.clone()},
_dataHandler{_dataDescriptor->getNumberOfCoefficients()} _dataHandler{_dataDescriptor->getNumberOfCoefficients()}
{ {
...@@ -69,7 +71,9 @@ namespace elsa ...@@ -69,7 +71,9 @@ namespace elsa
} }
template <> template <>
DataContainer<std::complex<float>, 0>::DataContainer(const DataDescriptor& dataDescriptor, const Eigen::Matrix<std::complex<float>, Eigen::Dynamic, 1>& data) DataContainer<std::complex<float>, 0>::DataContainer(
const DataDescriptor& dataDescriptor,
const Eigen::Matrix<std::complex<float>, Eigen::Dynamic, 1>& data)
: _dataDescriptor{dataDescriptor.clone()}, : _dataDescriptor{dataDescriptor.clone()},
_dataHandler{_dataDescriptor->getNumberOfCoefficients()} _dataHandler{_dataDescriptor->getNumberOfCoefficients()}
{ {
...@@ -81,7 +85,9 @@ namespace elsa ...@@ -81,7 +85,9 @@ namespace elsa
} }
template <> template <>
DataContainer<std::complex<double>, 0>::DataContainer(const DataDescriptor& dataDescriptor, const Eigen::Matrix<std::complex<double>, Eigen::Dynamic, 1>& data) DataContainer<std::complex<double>, 0>::DataContainer(
const DataDescriptor& dataDescriptor,
const Eigen::Matrix<std::complex<double>, Eigen::Dynamic, 1>& data)
: _dataDescriptor{dataDescriptor.clone()}, : _dataDescriptor{dataDescriptor.clone()},
_dataHandler{_dataDescriptor->getNumberOfCoefficients()} _dataHandler{_dataDescriptor->getNumberOfCoefficients()}
{ {
...@@ -93,7 +99,8 @@ namespace elsa ...@@ -93,7 +99,8 @@ namespace elsa
} }
template <> template <>
DataContainer<index_t, 0>::DataContainer(const DataDescriptor& dataDescriptor, const Eigen::Matrix<index_t, Eigen::Dynamic, 1>& data) DataContainer<index_t, 0>::DataContainer(const DataDescriptor& dataDescriptor,
const Eigen::Matrix<index_t, Eigen::Dynamic, 1>& data)
: _dataDescriptor{dataDescriptor.clone()}, : _dataDescriptor{dataDescriptor.clone()},
_dataHandler{_dataDescriptor->getNumberOfCoefficients()} _dataHandler{_dataDescriptor->getNumberOfCoefficients()}
{ {
...@@ -106,13 +113,13 @@ namespace elsa ...@@ -106,13 +113,13 @@ namespace elsa
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
DataContainer<data_t, handler_t>::DataContainer(const DataContainer_t& other) DataContainer<data_t, handler_t>::DataContainer(const DataContainer_t& other)
: _dataDescriptor{other._dataDescriptor->clone()}, : _dataDescriptor{other._dataDescriptor->clone()}, _dataHandler{other._dataHandler}
_dataHandler{other._dataHandler}
{ {
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
DataContainer<data_t, handler_t>& DataContainer<data_t, handler_t>::operator=(const DataContainer<data_t, handler_t>& other) DataContainer<data_t, handler_t>& DataContainer<data_t, handler_t>::
operator=(const DataContainer<data_t, handler_t>& other)
{ {
if (this != &other) { if (this != &other) {
_dataDescriptor = other._dataDescriptor->clone(); _dataDescriptor = other._dataDescriptor->clone();
...@@ -132,7 +139,8 @@ namespace elsa ...@@ -132,7 +139,8 @@ namespace elsa
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
DataContainer<data_t, handler_t>& DataContainer<data_t, handler_t>::operator=(DataContainer_t&& other) DataContainer<data_t, handler_t>& DataContainer<data_t, handler_t>::
operator=(DataContainer_t&& other)
{ {
_dataDescriptor = std::move(other._dataDescriptor); _dataDescriptor = std::move(other._dataDescriptor);
_dataHandler = std::move(other._dataHandler); _dataHandler = std::move(other._dataHandler);
...@@ -181,8 +189,7 @@ namespace elsa ...@@ -181,8 +189,7 @@ namespace elsa
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
data_t data_t DataContainer<data_t, handler_t>::dot(const DataContainer_t& other) const
DataContainer<data_t, handler_t>::dot(const DataContainer_t& other) const
{ {
return _dataHandler.dot(other._dataHandler); return _dataHandler.dot(other._dataHandler);
} }
...@@ -279,33 +286,42 @@ namespace elsa ...@@ -279,33 +286,42 @@ namespace elsa
} }
template <> template <>
DataContainer<float, DataHandlerType::MAP_CPU>::DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<float> dataHandler) DataContainer<float, DataHandlerType::MAP_CPU>::DataContainer(
: _dataDescriptor{dataDescriptor.clone()}, const DataDescriptor& dataDescriptor, DataHandlerMapCPU<float> dataHandler)
_dataHandler{std::move(dataHandler)} {} : _dataDescriptor{dataDescriptor.clone()}, _dataHandler{std::move(dataHandler)}
{
}
template <> template <>
DataContainer<std::complex<double>, DataHandlerType::MAP_CPU>::DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<std::complex<double>> dataHandler) DataContainer<std::complex<double>, DataHandlerType::MAP_CPU>::DataContainer(
: _dataDescriptor{dataDescriptor.clone()}, const DataDescriptor& dataDescriptor, DataHandlerMapCPU<std::complex<double>> dataHandler)
_dataHandler{std::move(dataHandler)} {} : _dataDescriptor{dataDescriptor.clone()}, _dataHandler{std::move(dataHandler)}
{
}
template <> template <>
DataContainer<std::complex<float>, DataHandlerType::MAP_CPU>::DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<std::complex<float>> dataHandler) DataContainer<std::complex<float>, DataHandlerType::MAP_CPU>::DataContainer(
: _dataDescriptor{dataDescriptor.clone()}, const DataDescriptor& dataDescriptor, DataHandlerMapCPU<std::complex<float>> dataHandler)
_dataHandler{std::move(dataHandler)} {} : _dataDescriptor{dataDescriptor.clone()}, _dataHandler{std::move(dataHandler)}
{
}
template <> template <>
DataContainer<index_t, DataHandlerType::MAP_CPU>::DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<index_t> dataHandler) DataContainer<index_t, DataHandlerType::MAP_CPU>::DataContainer(
: _dataDescriptor{dataDescriptor.clone()}, const DataDescriptor& dataDescriptor, DataHandlerMapCPU<index_t> dataHandler)
_dataHandler{std::move(dataHandler)} {} : _dataDescriptor{dataDescriptor.clone()}, _dataHandler{std::move(dataHandler)}
{
}
template <> template <>
DataContainer<double, DataHandlerType::MAP_CPU>::DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<double> dataHandler) DataContainer<double, DataHandlerType::MAP_CPU>::DataContainer(
: _dataDescriptor{dataDescriptor.clone()}, const DataDescriptor& dataDescriptor, DataHandlerMapCPU<double> dataHandler)
_dataHandler{std::move(dataHandler)} {} : _dataDescriptor{dataDescriptor.clone()}, _dataHandler{std::move(dataHandler)}
{
}
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
bool DataContainer<data_t, handler_t>:: bool DataContainer<data_t, handler_t>::operator==(const DataContainer_t& other) const
operator==(const DataContainer_t& other) const
{ {
if (*_dataDescriptor != *other._dataDescriptor) if (*_dataDescriptor != *other._dataDescriptor)
return false; return false;
...@@ -317,14 +333,14 @@ namespace elsa ...@@ -317,14 +333,14 @@ namespace elsa
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
bool DataContainer<data_t, handler_t>:: bool DataContainer<data_t, handler_t>::operator!=(const DataContainer_t& other) const
operator!=(const DataContainer_t& other) const
{ {
return !(*this == other); return !(*this == other);
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
DataContainer<data_t, DataHandlerType::MAP_CPU> DataContainer<data_t, handler_t>::getBlock(index_t i) DataContainer<data_t, DataHandlerType::MAP_CPU>
DataContainer<data_t, handler_t>::getBlock(index_t i)
{ {
const auto blockDesc = dynamic_cast<const BlockDescriptor*>(_dataDescriptor.get()); const auto blockDesc = dynamic_cast<const BlockDescriptor*>(_dataDescriptor.get());
if (!blockDesc) if (!blockDesc)
...@@ -337,7 +353,8 @@ namespace elsa ...@@ -337,7 +353,8 @@ namespace elsa
const auto& ithDesc = blockDesc->getDescriptorOfBlock(i); const auto& ithDesc = blockDesc->getDescriptorOfBlock(i);
index_t blockSize = ithDesc.getNumberOfCoefficients(); index_t blockSize = ithDesc.getNumberOfCoefficients();
return DataContainer<data_t, DataHandlerType::MAP_CPU>{ithDesc, _dataHandler.getBlock(startIndex, blockSize)}; return DataContainer<data_t, DataHandlerType::MAP_CPU>{
ithDesc, _dataHandler.getBlock(startIndex, blockSize)};
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
...@@ -368,8 +385,8 @@ namespace elsa ...@@ -368,8 +385,8 @@ namespace elsa
if (dataDescriptor.getNumberOfCoefficients() != getSize()) if (dataDescriptor.getNumberOfCoefficients() != getSize())
throw std::invalid_argument("DataContainer: view must have same size as container"); throw std::invalid_argument("DataContainer: view must have same size as container");
return DataContainer<data_t, DataHandlerType::MAP_CPU>{ return DataContainer<data_t, DataHandlerType::MAP_CPU>{dataDescriptor,
dataDescriptor, _dataHandler.getBlock(0, getSize())}; _dataHandler.getBlock(0, getSize())};
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
...@@ -381,7 +398,8 @@ namespace elsa ...@@ -381,7 +398,8 @@ namespace elsa
// getBlock() returns a pointer to non-const DH, but that's fine as it gets wrapped in a // getBlock() returns a pointer to non-const DH, but that's fine as it gets wrapped in a
// constant container // constant container
return DataContainer<data_t, DataHandlerType::MAP_CPU>{ dataDescriptor, _dataHandler.getBlock(0, getSize())}; return DataContainer<data_t, DataHandlerType::MAP_CPU>{dataDescriptor,
_dataHandler.getBlock(0, getSize())};
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
...@@ -391,13 +409,15 @@ namespace elsa ...@@ -391,13 +409,15 @@ namespace elsa
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_iterator DataContainer<data_t, handler_t>::begin() const typename DataContainer<data_t, handler_t>::const_iterator
DataContainer<data_t, handler_t>::begin() const
{ {
return cbegin(); return cbegin();
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_iterator DataContainer<data_t, handler_t>::cbegin() const typename DataContainer<data_t, handler_t>::const_iterator
DataContainer<data_t, handler_t>::cbegin() const
{ {
return const_iterator(&(*this)[0]); return const_iterator(&(*this)[0]);
} }
...@@ -409,54 +429,63 @@ namespace elsa ...@@ -409,54 +429,63 @@ namespace elsa
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_iterator DataContainer<data_t, handler_t>::end() const typename DataContainer<data_t, handler_t>::const_iterator
DataContainer<data_t, handler_t>::end() const
{ {
return cend(); return cend();
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_iterator DataContainer<data_t, handler_t>::cend() const typename DataContainer<data_t, handler_t>::const_iterator
DataContainer<data_t, handler_t>::cend() const
{ {
return const_iterator(&(*this)[0] + getSize()); return const_iterator(&(*this)[0] + getSize());
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::reverse_iterator DataContainer<data_t, handler_t>::rbegin() typename DataContainer<data_t, handler_t>::reverse_iterator
DataContainer<data_t, handler_t>::rbegin()
{ {
return reverse_iterator(end()); return reverse_iterator(end());
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_reverse_iterator DataContainer<data_t, handler_t>::rbegin() const typename DataContainer<data_t, handler_t>::const_reverse_iterator
DataContainer<data_t, handler_t>::rbegin() const
{ {
return crbegin(); return crbegin();
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_reverse_iterator DataContainer<data_t, handler_t>::crbegin() const typename DataContainer<data_t, handler_t>::const_reverse_iterator
DataContainer<data_t, handler_t>::crbegin() const
{ {
return const_reverse_iterator(cend()); return const_reverse_iterator(cend());
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::reverse_iterator DataContainer<data_t, handler_t>::rend() typename DataContainer<data_t, handler_t>::reverse_iterator
DataContainer<data_t, handler_t>::rend()
{ {
return reverse_iterator(begin()); return reverse_iterator(begin());
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_reverse_iterator DataContainer<data_t, handler_t>::rend() const typename DataContainer<data_t, handler_t>::const_reverse_iterator
DataContainer<data_t, handler_t>::rend() const
{ {
return crend(); return crend();
} }
template <typename data_t, int handler_t> template <typename data_t, int handler_t>
typename DataContainer<data_t, handler_t>::const_reverse_iterator DataContainer<data_t, handler_t>::crend() const typename DataContainer<data_t, handler_t>::const_reverse_iterator
DataContainer<data_t, handler_t>::crend() const
{ {
return const_reverse_iterator(cbegin()); return const_reverse_iterator(cbegin());
} }
template <typename data_t, int handler_t> DataHandlerType DataContainer<data_t, handler_t>::getDataHandlerType() const template <typename data_t, int handler_t>
DataHandlerType DataContainer<data_t, handler_t>::getDataHandlerType() const
{ {
return DataHandlerType(handler_t); return DataHandlerType(handler_t);
} }
......
...@@ -257,10 +257,12 @@ namespace elsa ...@@ -257,10 +257,12 @@ namespace elsa
const DataContainer<data_t, DataHandlerType::MAP_CPU> getBlock(index_t i) const; const DataContainer<data_t, DataHandlerType::MAP_CPU> getBlock(index_t i) const;
/// return a view of this DataContainer with a different descriptor /// return a view of this DataContainer with a different descriptor
DataContainer<data_t, DataHandlerType::MAP_CPU> viewAs(const DataDescriptor& dataDescriptor); DataContainer<data_t, DataHandlerType::MAP_CPU>
viewAs(const DataDescriptor& dataDescriptor);
/// return a const view of this DataContainer with a different descriptor /// return a const view of this DataContainer with a different descriptor
const DataContainer<data_t, DataHandlerType::MAP_CPU> viewAs(const DataDescriptor& dataDescriptor) const; const DataContainer<data_t, DataHandlerType::MAP_CPU>
viewAs(const DataDescriptor& dataDescriptor) const;
/// iterator for DataContainer (random access and continuous) /// iterator for DataContainer (random access and continuous)
using iterator = DataContainerIterator<DataContainer_t>; using iterator = DataContainerIterator<DataContainer_t>;
...@@ -336,7 +338,8 @@ namespace elsa ...@@ -336,7 +338,8 @@ namespace elsa
friend constexpr auto evaluateOrReturn(Operand const& operand); friend constexpr auto evaluateOrReturn(Operand const& operand);
/// private constructor accepting a DataDescriptor and a DataHandler /// private constructor accepting a DataDescriptor and a DataHandler
explicit DataContainer(const DataDescriptor& dataDescriptor, DataHandlerMapCPU<data_t> dataHandler); explicit DataContainer(const DataDescriptor& dataDescriptor,
DataHandlerMapCPU<data_t> dataHandler);
private: private:
/// the current DataDescriptor /// the current DataDescriptor
...@@ -344,7 +347,8 @@ namespace elsa ...@@ -344,7 +347,8 @@ namespace elsa
/// the current DataHandler /// the current DataHandler
std::conditional_t<(handler_t == DataHandlerType::MAP_CPU), DataHandlerMapCPU<data_t>, std::conditional_t<(handler_t == DataHandlerType::MAP_CPU), DataHandlerMapCPU<data_t>,
DataHandlerCPU<data_t>> _dataHandler; DataHandlerCPU<data_t>>
_dataHandler;
}; };
/// User-defined template argument deduction guide for the expression based constructor /// User-defined template argument deduction guide for the expression based constructor
......
...@@ -45,12 +45,9 @@ namespace elsa ...@@ -45,12 +45,9 @@ namespace elsa
using DataMap_t = Eigen::Map<DataVector_t>; using DataMap_t = Eigen::Map<DataVector_t>;
public: public:
virtual bool operator==(DataHandler const& other) const = 0; virtual bool operator==(DataHandler const& other) const = 0;
bool operator!=(DataHandler const& other) const { bool operator!=(DataHandler const& other) const { return !this->operator==(other); }
return !this->operator==(other);
}
/// convenience typedef to access data type that is internally stored /// convenience typedef to access data type that is internally stored
using value_type = data_t; using value_type = data_t;
...@@ -128,11 +125,12 @@ namespace elsa ...@@ -128,11 +125,12 @@ namespace elsa
/// return a reference to the sequential block starting at startIndex and containing /// return a reference to the sequential block starting at startIndex and containing
/// numberOfElements elements /// numberOfElements elements
///virtual DataHandlerMapCPU<data_t> getBlock(index_t startIndex, /// virtual DataHandlerMapCPU<data_t> getBlock(index_t startIndex,
/// return a const reference to the sequential block starting at startIndex and containing /// return a const reference to the sequential block starting at startIndex and containing
/// numberOfElements elements /// numberOfElements elements
///virtual const DataHandlerMapCPU<data_t> getBlock(index_t startIndex, index_t numberOfElements) const = 0; /// virtual const DataHandlerMapCPU<data_t> getBlock(index_t startIndex, index_t
/// numberOfElements) const = 0;
protected: protected:
/// slow element-wise dot product fall-back for when DataHandler types do not match /// slow element-wise dot product fall-back for when DataHandler types do not match
......
...@@ -248,7 +248,7 @@ namespace elsa ...@@ -248,7 +248,7 @@ namespace elsa
template <typename data_t> template <typename data_t>
DataHandlerMapCPU<data_t> DataHandlerCPU<data_t>::getBlock(index_t startIndex, DataHandlerMapCPU<data_t> DataHandlerCPU<data_t>::getBlock(index_t startIndex,
index_t numberOfElements) index_t numberOfElements)
{ {
if (startIndex >= getSize() || numberOfElements > getSize() - startIndex) if (startIndex >= getSize() || numberOfElements > getSize() - startIndex)
throw std::invalid_argument("DataHandler: requested block out of bounds"); throw std::invalid_argument("DataHandler: requested block out of bounds");
...@@ -257,8 +257,8 @@ namespace elsa ...@@ -257,8 +257,8 @@ namespace elsa
} }
template <typename data_t> template <typename data_t>
const DataHandlerMapCPU<data_t> const DataHandlerMapCPU<data_t> DataHandlerCPU<data_t>::getBlock(index_t startIndex,
DataHandlerCPU<data_t>::getBlock(index_t startIndex, index_t numberOfElements) const index_t numberOfElements) const
{ {
if (startIndex >= getSize() || numberOfElements > getSize() - startIndex) if (startIndex >= getSize() || numberOfElements > getSize() - startIndex)
throw std::invalid_argument("DataHandler: requested block out of bounds"); throw std::invalid_argument("DataHandler: requested block out of bounds");
......
...@@ -58,7 +58,6 @@ namespace elsa ...@@ -58,7 +58,6 @@ namespace elsa
friend DataContainer<data_t, 1>; friend DataContainer<data_t, 1>;
friend DataContainer<data_t, 2>; friend DataContainer<data_t, 2>;
protected: protected:
/// convenience typedef for the Eigen::Matrix data vector /// convenience typedef for the Eigen::Matrix data vector
using DataVector_t = Eigen::Matrix<data_t, Eigen::Dynamic, 1>; using DataVector_t = Eigen::Matrix<data_t, Eigen::Dynamic, 1>;
...@@ -163,10 +162,12 @@ namespace elsa ...@@ -163,10 +162,12 @@ namespace elsa
/// return a const reference to the sequential block starting at startIndex and containing /// return a const reference to the sequential block starting at startIndex and containing
/// numberOfElements elements /// numberOfElements elements
const DataHandlerMapCPU<data_t> getBlock(index_t startIndex, index_t numberOfElements) const; const DataHandlerMapCPU<data_t> getBlock(index_t startIndex,
index_t numberOfElements) const;
/// implement the polymorphic comparison operation /// implement the polymorphic comparison operation
bool operator==(DataHandler<data_t> const& other) const override; bool operator==(DataHandler<data_t> const& other) const override;
protected: protected:
/// the vector storing the data /// the vector storing the data
std::shared_ptr<DataVector_t> _data; std::shared_ptr<DataVector_t> _data;
......
...@@ -242,8 +242,8 @@ namespace elsa ...@@ -242,8 +242,8 @@ namespace elsa
} }
template <typename data_t> template <typename data_t>
DataHandlerMapCPU<data_t> DataHandlerMapCPU<data_t> DataHandlerMapCPU<data_t>::getBlock(index_t startIndex,
DataHandlerMapCPU<data_t>::getBlock(index_t startIndex, index_t numberOfElements) index_t numberOfElements)
{ {
if (startIndex >= getSize() || numberOfElements > getSize() - startIndex) if (startIndex >= getSize() || numberOfElements > getSize() - startIndex)
throw std::invalid_argument("DataHandler: requested block out of bounds"); throw std::invalid_argument("DataHandler: requested block out of bounds");
...@@ -252,7 +252,8 @@ namespace elsa ...@@ -252,7 +252,8 @@ namespace elsa
} }
template <typename data_t> template <typename data_t>
const DataHandlerMapCPU<data_t> DataHandlerMapCPU<data_t>::getBlock(index_t startIndex, index_t numberOfElements) const const DataHandlerMapCPU<data_t>
DataHandlerMapCPU<data_t>::getBlock(index_t startIndex, index_t numberOfElements) const
{ {
if (startIndex >= getSize() || numberOfElements > getSize() - startIndex)