A one-dimensional array data structure. Use 'vector-graphics' for graphic display.
2
votes
0answers
15 views
GDB watching class member in vector of instances
Here is an extremely simplified version of my class:
Class MyClass {
public:
int sizeDesired;
};
I'm creating a vector of MyClass instances in main:
int main(int argc, char **argv) {
...
1
vote
2answers
15 views
Array Based Implementation of a Vector
Homework Assistance
Describe an array based implementation of a vector such that inserting and
removing at beginning and end of the vector can be done in constant time. Argue
convincingly.
...
-1
votes
1answer
35 views
C++ log precision error for double vector array?
I have double vector array ( vector< double > ) and its max value ( 1 ) and min value ( 0 ).
When I did below sub operation, log gives (1.#INF00000000000000000) for max value's index that ( 1 - ...
1
vote
2answers
31 views
matching two character vectors in R with lapply
I want to match items from two character vectors, "A" and "B", two find out two things: 1) whether items from vector A appear in vector B (yes/no) and 2) which items from vector B do not appear in ...
2
votes
3answers
130 views
Is it possible to use a lambda function inside of a vector's constructor?
Is there a way to initialize all values of some container using a lambda function like one would do using std::for_each? I need a 3-dimensional std::vector of random ints, and it would be nice if I ...
0
votes
2answers
30 views
vectors and frequency search
I am creating a program that records the frequency of a number in an existing file. My vectors name is test, so why does it say "test" isn't defined?
It might be something small im missing....
...
3
votes
2answers
33 views
Find specific occurances within a vector in MATLAB, without for-loop?
I have a problem that seems to be simple but maybe I am missing something. Let us say I have: vector = [10:1:19];. I have another vector, want = [11 16 19]; I simply want a way in which a command will ...
1
vote
3answers
56 views
std::vector and std::list find_if and max_element performance
I am confused about performance of my code tested for std::vector and std::list. Is there a difference between these two when it comes to find_if and max_element?
1
vote
2answers
45 views
Storing from std::vector to std::set where vector contains a structure but std::set contains only one element from the struct
How do I copy all elements of a vector which is a struct of elements, to a set.
struct info
{
std::string code;
std::string curDate;
int iVar;
};
...
0
votes
1answer
17 views
Mathematica: integrate symbolic vector function
I wrote a program that defines two piecewise functions "gradino[x_]" and "gradino1[x_]", where x is a vector of m components.
I'm not able to write these functions explicitly using the x_i, I need to ...
1
vote
1answer
38 views
I have a vector whose elements contain multiple numbers. How do I sum numbers inside each element and create a new vector?
I have a vector of class 'factor' like:
vec <-c("1,1,1,1,1,2","2,1,2","3,3,4")
And I want to get another vector like this:
sumvec <- c(7, 5, 10)
How do I do this? I am using R.
4
votes
3answers
60 views
How to convert a list into a matrix in R
I do have a list of vectors, like this:
[[1]]
[1] 1 2 7 9 10 13 14 15 20
[[2]]
[1] 3 4 5 6
[[3]]
[1] 8 11 12
[[4]]
[1] 16 17 18 19
[[5]]
[1] 21 22 23
I want to convert the list to a matrix ...
0
votes
0answers
5 views
OpenLayer Popups for markers imported from google spreadsheet
I'm looking for a way to use framecloud type popup with my current setup. Unfortunately all my attempts have either not worked or will only work on the most recently placed maker.
In the course of ...
0
votes
1answer
78 views
Vector of changing amount of class objects
I have a situation where I have a bunch of class objects whose member variables I need to update over time. The amount of objects I need to have can increase and decrease, and do so rapidly ...
0
votes
0answers
11 views
time profiling. std::__1::vector. 92% of time. Xcode
I'm doing time profiling of c++ project with the instruments of Xcode 4.5.2.
More than 92% of the time is used by something call std::__1::vector<float,std<float>>, ...