@@ -226,6 +226,14 @@ namespace xt
226
226
std::size_t pool_size = 1 ,
227
227
layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
228
228
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
+
229
237
/* *
230
238
* Creates a chunked file array.
231
239
* This function returns an uninitialized ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>``.
@@ -254,6 +262,15 @@ namespace xt
254
262
std::size_t pool_size = 1 ,
255
263
layout_type chunk_memory_layout = XTENSOR_DEFAULT_LAYOUT);
256
264
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
+
257
274
/* *
258
275
* Creates a chunked file array.
259
276
* This function returns a ``xchunked_array<xchunk_store_manager<xfile_array<T, IOH>>>`` initialized from an expression.
@@ -367,13 +384,33 @@ namespace xt
367
384
368
385
template <class T , class IOH , layout_type L, class IP , class EXT , class S >
369
386
inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L>, IP>, EXT>
370
- 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)
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
+ auto sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(shape);
391
+ auto ch_sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(chunk_shape);
392
+ return chunked_file_array<T, IOH, L, IP, EXT, sh_type>(std::move (sh), std::move (ch_sh), path, pool_size, chunk_memory_layout);
393
+ }
394
+
395
+ template <class T , class IOH , layout_type L, class IP , class EXT , class S >
396
+ inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L>, IP>, EXT>
397
+ 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)
371
398
{
372
399
using chunk_storage = xchunk_store_manager<xfile_array<T, IOH, L>, IP>;
373
400
chunk_storage chunks (shape, chunk_shape, path, pool_size, init_value, chunk_memory_layout);
374
401
return xchunked_array<chunk_storage, EXT>(std::move (chunks), std::forward<S>(shape), std::forward<S>(chunk_shape));
375
402
}
376
403
404
+ template <class T , class IOH , layout_type L, class IP , class EXT , class S >
405
+ inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH, L>, IP>, EXT>
406
+ 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)
407
+ {
408
+ using sh_type = std::vector<std::size_t >;
409
+ auto sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(shape);
410
+ auto ch_sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(chunk_shape);
411
+ return chunked_file_array<T, IOH, L, IP, EXT, sh_type>(std::move (sh), std::move (ch_sh), path, init_value, pool_size, chunk_memory_layout);
412
+ }
413
+
377
414
template <class IOH , layout_type L, class IP , class EXT , class E , class S >
378
415
inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH, L>, IP>, EXT>
379
416
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