28#include <itertools/itertools.hpp>
101 using data_t = nda::basic_array_view<const scalar_t, data_rank, Layout>;
158 target_and_shape_t
target()
const {
return target_and_shape_t{stdutil::front_mpop<arity>(_data.shape())}; }
191 swap(this->_mesh, b._mesh);
192 swap(this->_data, b._data);
250 this->_mesh = g._mesh;
251 this->_data.rebind(g._data);
276 auto d2 = std::forward<Fdata>(fd)(_data);
279 return gv_t{
mesh(), d2};
290 auto d2 = std::forward<Fdata>(fd)(_data);
293 return gv_t{
mesh(), d2};
Member code shared by triqs::gfs::gf, triqs::gfs::gf_view and triqs::gfs::gf_const_view.
gf_const_view(gf_view< M, Target > const &g)
Construct a const view from a (mutable) view.
gf_const_view(gf< M, Target > &&g) noexcept
Construct a const view onto an rvalue Green's function.
gf_view< M, T, Layout > mutable_view_type
gf_const_view(gf_const_view const &x)=default
Copy constructor (shallow: the new view refers to the same data).
typename mesh_t::mesh_point_t mesh_point_t
static constexpr int arity
auto const & data_shape() const
Get the shape of the data array.
static constexpr bool is_const
static constexpr bool is_view
gf_const_view(gf_const_view &&)=default
Move constructor.
friend void swap(gf_const_view &a, gf_const_view &b) noexcept
Swap two const views.
gf_const_view(gf< M, Target > &g)
Construct a const view onto a (non const) Green's function.
gf_const_view(mesh_t m, data_t dat)
Build a const view on top of a mesh and a data array.
static constexpr int data_rank
data_t data() &&
Get the data array view (rvalue overload).
gf_const_view< M, T, Layout > const_view_type
auto apply_on_data(Fdata &&fd)
Build a const view whose data is the result of applying a function to the data array.
mesh_t const & mesh() const
Get the mesh of the Green's function.
typename mesh_t::index_t mesh_index_t
gf_const_view()=default
Construct an empty view, not bound to any data.
gf_const_view< M, typename T::real_t, Layout > real_t
nda::basic_array_view< const scalar_t, data_rank, Layout > data_t
typename T::scalar_t scalar_t
gf_const_view & operator=(gf_const_view const &)=delete
Deleted: a const view cannot be assigned to.
void rebind(gf_const_view< M, Target > const &g) noexcept
Rebind the const view to refer to the mesh and data of another const view.
void rebind(gf_view< M, Target > const &X) noexcept
Rebind the const view onto a (mutable) view.
data_t & data() &
Get the data array view.
auto apply_on_data(Fdata &&fd) const
Build a const view whose data is the result of applying a function to the data array (const overload)...
static constexpr int target_rank
data_t const & data() const &
Get the data array view (const overload).
std::array< long, Target::rank > target_shape() const
Get the shape of the target.
std::array< long, T::rank > target_shape_t
gf_const_view(gf< M, Target > const &g)
Construct a const view onto a const Green's function.
auto target_indices() const
Get a generator over the multi-indices of the target space.
gf_const_view< M, T, Layout > view_type
gf_const_view< M, typename T::complex_t, Layout > complex_t
target_and_shape_t target() const
Get a handle to the target and its shape.
A mutable, non-owning view of a Green's function.
The owning Green's function container.
static constexpr int n_variables
Constexpr variable that holds the number of meshes in a triqs::mesh::Mesh type ( for non-product mes...
Provides the Green's function class.
typename _target_from_type_rank< typename std::decay_t< typename std::decay_t< A >::value_type >, std::decay_t< A >::rank - nvar >::type target_from_array
Deduce the target type of a Green's function from its data array type and arity.
#define TRIQS_CONCEPT_TAG_NAME(MyBeautifulConcept)
Helper macro that produces the name of the tag for TRIQS_DEFINE_CONCEPT_AND_ASSOCIATED_TRAIT.
Lightweight handle bundling the target type and its shape.
target_shape_t const & shape() const
Get the shape of the target.
Target target_t
The target type.
target_shape_t _shape
The shape of the target.
Empty tag inherited by every view type in TRIQS. See also is_view.