Go to the documentation of this file.
14 #include <boost/mpl/list.hpp>
18 #if BOOST_VERSION >= 105900
19 #define BOOST_GLOBAL_FIXTURE_END ;
21 #define BOOST_GLOBAL_FIXTURE_END
28 typedef boost::mpl::list<int,
unsigned int, long,
unsigned long,
unsigned char, char,
29 float, double,
long long,
unsigned long long,
complex>
32 typedef boost::mpl::list<int,
unsigned int, long,
unsigned long,
unsigned char, char,
37 template <
typename T,
typename Func>
38 void fillVec(std::vector<std::vector<T>>& v, std::vector<size_t> dims,
const Func& f) {
40 dims.erase(dims.begin());
41 for (
auto& subvec : v) {
46 template <
typename T,
typename Func>
47 void fillVec(std::vector<T>& v, std::vector<size_t> dims,
const Func& f) {
49 std::generate(v.begin(), v.end(), f);
54 bool checkLength(
const std::vector<T>& v, std::vector<size_t> dims) {
55 return (dims.size() == 1 && v.size() == dims[0]);
59 bool checkLength(
const std::vector<std::vector<T>>& v, std::vector<size_t> dims) {
60 size_t dim0 = dims[0];
61 dims.erase(dims.begin());
62 if (v.size() != dim0) {
69 template <
typename T,
typename Func>
70 void generate2D(T* table,
size_t x,
size_t y, Func& func) {
71 for (
size_t i = 0; i < x; i++) {
72 for (
size_t j = 0; j < y; j++) {
83 ,
_inc(T(1) + T(1) / T(10)) {}
106 if (++
_init >= (
'a' + 26))
121 std::mt19937_64 rgen;
123 std::uniform_int_distribution<unsigned> int_dist(0, 1000);
124 const size_t size_string = int_dist(rgen);
126 random_string.resize(size_string);
127 std::generate(random_string.begin(), random_string.end(), gen);
128 return random_string;
133 template <
typename T>
138 std::replace(std::begin(name), std::end(name),
' ',
'_');
139 std::replace(std::begin(name), std::end(name),
'<',
'_');
140 std::replace(std::begin(name), std::end(name),
'>',
'_');
141 std::replace(std::begin(name), std::end(name),
':',
'_');
146 template <
typename ElemT,
typename DataT>
155 std::ostringstream filename;
156 filename <<
"h5_rw_" << struct_t <<
"_" << ndims <<
"d_"
157 << typeNameHelper<ElemT>() <<
"_test.h5";
164 dataset.
write(ndvec);
166 dataset.
read(result);
ContentGenerate()
Definition: tests_high_five.hpp:116
Definition: tests_high_five.hpp:100
ContentGenerate()
Definition: tests_high_five.hpp:81
boost::mpl::list< int, unsigned int, long, unsigned long, unsigned char, char, float, double > dataset_test_types
Definition: tests_high_five.hpp:34
T _init
Definition: tests_high_five.hpp:91
char _init
Definition: tests_high_five.hpp:111
T _inc
Definition: tests_high_five.hpp:91
void read(T &array) const
Definition: H5Slice_traits_misc.hpp:158
void generate2D(T *table, size_t x, size_t y, Func &func)
Definition: tests_high_five.hpp:70
ContentGenerate()
Definition: tests_high_five.hpp:101
static DataSpace From(const ScalarValue &scalar_value)
Definition: H5Dataspace_misc.hpp:129
std::string typeNameHelper()
Definition: tests_high_five.hpp:134
void write(const T &buffer)
Definition: H5Slice_traits_misc.hpp:200
Definition: tests_high_five.hpp:80
bool checkLength(const std::vector< T > &v, std::vector< size_t > dims)
Definition: tests_high_five.hpp:54
char operator()()
Definition: tests_high_five.hpp:104
std::string operator()()
Definition: tests_high_five.hpp:118
boost::mpl::list< float, double > floating_numerics_test_types
Definition: tests_high_five.hpp:26
File class.
Definition: H5File.hpp:24
@ Truncate
Open flag: Truncate a file if already existing.
Definition: H5File.hpp:37
boost::mpl::list< int, unsigned int, long, unsigned long, unsigned char, char, float, double, long long, unsigned long long, complex > numerical_test_types
Definition: tests_high_five.hpp:30
HighFive::DataSet readWriteDataset(const DataT &ndvec, DataT &result, const size_t ndims, const std::string &struct_t)
Definition: tests_high_five.hpp:148
T operator()()
Definition: tests_high_five.hpp:85
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
void fillVec(std::vector< std::vector< T >> &v, std::vector< size_t > dims, const Func &f)
Definition: tests_high_five.hpp:38
DataSet createDataSet(const std::string &dataset_name, const DataSpace &space, const DataType &type, const DataSetCreateProps &createProps=DataSetCreateProps(), const DataSetAccessProps &accessProps=DataSetAccessProps())
createDataSet Create a new dataset in the current file of datatype type and of size space
Definition: H5Node_traits_misc.hpp:36
std::complex< double > complex
Definition: tests_high_five.hpp:24
Class representing a dataset.
Definition: H5DataSet.hpp:27
Definition: H5_definitions.hpp:15
const std::string DATASET_NAME("dset")