mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-13 07:47:13 +02:00
added tests and features to load full file
This commit is contained in:
@ -19,6 +19,7 @@ enum class endian {
|
||||
};
|
||||
|
||||
class DType {
|
||||
//TODO! support for non native endianess?
|
||||
static_assert(sizeof(long) == sizeof(int64_t), "long should be 64bits");
|
||||
|
||||
public:
|
||||
|
@ -5,11 +5,22 @@
|
||||
#include <cstdint>
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace aare {
|
||||
|
||||
template <ssize_t Ndim> using Shape = std::array<ssize_t, Ndim>;
|
||||
|
||||
//TODO! fix mismatch between signed and unsigned
|
||||
template <ssize_t Ndim>
|
||||
Shape<Ndim> make_shape(const std::vector<size_t>& shape){
|
||||
if(shape.size() != Ndim)
|
||||
throw std::runtime_error("Shape size mismatch");
|
||||
Shape<Ndim> arr;
|
||||
std::copy_n(shape.begin(), Ndim, arr.begin());
|
||||
return arr;
|
||||
}
|
||||
|
||||
template <ssize_t Dim = 0, typename Strides> ssize_t element_offset(const Strides &) { return 0; }
|
||||
|
||||
template <ssize_t Dim = 0, typename Strides, typename... Ix>
|
||||
|
@ -72,11 +72,6 @@ struct RawFileConfig {
|
||||
}
|
||||
};
|
||||
|
||||
const char little_endian_char = '<';
|
||||
const char big_endian_char = '>';
|
||||
const char no_endian_char = '|';
|
||||
|
||||
const std::array<char, 3> endian_chars = {little_endian_char, big_endian_char, no_endian_char};
|
||||
const std::array<char, 4> numtype_chars = {'f', 'i', 'u', 'c'};
|
||||
|
||||
} // namespace aare
|
Reference in New Issue
Block a user