mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 06:14:14 +01:00
arrays: rm tags file and some cleaning
- tags are defined in files, this impl/tags.hpp was not needed any more. - some code cleaning
This commit is contained in:
parent
6fa737978e
commit
241d5636d7
@ -29,6 +29,8 @@
|
||||
|
||||
namespace triqs { namespace arrays {
|
||||
|
||||
namespace Tag {struct indexmap_storage_pair{}; }// defined here since needed below...
|
||||
|
||||
namespace assignment { template<typename LHS, typename RHS, char OP, typename Enable = void> struct impl; }
|
||||
|
||||
// puts the contents of RHS into LHS. LHS must be an indexmap_storage_pair
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include <boost/type_traits/is_arithmetic.hpp>
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
#include <triqs/utility/compiler_details.hpp>
|
||||
#include "./tags.hpp"
|
||||
#include "./traits.hpp"
|
||||
#include <triqs/utility/macros.hpp>
|
||||
|
||||
|
@ -25,6 +25,8 @@ namespace triqs { namespace arrays {
|
||||
|
||||
typedef unsigned long long ull_t;
|
||||
|
||||
namespace Tag {struct no_init {}; struct default_init {};}
|
||||
|
||||
// Flags is a 64 bit unsigned int.
|
||||
// 0 is the default option.
|
||||
// Meaning of the bits :
|
||||
|
@ -61,27 +61,17 @@ namespace triqs { namespace arrays {
|
||||
// ------------------------------- constructors --------------------------------------------
|
||||
|
||||
indexmap_storage_pair() {}
|
||||
indexmap_storage_pair (indexmap_type const & IM, storage_type const & ST): indexmap_(IM),storage_(ST) {deleg(IM,ST);}
|
||||
indexmap_storage_pair (indexmap_type && IM, storage_type && ST) : indexmap_(std::move(IM)),storage_(std::move(ST)){deleg(IM,ST);}
|
||||
indexmap_storage_pair (indexmap_type const & IM, storage_type && ST) : indexmap_(IM),storage_(std::move(ST)) {deleg(IM,ST);}
|
||||
|
||||
indexmap_storage_pair (const indexmap_type & IM, const storage_type & ST):
|
||||
indexmap_(IM),storage_(ST){
|
||||
//std::cerr << " construct ISP "<< storage_type::is_weak<< std::endl;
|
||||
#ifdef TRIQS_ARRAYS_CHECK_IM_STORAGE_COMPAT
|
||||
if (ST.size() != IM.domain().number_of_elements())
|
||||
TRIQS_RUNTIME_ERROR<<"index_storage_pair construction : storage and indices are not compatible";
|
||||
#endif
|
||||
/// The storage is allocated from the size of IM.
|
||||
indexmap_storage_pair (const indexmap_type & IM): indexmap_(IM),storage_(){
|
||||
this->storage_ = StorageType(this->indexmap_.domain().number_of_elements(), typename flags::init_tag<OptionFlags>::type() );
|
||||
}
|
||||
|
||||
indexmap_storage_pair (indexmap_type && IM, storage_type && ST):
|
||||
indexmap_(std::move(IM)),storage_(std::move(ST)){
|
||||
//std::cerr << " construct ISP && IM, && ST "<< storage_type::is_weak<< std::endl;
|
||||
#ifdef TRIQS_ARRAYS_CHECK_IM_STORAGE_COMPAT
|
||||
if (ST.size() != IM.domain().number_of_elements())
|
||||
TRIQS_RUNTIME_ERROR<<"index_storage_pair construction : storage and indices are not compatible";
|
||||
#endif
|
||||
}
|
||||
|
||||
indexmap_storage_pair (indexmap_type const & IM, storage_type && ST):
|
||||
indexmap_(IM),storage_(std::move(ST)){
|
||||
private :
|
||||
void deleg (const indexmap_type & IM, const storage_type & ST) {
|
||||
//std::cerr << " construct ISP && ST "<< storage_type::is_weak<< std::endl;
|
||||
#ifdef TRIQS_ARRAYS_CHECK_IM_STORAGE_COMPAT
|
||||
if (ST.size() != IM.domain().number_of_elements())
|
||||
@ -89,11 +79,6 @@ namespace triqs { namespace arrays {
|
||||
#endif
|
||||
}
|
||||
|
||||
/// The storage is allocated from the size of IM.
|
||||
indexmap_storage_pair (const indexmap_type & IM): indexmap_(IM),storage_(){
|
||||
this->storage_ = StorageType(this->indexmap_.domain().number_of_elements(), typename flags::init_tag<OptionFlags>::type() );
|
||||
}
|
||||
|
||||
public:
|
||||
/// Shallow copy
|
||||
indexmap_storage_pair(const indexmap_storage_pair & X):indexmap_(X.indexmap()),storage_(X.storage_){}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* TRIQS: a Toolbox for Research in Interacting Quantum Systems
|
||||
*
|
||||
* Copyright (C) 2011 by O. Parcollet
|
||||
*
|
||||
* TRIQS is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* TRIQS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifndef TRIQS_ARRAYS_IMPL_TAGS_H
|
||||
#define TRIQS_ARRAYS_IMPL_TAGS_H
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
|
||||
namespace triqs { namespace arrays {
|
||||
namespace Tag {
|
||||
struct indexmap_storage_pair{};
|
||||
struct no_init {}; struct nan_inf_init {}; struct default_init {};
|
||||
struct h5_array_proxy {};
|
||||
}
|
||||
|
||||
}}//namespace triqs::arrays
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user