/*******************************************************************************
*
* 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 .
*
******************************************************************************/
#ifndef TRIQS_ARRAYS_MAKE_IMMUTABLE_ARRAY_H
#define TRIQS_ARRAYS_MAKE_IMMUTABLE_ARRAY_H
#include "./array.hpp"
namespace triqs { namespace arrays {
template
class immutable_array_impl : TRIQS_MODEL_CONCEPT(ImmutableCuboidArray) {
template struct _si { typedef size_t type;};
public :
immutable_array_impl(Expr e_, clef::pair ... p):
f(clef::make_function(e_, clef::placeholder()...)), dom_(make_shape(p.rhs().size()...)) {};
typedef typename triqs::clef::result_of::make_function... >::type function_type;
typedef typename std::result_of::type...)>::type value_type;
typedef indexmaps::cuboid::domain_t domain_type;
domain_type domain() const { return dom_;}
template value_type operator() (Args const & ... args) const { return f(args...); }
friend std::ostream & operator<<(std::ostream & out, immutable_array_impl const & x){return out<<" immutable_array on domain : "<
immutable_array_impl make_immutable_array( Expr const & expr, clef::pair ... p) {
return immutable_array_impl (expr, p...);
}
}}//namespace triqs::arrays
#endif