# Questions tagged [vectorization]

Vectorization refers to a programming paradigm where functions operate on whole arrays in one go. Use this tag if your code contains vectorized operations

71 questions
Filter by
Sorted by
Tagged with
1answer
121 views

### C# System.Numerics.Vector<T> Clamp

The software that I develop uses large floating-point arrays up to the maximum size that can be allocated in C#. I have a large number of algorithms such as convolutions and filters that get executed ...
2answers
88 views

### Converting Array of Float32 (float) to Array of UINT8 (unsigned char) Using AVX2 [closed]

Given input array of Float32 (float) with numElements how could one efficiently convert it ...
1answer
60 views

### Converting Array of UINT8 (unsigned char) to Array of Float32 (float) Using AVX2

Given input array of UINT8 (unsigned char) with numElements how could one efficiently ...
2answers
2k views

### Rolling regressions in R

I want to run rolling regressions over each group and store the coefficient. The following works, but it's slow, since I have too many series and I want to run too many regressions for each group. ...
0answers
60 views

### Optimising multiplication of matrix rows with matrix slice/page

I've recently vectorized most of the code for an optimization problem but this one still eludes me. As the procedure and not the actual values are important here, I have replaced the original matrices ...
1answer
112 views

### Vectorized N-Dimensional Random Walk in Cartesian Coordinates

I have written a random-walk routine that I hope to build upon in the future. Before doing so, I was hoping to get some critique. I believe the implementation is correct. I noticed that many other ...
1answer
231 views

### Vectorizing the product of an array of complex numbers

I am trying to write fast/optimal code to vectorize the product of an array of complex numbers. In simple C this would be: ...
1answer
67 views

1answer
114 views

### Speeding up loop-rich Matlab function to calculate temperature distribution

I would like to speed up this function as much as possible in Matlab. This is part of a bigger simulation project, and as it is one of the most called functions within the simulation, this is crucial. ...
1answer
147 views

### Catalogue manipulation

I have a catalogue of 56000 objects and I want to replace some columns with new values for instance replace NaN with -99 and <...
2answers
412 views

### Jacobian product

Do you have in mind a way to compute the following sum $$R_{i,j,k} = \sum_{l=0}^{2} J_{i,j,l+3k} v_{i,j,l}$$ obviously in a vectorised fashion? This may sound like an equivalent of: ...
1answer
7k views

### Remove duplicates in list of lists where an item in each list is ignored when determining duplicity

I have lines_list_copy of the form: [['a1', 'b1', 'c1', 'd1', 'e1'], ['a2', 'b2', 'c2', 'd2', 'e2'], ... ] I needed to ...
1answer
97 views

### Vectorization for temperature simulation

I'm new to Matlab and I would like to know tips in order to reduce the processing time of such program. The scheme of the actual code is very similar to typical C++ code and I would like to vectorize ...
2answers
434 views

### Weighted dice with n faces

Here you find some code that returns the value of a multivariate Bernoulli density function - for a dice with n faces, where each face has its weight (weight must be positive reals, not necessarily ...