@@ -226,6 +226,14 @@ namespace xt
226226 std::size_t pool_size = 1 ,
227227 layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
228228
229+ template <class T , class IOH , layout_type L = XTENSOR_DEFAULT_LAYOUT , class IP = xindex_path, class EXT = empty_extension, class S >
230+ xchunked_array<xchunk_store_manager<xfile_array<T, IOH , L>, IP >, EXT >
231+ chunked_file_array (std::initializer_list<S> shape,
232+ std::initializer_list<S> chunk_shape,
233+ const std::string& path,
234+ std::size_t pool_size = 1 ,
235+ layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
236+
229237 /* *
230238 * Creates a chunked file array.
231239 * This function returns an uninitialized ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>``.
@@ -254,6 +262,15 @@ namespace xt
254262 std::size_t pool_size = 1 ,
255263 layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
256264
265+ template <class T , class IOH , layout_type L = XTENSOR_DEFAULT_LAYOUT , class IP = xindex_path, class EXT = empty_extension, class S >
266+ xchunked_array<xchunk_store_manager<xfile_array<T, IOH , L>, IP >, EXT >
267+ chunked_file_array (std::initializer_list<S> shape,
268+ std::initializer_list<S> chunk_shape,
269+ const std::string& path,
270+ const T& init_value,
271+ std::size_t pool_size = 1 ,
272+ layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT );
273+
257274 /* *
258275 * Creates a chunked file array.
259276 * This function returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` initialized from an expression.
@@ -365,6 +382,20 @@ namespace xt
365382 return xchunked_array<chunk_storage, EXT >(std::move (chunks), std::forward<S>(shape), std::forward<S>(chunk_shape));
366383 }
367384
385+ template <class T , class IOH , layout_type L, class IP , class EXT , class S >
386+ inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH , L>, IP >, EXT >
387+ chunked_file_array (std::initializer_list<S> shape, std::initializer_list<S> chunk_shape, const std::string& path, std::size_t pool_size, layout_type chunk_memory_layout)
388+ {
389+ using sh_type = std::vector<std::size_t >;
390+ sh_type sh = xtl::make_sequence<sh_type>(shape.size ());
391+ std::copy (shape.begin (), shape.end (), sh.begin ());
392+ sh_type ch_sh = xtl::make_sequence<sh_type>(chunk_shape.size ());
393+ std::copy (chunk_shape.begin (), chunk_shape.end (), ch_sh.begin ());
394+ using chunk_storage = xchunk_store_manager<xfile_array<T, IOH , L>, IP >;
395+ chunk_storage chunks (sh, ch_sh, path, pool_size, chunk_memory_layout);
396+ return xchunked_array<chunk_storage, EXT >(std::move (chunks), std::move (sh), std::move (ch_sh));
397+ }
398+
368399 template <class T , class IOH , layout_type L, class IP , class EXT , class S >
369400 inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH , L>, IP >, EXT >
370401 chunked_file_array (S&& shape, S&& chunk_shape, const std::string& path, const T& init_value,std::size_t pool_size, layout_type chunk_memory_layout)
@@ -374,6 +405,20 @@ namespace xt
374405 return xchunked_array<chunk_storage, EXT >(std::move (chunks), std::forward<S>(shape), std::forward<S>(chunk_shape));
375406 }
376407
408+ template <class T , class IOH , layout_type L, class IP , class EXT , class S >
409+ inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH , L>, IP >, EXT >
410+ chunked_file_array (std::initializer_list<S> shape, std::initializer_list<S> chunk_shape, const std::string& path, const T& init_value,std::size_t pool_size, layout_type chunk_memory_layout)
411+ {
412+ using sh_type = std::vector<std::size_t >;
413+ sh_type sh = xtl::make_sequence<sh_type>(shape.size ());
414+ std::copy (shape.begin (), shape.end (), sh.begin ());
415+ sh_type ch_sh = xtl::make_sequence<sh_type>(chunk_shape.size ());
416+ std::copy (chunk_shape.begin (), chunk_shape.end (), ch_sh.begin ());
417+ using chunk_storage = xchunk_store_manager<xfile_array<T, IOH , L>, IP >;
418+ chunk_storage chunks (sh, ch_sh, path, pool_size, init_value, chunk_memory_layout);
419+ return xchunked_array<chunk_storage, EXT >(std::move (chunks), std::move (sh), std::move (ch_sh));
420+ }
421+
377422 template <class IOH , layout_type L, class IP , class EXT , class E , class S >
378423 inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH , L>, IP >, EXT >
379424 chunked_file_array (const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size, layout_type chunk_memory_layout)
0 commit comments