3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 03:33:50 +01:00
- A silly copy paste error : the operator - for matrix expression was
  defined twice.
- second error : a typo in unary method.
This commit is contained in:
Olivier Parcollet 2014-07-02 18:16:22 +02:00
parent 3b2372c437
commit 9583afc671
4 changed files with 42 additions and 3 deletions

33
test/triqs/gfs/gf3.cpp Normal file
View File

@ -0,0 +1,33 @@
#define TRIQS_ARRAYS_ENFORCE_BOUNDCHECK
#include <triqs/gfs.hpp>
using namespace triqs::gfs;
using namespace triqs::arrays;
namespace h5 = triqs::h5;
#define TEST(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl<<std::endl;
#include <triqs/gfs/local/functions.hpp>
// example
//template<typename T> using block_gf = gf<block_index, gf<T>>;
// block_gf<imtime> ...
// but not on gcc 4.6 !
//
int main() {
try {
double beta =1;
auto G = gf<imfreq>{ {beta, Fermion}, {2,2} };
auto Gc = gf<imfreq>{ {beta, Fermion}, {2,2} };
auto G3 = gf<imfreq>{ {beta, Fermion}, {2,2} };
triqs::clef::placeholder<0> om_;
G(om_) << om_ + 2 - G3(om_);
G = -G3;
}
TRIQS_CATCH_AND_ABORT;
}

View File

@ -22,6 +22,7 @@ void print_to_file(std::string const s, gf<imtime> const & gt){
}
void test_0(){
try {
int Ntau = 10001;
double beta =1;
@ -41,11 +42,15 @@ void test_0(){
TEST(Gt.data());
TEST(Gt.mesh().index_to_point(0));
TEST(Gt.mesh().index_to_point(1));
}
catch(std::exception const & e) { std::cout << e.what()<< std::endl;}
}
void test_1(){
try {
double beta=10;
/* ----- Fourier ----- */
@ -54,6 +59,9 @@ void test_1(){
Gw.singularity()(1) = 1;
Gt() = inverse_fourier(Gw);
}
catch(std::exception const & e) { std::cout << e.what()<< std::endl;}
}
int main() {

View File

@ -105,8 +105,6 @@ namespace triqs { namespace arrays {
DEFINE_OPERATOR(plus, +, ImmutableMatrix,ImmutableMatrix);
DEFINE_OPERATOR(minus, -, ImmutableMatrix,ImmutableMatrix);
DEFINE_OPERATOR(minus, -, ImmutableMatrix,is_in_ZRC);
DEFINE_OPERATOR(minus, -, is_in_ZRC,ImmutableMatrix);
DEFINE_OPERATOR(multiplies, *, is_in_ZRC,ImmutableMatrix);
DEFINE_OPERATOR(multiplies, *, ImmutableMatrix,is_in_ZRC);
DEFINE_OPERATOR(divides, /, ImmutableMatrix,is_in_ZRC);

View File

@ -109,7 +109,7 @@ namespace triqs { namespace gfs {
auto mesh() const DECL_AND_RETURN(l.mesh());
auto singularity() const DECL_AND_RETURN(l.singularity());
auto get_data_shape() const DECL_AND_RETURN (get_data_shape(l));
AUTO_DECL get_data_shape() const RETURN (get_gf_data_shape(l));
template<typename KeyType> auto operator[](KeyType&& key) const DECL_AND_RETURN( -l[key]);
template<typename ... Args> auto operator()(Args && ... args) const DECL_AND_RETURN( -l(std::forward<Args>(args)...));