mirror of
https://github.com/triqs/dft_tools
synced 2025-01-12 05:58:18 +01:00
Silence some gcc warnings...
- Silence some trivial warning. - TODO: narrowing in a few places.
This commit is contained in:
parent
f273c09c6f
commit
25eec4e046
@ -52,8 +52,8 @@ int main(int argc, char **argv) {
|
|||||||
h5_read(top2,"vdouble",v2);
|
h5_read(top2,"vdouble",v2);
|
||||||
h5_read(top2,"vcomplex",vc2);
|
h5_read(top2,"vcomplex",vc2);
|
||||||
|
|
||||||
for (int i = 0; i <v.size(); ++i) assert_close(v[i],v2[i]);
|
for (size_t i = 0; i <v.size(); ++i) assert_close(v[i],v2[i]);
|
||||||
for (int i = 0; i <vc.size(); ++i) assert_close(vc[i],vc2[i]);
|
for (size_t i = 0; i <vc.size(); ++i) assert_close(vc[i],vc2[i]);
|
||||||
}
|
}
|
||||||
TRIQS_CATCH_AND_ABORT;
|
TRIQS_CATCH_AND_ABORT;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ namespace arrays {
|
|||||||
std::vector<size_t> d2(R);
|
std::vector<size_t> d2(R);
|
||||||
hsize_t dims_out[rank];
|
hsize_t dims_out[rank];
|
||||||
dataspace.getSimpleExtentDims(&dims_out[0], NULL);
|
dataspace.getSimpleExtentDims(&dims_out[0], NULL);
|
||||||
for (size_t u = 0; u < R; ++u) d2[u] = dims_out[u];
|
for (int u = 0; u < R; ++u) d2[u] = dims_out[u];
|
||||||
return d2;
|
return d2;
|
||||||
}
|
}
|
||||||
TRIQS_ARRAYS_H5_CATCH_EXCEPTION;
|
TRIQS_ARRAYS_H5_CATCH_EXCEPTION;
|
||||||
|
@ -74,6 +74,7 @@ namespace arrays {
|
|||||||
template <typename T> void read_array_impl(h5::group g, std::string const& name, T* start, array_stride_info info);
|
template <typename T> void read_array_impl(h5::group g, std::string const& name, T* start, array_stride_info info);
|
||||||
|
|
||||||
template <typename A> void read_array(h5::group g, std::string const& name, A&& a, bool C_reorder = true) {
|
template <typename A> void read_array(h5::group g, std::string const& name, A&& a, bool C_reorder = true) {
|
||||||
|
// mini_vector... : useless on 4.9 and clang, there seems to be a bug (??) on 4.8.
|
||||||
resize_or_check(a, mini_vector<size_t, std::c14::decay_t<A>::rank> (get_array_lengths(a.rank, g, name, triqs::is_complex<typename std::c14::decay_t<A>::value_type>::value)));
|
resize_or_check(a, mini_vector<size_t, std::c14::decay_t<A>::rank> (get_array_lengths(a.rank, g, name, triqs::is_complex<typename std::c14::decay_t<A>::value_type>::value)));
|
||||||
if (C_reorder) {
|
if (C_reorder) {
|
||||||
{
|
{
|
||||||
|
@ -32,12 +32,6 @@ namespace triqs { namespace arrays {
|
|||||||
using utility::mini_vector;
|
using utility::mini_vector;
|
||||||
|
|
||||||
// make_shape
|
// make_shape
|
||||||
// generalize with preproc or variadic template
|
|
||||||
//#define IMPL(z, NN, unused) \
|
|
||||||
// template <typename T> mini_vector<size_t,BOOST_PP_INC(NN)> make_shape(BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(NN), T I_)) \
|
|
||||||
// { return mini_vector<size_t,BOOST_PP_INC(NN)>(BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(NN), I_));}
|
|
||||||
// BOOST_PP_REPEAT(ARRAY_NRANK_MAX , IMPL, nil)
|
|
||||||
//#undef IMPL
|
|
||||||
template<typename... T>
|
template<typename... T>
|
||||||
mini_vector<size_t, sizeof...(T)+1> make_shape(size_t x0, T... args) { return mini_vector<size_t, sizeof...(T)+1> (x0,args...);}
|
mini_vector<size_t, sizeof...(T)+1> make_shape(size_t x0, T... args) { return mini_vector<size_t, sizeof...(T)+1> (x0,args...);}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ namespace triqs { namespace arrays { namespace permutations {
|
|||||||
|
|
||||||
inline void print( std::ostream & out, ull perm) {
|
inline void print( std::ostream & out, ull perm) {
|
||||||
out << "(";
|
out << "(";
|
||||||
for (int i =0; i< permutations::size(perm); ++i) { out << (i!=0 ? " " : "") << apply(perm,i);}
|
for (int i =0; i< int(permutations::size(perm)); ++i) { out << (i!=0 ? " " : "") << apply(perm,i);}
|
||||||
out << ")";
|
out << ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user