Questions tagged [vector]

1 votes
1 replies
How to generate a 3D grid of vectors ? (each position in the 3D grid is a vector)
I want to generate a four dimensional array with dimensions (dim,N,N,N). The first component ndim =3 and N corresponds to the grid length. How ca...
asked 4 months ago
0 votes
0 replies
Why do I get different results compiling on OSX terminal and Netbeans
I have inherited some C++ code and am trying to migrate it to the Netbeans 11 IDE for easier debugging. It compiles fine in the OSX terminal, but...
asked 4 months ago
0 votes
1 replies
Duplicate Vector in Rolling Manner in R
Say I want to run a regression whereby the data input for the DV should be taken in a rolling manner. To ease this process, I therefore first wou...
asked 4 months ago
0 votes
2 replies
Unity Setting Parent Objects position Equal to Their child position
I have two 3D objects eventually they will be 3D models of different sizes and shapes but I am trying to get the underlying functionality correct...
asked 4 months ago
0 votes
1 replies
Storing 4 values from each line from a txt file, into an object - C++
I'm wanting to take 4 values, each separated by a comma, and store them to a airport object. Each line would have those 4 values would be stored...
asked 4 months ago
4 votes
2 replies
Vector of unordered_maps, searching in maps too slow
I wrote a small program that creates a vector of two million maps with some sample data and then queries for some values. I know I could use a d...
1 votes
1 replies
Error in C++ Vector Usage: No matching member function for call to 'push_back'
I'm basically trying to use vector, but there is a problem with it. By the way, the problem that I'm trying to solve is USACO December 2014 Bronz...
asked 4 months ago
1 votes
2 replies
Combining two vectors into a list of ordered pairs
x = c(1,2,3,4) y = c(6,7,8,9) I want to create a list like this: z = list(c(1,6),c(2,7),c(3,8),c(4,9)) What is the most efficient way to do...
asked 4 months ago
1 votes
0 replies
Getting correlations from big mixed datasets with data.table
I have a few big datasets for which I would like to get the correlations with one specific variable of that same dataset. For example, the corr...
-3 votes
1 replies
Why Does a Vector of Class Objects Delete the Objects When Adding Objects with push_back
When I ask why the vector deletes the objects I'm not referring to the mechanics of what a vector does when it's capacity is exceeded by adding e...
asked 4 months ago
0 votes
1 replies
upper_bound and find giving different results
I am new to STL and used find() and upper_bound() functions on vector to find the position of 6 . The code is given below #include <bits/st...
asked 4 months ago
0 votes
0 replies
How to take correlation of each individual row in a vector between every other row in that vector for values in second vector
I am trying to get the correlation of each unique pairs these are the columns I have state 1 & 2 count, year and week of the year. I want to...
asked 4 months ago
1 votes
1 replies
What is the standard way in C++11 to access the pointer to element n in a std::vector?
What is the standard way in C++11 to access the pointer to element n in a std::vector ? vec.data() + n or &vec[n] comes to mind. 1...
asked 4 months ago
0 votes
2 replies
How to Copy array of vectors, using = raises error Expression:transposed pointer range
I need to copy array of vector passed as reference to constructor/function. member variable gets the reference to the passed array of vector wh...
asked 4 months ago
0 votes
2 replies
vector multiplication in pytorch
In pytorch. I want to multiply each vector of Matrix A by each vector of Matrix B: A = M x N B = L x N result = (M x L) x N 0 2...
asked 4 months ago
-1 votes
0 replies
How to fix “vector iterators in range are from different containers” error in c++?
I make a IOCP c++ server. I don't know where is the problem line, because it's not written to the call stack. It's some code on my project. I on...
asked 4 months ago
4 votes
1 replies
Why are the values of vector<int> inside initializer_list changing after calling the constructor?
I'm new to C++ and trying to setup a matrix class. The matrix is created from an initializer_list containing vector<int> entries as the row...
asked 4 months ago
-1 votes
0 replies
Approximating solution of poisson equation in MATLAB
I'm trying to use the five-point finite-difference method in Matlab to solve the boundary value problem: I've spotted a solution: Using the...
-2 votes
0 replies
Making a vector in C - pop, push, at, insert at and erase range
I am in need of help with the v_push_back, v_pop_back, v_at, v_insert_n and v_erase_range functions implementation of vectors in C. I have alrea...
asked 4 months ago
0 votes
1 replies
error 2552: Non-aggregates cannot be initialized with initializer list
I'm trying to initialize a vector in a header with the following code, but getting the error C2552: 'LABELS' : non-aggregates cannot be init...
1 votes
1 replies
A loop fills in only one vector of the ones I included in the for
I include some context. My problem is in the for. When I run it, only the vector intL is filled, but that doesn't happen with the intU. On the ot...
asked 4 months ago
0 votes
0 replies
How to properly integrate a vector logo on an application compatible with android 6
Depending on the launcher it is possible for the user to choose the shape of its icons (to use round icons, squircles, etc.). Since android 8 (I...
asked 4 months ago
0 votes
1 replies
How to send vector in cbc for decipher?
I'm expecting to cipher a string, from a client side (using aes-256-cbc and a Secret-Password already known by both server & client). And the...
asked 4 months ago
0 votes
1 replies
Handling pointer in vector C++
Having problem using the vector in C++. The following code is having this Runtime Error : * Error in `./a.out': double free or corruption (out):...
asked 4 months ago
0 votes
1 replies
2D Image in 3D plot through Surface perpendicular to viewingangle
so I want to include a 2D figure in a 3D plot and rotate the figure (with view([alpha beta])). As you can imagine, this would distord the surface...
asked 4 months ago