Top "Vector" questions

A vector is a single-dimensional array: it contains components that can be accessed using an integral index.

Calculating a 2D Vector's Cross Product

From wikipedia: the cross product is a binary operation on two vectors in a three-dimensional Euclidean space that results in …

language-agnostic math vector 2d
Angles between two n-dimensional vectors in Python

I need to determine the angle(s) between two n-dimensional vectors in Python. For example, the input can be two …

python vector angle
How do I reverse a C++ vector?

Is there a built-in vector function in C++ to reverse a vector in place? Or do you just have to …

c++ vector stl std
How to get std::vector pointer to the raw data?

I'm trying to use std::vector as a char array. My function takes in a void pointer: void process_data(…

c++ stl vector
Python: Differentiating between row and column vectors

Is there a good way of differentiating between row and column vectors in python? So far I'm using numpy and …

python arrays numpy vector scipy
C++ STL Vectors: Get iterator from index?

So, I wrote a bunch of code that accesses elements in an stl vector by index[], but now I need …

c++ stl vector iterator
How do you create vectors with specific intervals in R?

I have a question about creating vectors. If I do a <- 1:10, "a" has the values 1,2,3,4,5,6,7,8,9,10. My question is …

r vector intervals
Are vectors passed to functions by value or by reference in C++

I'm coding in C++. If I have some function void foo(vector<int> test) and I call it …

c++ arrays vector
How to initialize std::vector from C-style array?

What is the cheapest way to initialize a std::vector from a C-style array? Example: In the following class, I …

c++ arrays vector stl
Erasing elements from a vector

I want to clear a element from a vector using the erase method. But the problem here is that the …

c++ vector stl erase