[BIOSAL] vector.c (core_vector)
George K. Thiruvathukal
gkt at cs.luc.edu
Thu Nov 20 13:15:20 CST 2014
Thanks for confirming my understanding. :) This does help.
George
George K. Thiruvathukal, PhD
*Professor of Computer Science*, Loyola University Chicago
*Director*, Center for Textual Studies and Digital Humanities
*Guest Faculty*, Argonne National Laboratory, Math and Computer Science
Division
Editor in Chief, Computing in Science and Engineering
<http://www.computer.org/portal/web/computingnow/cise> (IEEE CS/AIP)
(w) gkt.tv (v) 773.829.4872
On Thu, Nov 20, 2014 at 1:05 PM, Boisvert, Sebastien <boisvert at anl.gov>
wrote:
> > From: George K. Thiruvathukal [gkt at cs.luc.edu]
> > Sent: Thursday, November 20, 2014 12:46 PM
> > To: Boisvert, Sebastien
> > Cc: biosal at lists.cels.anl.gov
> > Subject: vector.c (core_vector)
> >
> >
> >
> >
> > So I'm doing a bit of Thorium programming on the plane flight back and I
> have run into a bit of an obstacle with respect to core structures. I know
> that the purpose of vector.c is probably similar to the equivalents in STL
> and Java. I basically need to send
> > a vector (list) of integers. But then I need to remove items from the
> list (one at a time) and send the rest of the integers onto another actor.
>
>
>
> >
> >
> > I am wondering whether it is better to use vector than queue, especially
> when you want to remove items. There don't seem to be convenience methods
> for removing an item from a vector (although there is a way to get an item,
> after which I could do a resize).
>
> If you are removing at the end, you can use:
>
> core_vector_resize(vector, core_vector_size(vector) - 1)
>
>
> > I'm willing to do some work to extend the vector interfaces, but I am
> also wondering whether I should just use a queue, since there are
> appropriate methods of enqueueing an dequeueing items.
>
> The queue structure does not have pack/unpack functions right now.
>
> >
> >
> > I prefer to use vector, primarily because it is convenient to use it
> when doing a Thorium send. But I'm willing to use queue as well if that is
> the recommended way.
>
> I think the resize thing would probably do it.
>
> >
> >
> > George
> >
> >
> >
> >
> >
> >
> > George K. Thiruvathukal, PhD
> >
> > Professor of Computer Science, Loyola University Chicago
> >
> > Director, Center for Textual Studies and Digital Humanities
> > Guest Faculty, Argonne National Laboratory, Math and Computer Science
> Division
> > Editor in Chief, Computing in
> > Science and Engineering (IEEE CS/AIP)
> >
> > (w) gkt.tv (v)
> > 773.829.4872
> >
> >
> >
> >
> >
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cels.anl.gov/pipermail/biosal/attachments/20141120/6da9682a/attachment.html>
More information about the BIOSAL
mailing list