Skip to main content

Questions tagged [vectorization]

Use this tag if your code contains vectorized operations - where functions operate on whole arrays in one go. If it doesn't, but you want it to, then you should make those changes (perhaps with help from elsewhere) before presenting code for review.

4 votes
2 answers
175 views

I am writing a maths library for a raytracer project, and so I'm trying to make my heavy operations (like matrix inverse) more optimised. After doing some research, I discovered this trick to invert a ...
Astranged T'fyer's user avatar
4 votes
1 answer
214 views

I'm trying to build a function that identifies those who are promoted into a list of jobcodes, or are promoted within that list of jobcodes. Initially I was using ...
Gage's user avatar
  • 41
3 votes
1 answer
89 views

Looking for a better approach to write below transformation using Python. Is it possible to avoid loop and still achieve the desired output? It is too slow for 10 million rows. ...
user278818's user avatar
2 votes
1 answer
112 views

I'm trying to implement the dynamics of Dengue transmission between mosquitoes and humans. I decided create two classes, one for the human population and another for the mosquitoes. Both are based on ...
Athansya's user avatar
4 votes
1 answer
223 views

The idea is to add a given 16-bit number N to each element of an array of 16-bit integers of arbitrary length, taking advantage of 64-bit integer types and instructions to perform the additions 4 at a ...
CPlus's user avatar
  • 1,467
1 vote
2 answers
221 views

The problem: I am given a data frame. Somewhere in that dataframe there is 3*N number of columns that I need to modify based on a condition. The columns of interest look like this: names_1 address_1 ...
Glue's user avatar
  • 129
4 votes
1 answer
751 views

Here, is my implementation of Iterative Closest Point algorithm in C++. The code is written using the Eigen library. I have tried to implement an efficient coding methodology best to my knowledge ...
Aryaman Patel's user avatar
1 vote
1 answer
121 views

I have the following dataframe: ...
illuminato's user avatar
1 vote
1 answer
738 views

The following numpy/python function computes exponentially-weighted moving mean and standard deviation of an irregularly-spaced weighted time series. I want to make it faster by getting rid of the ...
yuri kilochek's user avatar
0 votes
2 answers
93 views

Given an Image I with dimensions as {rows, columns}, for every pixel in the image, the following needs to be computed - ...
ad99's user avatar
  • 101
3 votes
1 answer
209 views

I am searching for a more efficient way to calculate the so called vec-trick used in Tensor algebra, see Wikipedia. Introduction: Suppose you have a matrix vector multiplication, where a matrix C ...
ConvexHull's user avatar
3 votes
1 answer
134 views

I am new to python, and even more new to vectorization. I have attempted to vectorize a custom similarity function that should return a matrix of pairwise similarities between each row in an input ...
dddxxx's user avatar
  • 131
11 votes
3 answers
2k views

Here is a blit function for a graphics library I made. I've built a small graphics library that uses an palette-indexed spritesheet to hold all of the game's sprites. The blit function copies parts of ...
coqcauderanais's user avatar
2 votes
1 answer
212 views

I am implementing a function that computes the angle between two vectors when given two n-dimensional arrays and an axis along which to operate. I want to do this with as few copies as possible, and ...
FirefoxMetzger's user avatar
1 vote
1 answer
78 views

I want to optimize this for loop for correcting coordinates of an image, it takes too long which is not suited for my system. I have done some profiling, the numpy roots is taking most of the time (...
Md Mizanur Rahman's user avatar

15 30 50 per page
1
2 3 4 5
7