|
4 | 4 | #include <vector> |
5 | 5 | #include <array> |
6 | 6 |
|
7 | | -#include "xarray.hpp" |
8 | | -#include "xcsv.hpp" |
9 | | -#include "xio.hpp" |
| 7 | +#include "xtensor/xarray.hpp" |
| 8 | +#include "xtensor/xchunked_array.hpp" |
| 9 | +#include "xfile_array.hpp" |
10 | 10 |
|
11 | 11 | namespace xt |
12 | 12 | { |
@@ -138,6 +138,45 @@ namespace xt |
138 | 138 | IP m_index_path; |
139 | 139 | }; |
140 | 140 |
|
| 141 | + template <class T, class IOH, class IP = xindex_path, class EXT = empty_extension, class S> |
| 142 | + xchunked_array<xchunk_store_manager<xfile_array<T, IOH>, IP>, EXT> |
| 143 | + chunked_file_array(S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1); |
| 144 | + |
| 145 | + template <class IOH, class IP = xindex_path, class EXT = empty_extension, class E, class S> |
| 146 | + xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT> |
| 147 | + chunked_file_array(const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size = 1); |
| 148 | + |
| 149 | + template <class IOH, class IP = xindex_path, class EXT = empty_extension, class E> |
| 150 | + xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT> |
| 151 | + chunked_file_array(const xexpression<E>& e, const std::string& path, std::size_t pool_size = 1); |
| 152 | + |
| 153 | + template <class T, class IOH, class IP, class EXT, class S> |
| 154 | + inline xchunked_array<xchunk_store_manager<xfile_array<T, IOH>, IP>, EXT> |
| 155 | + chunked_file_array(S&& shape, S&& chunk_shape, const std::string& path, std::size_t pool_size) |
| 156 | + { |
| 157 | + using chunk_storage = xchunk_store_manager<xfile_array<T, IOH>, IP>; |
| 158 | + chunk_storage chunks(shape, chunk_shape, path, pool_size); |
| 159 | + return xchunked_array<chunk_storage, EXT>(std::move(chunks), std::forward<S>(shape), std::forward<S>(chunk_shape)); |
| 160 | + } |
| 161 | + |
| 162 | + template <class IOH, class IP, class EXT, class E, class S> |
| 163 | + inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT> |
| 164 | + chunked_file_array(const xexpression<E>& e, S&& chunk_shape, const std::string& path, std::size_t pool_size) |
| 165 | + { |
| 166 | + using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>; |
| 167 | + chunk_storage chunks(e.derived_cast().shape(), chunk_shape, path, pool_size); |
| 168 | + return xchunked_array<chunk_storage, EXT>(e, chunk_storage(), std::forward<S>(chunk_shape)); |
| 169 | + } |
| 170 | + |
| 171 | + template <class IOH, class IP, class EXT, class E> |
| 172 | + inline xchunked_array<xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>, EXT> |
| 173 | + chunked_file_array(const xexpression<E>& e, const std::string& path, std::size_t pool_size) |
| 174 | + { |
| 175 | + using chunk_storage = xchunk_store_manager<xfile_array<typename E::value_type, IOH>, IP>; |
| 176 | + chunk_storage chunks(e.derived_cast().shape(), detail::chunk_helper<E>::chunk_shape(e), path, pool_size); |
| 177 | + return xchunked_array<chunk_storage, EXT>(e, chunk_storage()); |
| 178 | + } |
| 179 | + |
141 | 180 | /****************************** |
142 | 181 | * xindex_path implementation * |
143 | 182 | ******************************/ |
|
0 commit comments