[BIOSAL] vector.c (core_vector)

Boisvert, Sebastien boisvert at anl.gov
Thu Nov 20 13:05:12 CST 2014


> 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
> 
> 
> 
> 
> 
> 
> 
> 


More information about the BIOSAL mailing list