[dune-functions] [Dune-devel] hierarchicVectorWrapper and hierarchicMatrixWrapper

Simon Praetorius Simon.Praetorius at tu-dresden.de
Fri Feb 23 14:48:53 CET 2018


Hi Carsten,

>> A common coefficient type is really a tricky problem. For
>> MultiTypeVector<std::vector<std::bitset<N>>, std::vector<bool>>
>> for example, there is no common value type. Both leaf vectors
>> return different (non-compatible) proxies for the boolean values.
> that's why it is _impossible_ to implement a non-const
> access to this with a dynamic index (unless you implement
> some possibly slow type-erasure).

Actually, it is possible (without type-erasure), but you need
an additional wrapping functor (like the MultIndexResolver) for
the leaf access. OK, it does not really return a mutable reference
to the vector values (since this is impossible with the static type
system of c++, as you mentioned), but instead one could implement
something like an assignment-proxy for the mutable access and some
value-proxy for the const-access. With this technique, I have implement the
hierarchicWrapperTest for the  
MultiTypeVector<std::vector<std::bitset<N>>, std::vector<bool>>.
But, to be honest, this solution is not so very nice. You have two
wrapping functors and you need a terminal operation, like assignment
or value comparison. So it's maybe not what we want here.


>> OK. I simply have not seen/tried out any basis that is not
>> a DefaultGlobalBasis. Some parts of my implementation are
>> based on the PreBasis structure of Power/Composite PreBases
>> This is probably too restrictive, but I have no other idea currently.
> The problem is not that the structure is needed to implement
> this information. The problem is that the interface depends
> on this.

Maybe I get this wrong. The pure vector-datastructure does not encode
the hierarchy we need for the recursion, since e.g. the leaf nodes  
could also be
vector types. The coefficient type could be a break condition for the  
recursion,
but must be provided. The nesting-structure could also be a break  
condition for
the recursion, but must also be provided.
The nesting-structure itself is not directly related to a (pre)basis or
its implementation. It is just a light-weight description of the hierarchy.
So, it can be described independently of the basis, but could also be  
extracted
from the basis.
The last step is tightly coupled to the concrete prebasis
datastructure and implementation, currently. This is probably not the  
best solution.


I see, that this is a lot about data-structures and how they are related to a
global basis. But dune-functions is more about the bases itself, right? So,
it does not fit really in this module.




-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fakultät Mathematik
Technische Universität Dresden
Tel.: TUD-34432
Mail: simon.praetorius at tu-dresden.de
Web: www.math.tu-dresden.de/~spraetor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5753 bytes
Desc: S/MIME-Signatur
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20180223/4f7c5549/attachment.bin>


More information about the dune-functions mailing list