Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vectorization]

The tag has no usage guidance.

0
votes
1answer
84 views

What exactly is Hardware Acceleration?

I'm able to find many definitions and notions to this term including, Implementing the algorithm (or part of it) in hardware :- Instructions like FMAD; FPGAs Parallelizing the algorithm at the ...
3
votes
1answer
502 views

integral including a vector

I need to calculate the integral of this function def f(z): return ((1-2*z)*np.exp(-d/z))/(((1-z)**(2+d))*(z**(2-d))) Here d is a constant. I am using this ...
1
vote
0answers
83 views

vectorizating function integration scipy python

I need to implement the following in python: For a given discrete time series Zt (t=0 to T), find smallest t such that: $c\sum_{s=0}^t e^{[k(Zt-Zs)+m(t-s)]} >= \frac{p*}{1-p*} $ where c,k,m are ...
4
votes
1answer
543 views

Vectorize a part of a huge matrix in C++

I have a large matrix, side-length is about $n\geq 1000$. I need to do element-wise multiplication of this matrix with another matrix many, many times. I make this process by: Vectorizing (through ...
5
votes
1answer
905 views

Why do libraries need hand-vectorized code instead of compiler auto vectorization

C++ eigen library does vectorization for different architecture, like SSE, NEON etc. In their documentation they mentioned that, Eigen vectorization is not compiler dependent. But most modern ...
0
votes
1answer
42 views

Vectorization Algorithm using only rectangle

As stated in the title I have a raster image (black or white) with no complex or fuzzied components (only horizontal or vertical text, italic or bold are allowed). I need to express that raster image ...
0
votes
2answers
127 views

Matlab Vectorization of columns in a 2D matrix and single element multiplication

MATLAB. I am trying to vectorize a loop in which each column vector of a 2D matrix (n-by-n) is found by multiplying each single element in a diagonal matrix with a column vector in another n-by-n 2D ...
3
votes
2answers
532 views

Why is SIMD programming on such a low level in CPU's compared to GPU's?

Just speaking from my experience in c++ - Its really tricky to take advantage of the SIMD capabilities of modern CPU's for more complex algorithms. If I see an opportunity from a high level OO ...
4
votes
1answer
220 views

Fast way to repeatedly solve a small nonlinear equation system

A small nonlinear equation system (sizes around 12 ✕ 12) needs to be solved repeatedly (millions of times); each time with some variation in parameters/coefficients (although the equation set is ...
0
votes
1answer
242 views

quiver3 gives non-conformant arguments?

Does anyone know why I'm seeing these errors? I'm not giving it a matrix. ...
5
votes
3answers
582 views

Manipulating Matrices in Matlab

Suppose I have a matrix $A$ of size $n_1 \times n_2 \times n_3$ Now, I have another matrix $B$ of size $n_1 \times n_2 \times n_3 \times N$ where $N<n_3$ I'd like to create the following matrix ...
9
votes
3answers
3k views

How do I know if my code is being vectorized by the compiler?

As exemplified by Jed Brown's answer to Costs of lookups versus calculations, using vectorized vs non-vectorized floating point operations results in much faster code. Many modern compilers claim ...
7
votes
1answer
1k views

How do I vectorize this 4-D matrix operation in Matlab?

I need to do a large number of matrix operations in Matlab, but one of the matrices is 4-D and my normal instincts for correct vectorization are failing me. Right now I'm using a loop. Maybe somebody ...
12
votes
2answers
9k views

Octave: calculate distance between two matrices of vectors

Suppose I have two matrices Nx2, Mx2 representing N, M 2d vectors respectively. Is there a simple and good way to calculate distances between each vector pair (n, m)? The easy but inefficient way is ...