From 674797efb34f38e8e68e8e39257b8a4cbd3c069c Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Sat, 28 Sep 2013 22:53:00 +0200 Subject: [PATCH] array: add a contructor for reshaping temporary - add a constructor from indexmap and storage &&, - used when reshaping a temp. array. --- triqs/arrays/array.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/triqs/arrays/array.hpp b/triqs/arrays/array.hpp index 8c297a87..4e174a48 100644 --- a/triqs/arrays/array.hpp +++ b/triqs/arrays/array.hpp @@ -133,6 +133,11 @@ namespace triqs { namespace arrays { // Move explicit array(array && X) { this->swap_me(X); } + // from a temporary storage and an indexmap. Used for reshaping a temporary array + explicit array(typename indexmap_type::domain_type const & dom, storage_type && sto, + memory_layout ml = memory_layout(IMPL_TYPE::indexmap_type::traversal_order)): + IMPL_TYPE(indexmap_type(dom,ml), std::move(sto)){} + /** * Build a new array from X.domain() and fill it with by evaluating X. X can be : * - another type of array, array_view, matrix,.... (any pair)