search for: int_vector

Displaying 4 results from an estimated 4 matches for "int_vector".

2023 Feb 22
2
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
...y declare name##_empty() that > >>> will work with all vector types? That is, should we consider instead > >>> doing something like: > >>> > >>> DEFINE_VECTOR_TYPE (string_vector, char *, free); > >>> > >>> DEFINE_VECTOR_TYPE (int_vector, int, noop); > >> > >> My counter-arguments: > >> > >> - this requires updates to all existent DEFINE_VECTOR_TYPE macro > >> invocations, > >> > >> - with "noop" passed to _reset, _reset and _empty become effectively the >...
2005 Apr 18
1
Storing vectors as vectors and iterating through them
Hi all, I have a bunch of int vectors. Each vector holds a bunch of ints that correspond to row numbers of an existing matrix. I use the int vectors to pull out rows of data from a matrix, i.e. data <- my_matrix[int_vector,] I would like to store these int vectors in some sort of data structure that will preserve them as-is and allow iteration. I guess what I'm looking for would be something analogous to the java Vector class, as in this java-like pseudocode : Vector V = new Vector; V.add(a,b,c) // where a,b...
2010 Nov 15
1
SEXP and slots
...A couple other questions, please: >> >> 1. I've got a function written in C, named "my_c_function". In my R >> code I call this function, passing to it an INTSXP and a STRSXP, >> respectively: >> >> result <- .Call("my_c_function", int_vector, str_vector) >> >> The prototype of "my_c_function" is: >> >> SEXP my_c_function(SEXP int_vec, SEXP str_vec); >> >> Within my_c_function I am able to extract the values within the integer >> vector, e.g. I can grab the first value with these li...
2023 Feb 15
1
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
...te/reuse a no-op function for vectors that don't need to call free(), where we can then unconditionally declare name##_empty() that will work with all vector types? That is, should we consider instead doing something like: DEFINE_VECTOR_TYPE (string_vector, char *, free); DEFINE_VECTOR_TYPE (int_vector, int, noop); > +++ b/generator/states-connect-socket-activation.c > @@ -91,8 +91,7 @@ prepare_socket_activation_environment (string_vector *env) > > err: > set_error (errno, "malloc"); > - string_vector_iter (env, (void *) free); > - free (env->ptr); >...