Boost logo

Boost Users :

Subject: Re: [Boost-users] container with large number of elements and a small number of invalide elements
From: Vincent N. Virgilio (virgilio_at_[hidden])
Date: 2013-11-05 14:27:36


ersatz = limited (cheap)

You might use partition or stable_partition on the container of indices.
The predicate would dereference and return valid/invalid. Partition or
stable_partition would separate your container of indices into two groups.
Iterators in [begin, middle) would mark valid indices, and iterators in
[middle, end) would mark invalid indices. You'd plot the dereferenced set
of valid indices in [begin, middle).

Vince

On Tue, Nov 5, 2013 at 1:45 PM, MM <finjulhich_at_[hidden]> wrote:

>
>
>
> On 5 November 2013 18:34, Vincent N. Virgilio <virgilio_at_[hidden]> wrote:
>
>> Yes, stable_partition (and probably partition) involve swaps, according
>> to SGI's doc.
>>
>> Instead, you might apply one of the above partition functions to a
>> parallel container of indices, and dereference with the predicate?
>>
>> Seems like this is steering back to an ersatz version of a boost adaptor.
>>
>> Vince
>>
>
> Could you elaborate? what do you mean an "ersatz version of a boost
> adaptor"
>
> I can store a container of indices that are invalid, and get max and
> min,and access via a [] with the help of that container.
> I just was looking to reuse some component for this rather than implement
> it myself.
>
>
> >Or modify your algorithm to not require random access. ;-)
> >What are you wanting to do with the sequence(s)?
> I need to plot only the elements that are valid.
> Unfortunately, the plotting library requires a sort of indexed element,
>
> Thanks,
> MM
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net