On 07/21/2017 01:25 AM, Maxi Miller wrote:
i.e. the begin()-iterator of the dealii::Vector does not always point at
the beginning of the Vector. That's what I found confusing.
I hope that helps already!
Hm, can you elaborate?
In your first code snippet, you simply copy an iterator range
[ std_vec_1.begin()+std_vec_2.size(),
std_vec_1.begin()+std_vec_2.size()*2 )
from the first vector to std_vec2. In other words, you copy out a
consecutive range of elements. I'm not sure whether you realize, but the
contents of the std_vec2 array do not actually matter here -- the call
that fills std_vec2 only references the *size* of std_vec2, but not
what's actually in it.
But what extract_subvector_to() does is it takes a set of indices
(pointed to by the two iterator arguments) and the copies the indexed
elements into the output object. That in your example the indices that
you're interested in happen to be consecutive is of no concern to this
function.
Does that make sense?
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.