3#ifndef DUNE_PDELAB_BACKEND_COMMON_ALIASEDVECTORVIEW_HH
4#define DUNE_PDELAB_BACKEND_COMMON_ALIASEDVECTORVIEW_HH
6#include <dune/common/typetraits.hh>
16 template<
typename V,
typename LFSC>
20 typedef typename std::remove_const<V>::type
Container;
83 return cache().size();
96 template<
typename LFS>
99 return this->
_data[lfs.localIndex(i)];
116 typename std::conditional<
117 std::is_const<V>::value,
125 template<
typename V,
typename LFSC>
168 template<
typename LFS>
171 this->
_data[lfs.localIndex(n)] += weight_ * v;
174 template<
typename LFS>
182 return this->
_data[i];
195 const ElementType*
data()
const
For backward compatibility – Do not use this!
Definition adaptivity.hh:28
Definition aliasedvectorview.hh:18
ConstAliasedVectorView(V &container)
Definition aliasedvectorview.hh:37
void attach(V &container)
Definition aliasedvectorview.hh:49
V * _container
Definition aliasedvectorview.hh:114
std::remove_const< V >::type Container
Definition aliasedvectorview.hh:20
const ElementType * data() const
Definition aliasedvectorview.hh:70
const LFSCache * _lfs_cache
Definition aliasedvectorview.hh:115
ElementType value_type
Definition aliasedvectorview.hh:28
LFSCache::DOFIndex DOFIndex
Definition aliasedvectorview.hh:25
size_type size() const
Definition aliasedvectorview.hh:81
LFSCache::ContainerIndex ContainerIndex
Definition aliasedvectorview.hh:26
const ElementType & operator()(const LFS &lfs, size_type i) const
Definition aliasedvectorview.hh:97
std::conditional< std::is_const< V >::value, constElementType *, ElementType * >::type _data
Definition aliasedvectorview.hh:120
void attach(std::shared_ptr< V > container)
Definition aliasedvectorview.hh:54
const ElementType & operator[](size_type i) const
Definition aliasedvectorview.hh:86
void unbind()
Definition aliasedvectorview.hh:75
ConstAliasedVectorView()
Definition aliasedvectorview.hh:31
LFSC LFSCache
Definition aliasedvectorview.hh:21
Container::size_type size_type
Definition aliasedvectorview.hh:24
void bind(const LFSCache &lfs_cache)
Definition aliasedvectorview.hh:64
ConstAliasedVectorView(std::shared_ptr< V > container)
Definition aliasedvectorview.hh:43
const ElementType & operator[](const ContainerIndex &ci) const
Definition aliasedvectorview.hh:91
const Container & container() const
Definition aliasedvectorview.hh:102
Container::E ElementType
Definition aliasedvectorview.hh:23
void detach()
Definition aliasedvectorview.hh:59
const LFSCache & cache() const
Definition aliasedvectorview.hh:107
Definition aliasedvectorview.hh:128
Container::ElementType ElementType
Definition aliasedvectorview.hh:131
LFSC LFSCache
Definition aliasedvectorview.hh:134
void setWeight(weight_type weight)
Definition aliasedvectorview.hh:205
void commit()
Definition aliasedvectorview.hh:165
ElementType & operator[](size_type i)
Definition aliasedvectorview.hh:180
V Container
Definition aliasedvectorview.hh:130
AliasedVectorView(std::shared_ptr< Container > container)
Definition aliasedvectorview.hh:160
AliasedVectorView(Container &container)
Definition aliasedvectorview.hh:155
weight_type weight()
Definition aliasedvectorview.hh:210
LFSCache::ContainerIndex ContainerIndex
Definition aliasedvectorview.hh:136
Container & container()
Definition aliasedvectorview.hh:200
ElementType * data()
Definition aliasedvectorview.hh:190
AliasedVectorView()
Definition aliasedvectorview.hh:151
ElementType weight_type
Definition aliasedvectorview.hh:139
Container::size_type size_type
Definition aliasedvectorview.hh:132
void rawAccumulate(const LFS &lfs, size_type n, value_type v)
Definition aliasedvectorview.hh:175
void accumulate(const LFS &lfs, size_type n, value_type v)
Definition aliasedvectorview.hh:169
LFSCache::DOFIndex DOFIndex
Definition aliasedvectorview.hh:135
const ElementType * data() const
Definition aliasedvectorview.hh:195
ElementType & operator[](const ContainerIndex &ci)
Definition aliasedvectorview.hh:185
ElementType value_type
Definition aliasedvectorview.hh:138