From aa5cad36d346527f8f067cb1fd3cb8d642fec75f Mon Sep 17 00:00:00 2001 From: Ben Huber Date: Wed, 19 Jul 2017 16:21:02 +0200 Subject: [PATCH] fixed compilation with gcc 7.1 --- include/xerus/cholmod_wrapper.h | 1 + include/xerus/measurments.h | 1 + include/xerus/tensor.h | 11 ++++++----- include/xerus/tensorNetwork.h | 1 + src/xerus/tensor.cpp | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/xerus/cholmod_wrapper.h b/include/xerus/cholmod_wrapper.h index 8a6ddae..35afc89 100644 --- a/include/xerus/cholmod_wrapper.h +++ b/include/xerus/cholmod_wrapper.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/include/xerus/measurments.h b/include/xerus/measurments.h index d826784..685ff1f 100644 --- a/include/xerus/measurments.h +++ b/include/xerus/measurments.h @@ -26,6 +26,7 @@ #include #include +#include #include "basic.h" diff --git a/include/xerus/tensor.h b/include/xerus/tensor.h index dd0a5a2..11d1bb5 100644 --- a/include/xerus/tensor.h +++ b/include/xerus/tensor.h @@ -28,6 +28,7 @@ #include #include #include +#include #include "basic.h" #include "misc/containerSupport.h" @@ -159,7 +160,7 @@ namespace xerus { * @param _dimensions the dimensions of the new tensor. * @param _data inital dense data in row-major order. */ - explicit Tensor(DimensionTuple _dimensions, std::unique_ptr&& _data); + explicit Tensor(DimensionTuple _dimensions, std::unique_ptr&& _data); /** @@ -663,7 +664,7 @@ namespace xerus { /** * @brief Resets the tensor to the given dimensions and representation. * @details Leaves the Tensor in the same state as if newly constructed with the the same arguments. - * @param _dimensions the dimensions of the new tensor. + * @param _newDim the dimensions of the new tensor. * @param _representation the new representation of the tensor. * @param _init (optional) data treatment, i.e. whether the tensor shall be zero initialized. */ @@ -672,7 +673,7 @@ namespace xerus { /** * @brief Resets the tensor to the given dimensions, preserving the current representation. - * @param _dimensions the dimensions of the new tensor. + * @param _newDim the dimensions of the new tensor. * @param _init (optional) data treatment, i.e. whether the tensor shall be zero initialized. */ void reset(DimensionTuple _newDim, const Initialisation _init = Initialisation::Zero); @@ -685,7 +686,7 @@ namespace xerus { /** * @brief Resets the tensor to the given dimensions and uses the given data. - * @param _dimensions the dimensions of the new tensor. + * @param _newDim the dimensions of the new tensor. * @param _newData new dense data in row-major order. */ void reset(DimensionTuple _newDim, const std::shared_ptr& _newData); @@ -693,7 +694,7 @@ namespace xerus { /** * @brief Resets the tensor to the given dimensions with data @a _newData. - * @param _dimensions the dimensions of the new tensor. + * @param _newDim the dimensions of the new tensor. * @param _newData new dense data in row-major order. */ void reset(DimensionTuple _newDim, std::unique_ptr&& _newData); diff --git a/include/xerus/tensorNetwork.h b/include/xerus/tensorNetwork.h index bdab98f..eb6fdce 100644 --- a/include/xerus/tensorNetwork.h +++ b/include/xerus/tensorNetwork.h @@ -26,6 +26,7 @@ #include #include +#include #include "misc/fileIO.h" #include "indexedTensor.h" diff --git a/src/xerus/tensor.cpp b/src/xerus/tensor.cpp index 3afcf7b..343de9b 100644 --- a/src/xerus/tensor.cpp +++ b/src/xerus/tensor.cpp @@ -65,8 +65,8 @@ namespace xerus { } - Tensor::Tensor(DimensionTuple _dimensions, std::unique_ptr&& _data) - : dimensions(std::move(_dimensions)), size(misc::product(dimensions)), representation(Representation::Dense), denseData(std::move(_data)) { + Tensor::Tensor(DimensionTuple _dimensions, std::unique_ptr&& _data) + : dimensions(std::move(_dimensions)), size(misc::product(dimensions)), representation(Representation::Dense), denseData(_data.release()) { REQUIRE(size != 0, "May not create tensors with an dimension == 0."); } @@ -600,7 +600,7 @@ namespace xerus { representation = Representation::Dense; } - denseData = std::move(_newData); + denseData.reset(_newData.release()); } void Tensor::reset(DimensionTuple _newDim, std::map&& _newData) { -- GitLab