mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 03:33:50 +01:00
Silence warnings on gcc
gcc 4.9 with -Wall -Wno-unknown-pragmas -Wno-maybe-uninitialized -Wno-sign-compare -> uninit : not reliable apparently. -> sign compare : to be fixed later. -> fix all, but parenthesis suggestion
This commit is contained in:
parent
0a3f07a6cb
commit
a857aca301
@ -4,8 +4,6 @@ using namespace triqs::arrays;
|
||||
|
||||
int main() {
|
||||
|
||||
typedef std::complex<double> dcomplex;
|
||||
|
||||
array<double,3> A(10,2,2); A() = 0;
|
||||
|
||||
A(4,range(),range()) = 1;
|
||||
@ -24,10 +22,8 @@ int main() {
|
||||
M1 = M2;
|
||||
//M1 = M1*M2;
|
||||
|
||||
// aie! M1 is zero!
|
||||
std::cout << M1 << std::endl;
|
||||
std::cout << M2 << std::endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,11 +14,10 @@ using namespace triqs::lattice;
|
||||
|
||||
int main() {
|
||||
try {
|
||||
double beta = 1;
|
||||
int N = 10;
|
||||
int S = 2;
|
||||
placeholder<0> k_;
|
||||
placeholder<1> r_;
|
||||
//placeholder<1> r_;
|
||||
|
||||
auto bz_ = brillouin_zone{bravais_lattice{make_unit_matrix<double>(2)}};
|
||||
auto gk = gf<bz>{{bz_, N}, {S, S}};
|
||||
|
@ -34,8 +34,7 @@ int main() {
|
||||
|
||||
placeholder<0> k_;
|
||||
placeholder<1> w_;
|
||||
placeholder<2> wn_;
|
||||
placeholder<3> tau_;
|
||||
//placeholder<2> tau_;
|
||||
|
||||
auto eps_k = -2 * (cos(k_(0)) + cos(k_(1)));
|
||||
gkw(k_, w_) << 1 / (w_ - eps_k - 1 / (w_ + 2));
|
||||
|
@ -15,7 +15,6 @@ using namespace triqs::lattice;
|
||||
|
||||
int main() {
|
||||
try {
|
||||
double beta = 1;
|
||||
auto bz_ = brillouin_zone{bravais_lattice{make_unit_matrix<double>(2)}};
|
||||
|
||||
auto t = tail{1,1};
|
||||
|
@ -47,7 +47,7 @@ int main(int argc, char* argv[]) {
|
||||
VEC A(7), B(7), AA(7);
|
||||
|
||||
clef::placeholder<0> i_;
|
||||
clef::placeholder<1> j_;
|
||||
//clef::placeholder<1> j_;
|
||||
|
||||
triqs::clef::make_expr(A)[i_] << i_+1;
|
||||
|
||||
|
@ -32,7 +32,7 @@ void test_1(int argc, char ** argv){
|
||||
correlated_gaussian_vector(A, seed, L);
|
||||
double intrinsic_variance = 1;
|
||||
|
||||
auto t1 = clock();
|
||||
//auto t1 = clock();
|
||||
TEST( autocorrelation_time(A));
|
||||
//std::cout << "time = " << double( clock()-t1)/CLOCKS_PER_SEC << std::endl;
|
||||
//t1 = clock();
|
||||
|
@ -77,7 +77,8 @@ namespace arrays {
|
||||
buffer.resize(s);
|
||||
h5::dataspace mspace1 = H5Screate_simple(RANK, dims.ptr(), maxdims.ptr());
|
||||
h5::proplist cparms = H5Pcreate(H5P_DATASET_CREATE);
|
||||
auto err = H5Pset_chunk(cparms, RANK, dim_chunk.ptr());
|
||||
//auto err = H5Pset_chunk(cparms, RANK, dim_chunk.ptr());
|
||||
H5Pset_chunk(cparms, RANK, dim_chunk.ptr());
|
||||
d_set = g.create_dataset(name, h5::native_type_from_C(T()), mspace1, cparms);
|
||||
if (triqs::is_complex<T>::value) h5::write_string_attribute(d_set, "__complex__", "1");
|
||||
}
|
||||
|
@ -163,12 +163,12 @@ namespace gfs {
|
||||
// specific operations (for legacy python code).
|
||||
// +=, -= with a matrix
|
||||
inline void operator+=(gf_view<imfreq> g, arrays::matrix<std::complex<double>> m) {
|
||||
for (int u = 0; u < first_dim(g.data()); ++u) g.data()(u, arrays::ellipsis()) += m;
|
||||
for (int u = 0; u < int(first_dim(g.data())); ++u) g.data()(u, arrays::ellipsis()) += m;
|
||||
g.singularity()(0) += m;
|
||||
}
|
||||
|
||||
inline void operator-=(gf_view<imfreq> g, arrays::matrix<std::complex<double>> m) {
|
||||
for (int u = 0; u < first_dim(g.data()); ++u) g.data()(u, arrays::ellipsis()) -= m;
|
||||
for (int u = 0; u < int(first_dim(g.data())); ++u) g.data()(u, arrays::ellipsis()) -= m;
|
||||
g.singularity()(0) -= m;
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ namespace gfs {
|
||||
r() = 0;
|
||||
auto omin = t.order_min();
|
||||
auto omax = t.order_max(); // precompute since long to do...
|
||||
auto _ = arrays::range{};
|
||||
for (int u = omax; u >= omin; --u)
|
||||
r = r / omega + matrix_view<dcomplex>{t.data()(u - omin, ellipsis())}; // need to make a matrix view because otherwise + is not defined
|
||||
r /= pow(omega, omin);
|
||||
|
@ -31,9 +31,9 @@ namespace gfs {
|
||||
auto t = tail_omega(s.get_from_linear_index(0));
|
||||
// a bit faster to first replace (some part of expression are precomputed).
|
||||
clef::placeholder<0> x_;
|
||||
//auto expr = rhs(x_, t);
|
||||
//for (auto x : s.mesh()) s[x] = eval(expr, x_ = x);
|
||||
for (auto x : s.mesh()) s[x] = rhs(x, t);
|
||||
auto expr = rhs(x_, t);
|
||||
for (auto x : s.mesh()) s[x] = eval(expr, x_ = x);
|
||||
//for (auto x : s.mesh()) s[x] = rhs(x, t);
|
||||
}
|
||||
|
||||
/// --------------------------- singularity ---------------------------------
|
||||
|
@ -28,7 +28,8 @@ namespace h5 {
|
||||
|
||||
datatype strdatatype = H5Tcopy(H5T_C_S1);
|
||||
// auto status = H5Tset_size (strdatatype, H5T_VARIABLE);
|
||||
auto status = H5Tset_size(strdatatype, value.size() + 1);
|
||||
//auto status = H5Tset_size(strdatatype, value.size() + 1);
|
||||
H5Tset_size(strdatatype, value.size() + 1);
|
||||
|
||||
dataspace space = H5Screate(H5S_SCALAR);
|
||||
dataset ds = g.create_dataset(name, strdatatype, space);
|
||||
@ -47,7 +48,8 @@ namespace h5 {
|
||||
size_t size = H5Dget_storage_size(ds);
|
||||
|
||||
datatype strdatatype = H5Tcopy(H5T_C_S1);
|
||||
auto status = H5Tset_size(strdatatype, size);
|
||||
H5Tset_size(strdatatype, size);
|
||||
//auto status = H5Tset_size(strdatatype, size);
|
||||
// auto status = H5Tset_size (strdatatype, H5T_VARIABLE);
|
||||
|
||||
std::vector<char> buf(size + 1, 0x00);
|
||||
|
@ -29,7 +29,8 @@ namespace h5 {
|
||||
for (auto &x : V) s = std::max(s, x.size());
|
||||
|
||||
datatype strdatatype = H5Tcopy (H5T_C_S1);
|
||||
auto status = H5Tset_size (strdatatype, s);
|
||||
H5Tset_size (strdatatype, s);
|
||||
//auto status = H5Tset_size (strdatatype, s);
|
||||
//auto status = H5Tset_size (strdatatype, H5T_VARIABLE);
|
||||
|
||||
const size_t n = V.size();
|
||||
@ -65,7 +66,8 @@ namespace h5 {
|
||||
size_t size = H5Dget_storage_size(ds);
|
||||
|
||||
datatype strdatatype = H5Tcopy (H5T_C_S1);
|
||||
auto status = H5Tset_size (strdatatype, size);
|
||||
H5Tset_size (strdatatype, size);
|
||||
//auto status = H5Tset_size (strdatatype, size);
|
||||
//auto status = H5Tset_size (strdatatype, H5T_VARIABLE);
|
||||
|
||||
std::vector<char> buf(Len * (size + 1), 0x00);
|
||||
|
@ -25,7 +25,7 @@ namespace triqs {
|
||||
namespace utility {
|
||||
|
||||
class index3_generator {
|
||||
mini_vector<long, 3> i, d; // rely on mini_vector initialization
|
||||
mini_vector<long, 3> d, i; // rely on mini_vector initialization
|
||||
long i_flat =0;
|
||||
bool _at_end = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user