AlignedVector set at index

9 views
Skip to first unread message

Zachary 42!

unread,
Jan 6, 2021, 4:43:28 PM1/6/21
to dea...@googlegroups.com
Hi everyone,

Ideally I would like to create an AlignedVector with a begin and end and then push_back only to those indices within those bounds. Is there a way to accomplish this?

I assume the push_back function works similar to std::vector and starts the index count at zero, I would like to assign an aligned vector to a particular index like the std::vector insert function. I see there is apply_to_subrang() in AlignedVectorSet() but I don’t see any tests or examples using them.

Thank you,

Zachary

Wolfgang Bangerth

unread,
Jan 7, 2021, 11:54:00 PM1/7/21
to dea...@googlegroups.com

Zachary,

> Ideally I would like to create an AlignedVector with a begin and end and then push_back only to those indices within those bounds. Is there a way to accomplish this?

for (auto x=begin; x!=end; ++x)
my_vec.push_back (*x);


> I assume the push_back function works similar to std::vector and starts the index count at zero, I would like to assign an aligned vector to a particular index like the std::vector insert function. I see there is apply_to_subrang() in AlignedVectorSet() but I don’t see any tests or examples using them.

I'm not sure I understand what you are trying to do. But out of curiosity, why
do you intend to use this class? Why isn't std::vector providing what you are
looking for?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages