3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 06:14:14 +01:00

arrays : clean an old example

This commit is contained in:
Olivier Parcollet 2013-06-30 21:41:56 +02:00
parent 552c440238
commit f4d42a4ec8
2 changed files with 5 additions and 12 deletions

View File

@ -20,7 +20,6 @@
******************************************************************************/ ******************************************************************************/
#include "./common.hpp" #include "./common.hpp"
#define ARRAY_DEBUG_SLICE #define ARRAY_DEBUG_SLICE
#define TRIQS_ARRAYS_USE_OLD_KEY_EVAL
#include "./src/array.hpp" #include "./src/array.hpp"
#include <iostream> #include <iostream>
@ -32,7 +31,11 @@ using namespace triqs::arrays;
template<typename IM, typename A> template<typename IM, typename A>
void print_in_indexmap_order (std::ostream & out, IM const & im, A const & a) { void print_in_indexmap_order (std::ostream & out, IM const & im, A const & a) {
out<<"["; out<<"[";
for (typename IM::iterator it(im); it; ++it) out<<a[it.indices()]<<" "; //for (typename IM::iterator it(im); it; ++it) out<<a[it.indices()]<<" ";
for (typename IM::iterator it(im); it; ++it) {
auto i = it.indices();
out<< a(i[0],i[1],i[2])<<" ";
}
out<<"]"; out<<"]";
} }

View File

@ -173,14 +173,6 @@ namespace triqs { namespace arrays {
//bool is_empty() const { return this->num_elements()==0;} //bool is_empty() const { return this->num_elements()==0;}
bool is_empty() const { return this->storage_.empty();} bool is_empty() const { return this->storage_.empty();}
#ifdef TRIQS_ARRAYS_USE_OLD_KEY_EVAL
// Evaluation on keys.
// deprecated : only used in one example ?
typedef typename domain_type::index_value_type key_type;
template<typename KeyType> value_type const & operator[](KeyType const & key) const { return storage_[indexmap_[key]]; }
template<typename KeyType> value_type & operator[](KeyType const & key) { return storage_[indexmap_[key]]; }
#endif
// ------------------------------- operator () -------------------------------------------- // ------------------------------- operator () --------------------------------------------
typedef typename ISPViewType<value_type,domain_type::rank, OptionFlags, TraversalOrder, ViewTag,false >::type view_type; typedef typename ISPViewType<value_type,domain_type::rank, OptionFlags, TraversalOrder, ViewTag,false >::type view_type;
@ -208,8 +200,6 @@ namespace triqs { namespace arrays {
typedef typename ISPViewType<V2,IM2::domain_type::rank, OptionFlags|optmodif, IM2::traversal_order_in_template, ViewTag, ForceBorrowed || StorageType::is_weak >::type type; typedef typename ISPViewType<V2,IM2::domain_type::rank, OptionFlags|optmodif, IM2::traversal_order_in_template, ViewTag, ForceBorrowed || StorageType::is_weak >::type type;
}; };
// change here only for debug
//#define TRIQS_ARRAYS_SLICE_DEFAUT_IS_SHARED
#ifndef TRIQS_ARRAYS_SLICE_DEFAUT_IS_SHARED #ifndef TRIQS_ARRAYS_SLICE_DEFAUT_IS_SHARED
template<typename... Args> // non const version template<typename... Args> // non const version
typename boost::lazy_enable_if_c< typename boost::lazy_enable_if_c<