All Questions
39 questions
2
votes
0
answers
74
views
backward induction algorithm computation
Is there a way to significantly speed-up this code?
I'm solving a dynamic programming model using a backward induction algorithm. A crucial step is to calculate the current-period value function (VF), ...
13
votes
5
answers
2k
views
Iterate through two arrays calculating a statistic from indexes of zeros
I write a function which takes as input 2 arrays of zeros and ones ~8000 elements per array. Input array size is variable, can have much higher number of elements. The density of ones is expected to ...
1
vote
1
answer
134
views
How to using custom colormap with pixel calculation, gray scale value by opencv and make it workable on camera [closed]
I tried to implement the mcolor colormap in the paper
at page 8 to 10.
I developed the code to process a image file and it works ok.
Now, I want to adopt this image processing method to the camera ...
4
votes
1
answer
11k
views
Simplex method (linear programming) implementation
The up-to-date code, along some documentation, can be found here.
We've implemented a version of the Simplex method for solving linear programming problems. The concerns I have are with the design we ...
5
votes
1
answer
479
views
Bancroft's method implementation
Background
I've written an algorithm to solve the three-dimensional Time Difference of Arrival (TDoA) multi-lateration problem. That is, given the coordinates of n ...
4
votes
1
answer
338
views
Numerical differentiation on sphere with Python
I have ported from Fortran to Python an algorithm that calculates the numerical derivative along the x direction (longitudinal) of a scalar function s on a ...
6
votes
1
answer
4k
views
Rotating an Image using own algorithm in python
For an uni assignment I have been giving the task of making my own rotating algorithm in python. This is my code so far.
...
5
votes
1
answer
7k
views
Implementation of the Householder Transformation
I implemented the Householder transformation in Python, so that I can later use it in a QR decomposition. Unfortunately I haven't found a good concise source for reading up on the algorithm.
I am not ...
2
votes
0
answers
140
views
Convolution layer using numpy in python
I'm trying to make a CNN in python using numpy. I have a finished product but it seems that it can be improved. On testing the convolutional layer is the biggest bottleneck
...
6
votes
4
answers
2k
views
Kadane's Algorithm for 2D array with known boundaries
I asked this question first on StackOverflow but I didn't get an answer and was advised to try here too. So here we go.
I have implemented Kadane's algorithm for a 2D array in Python 2 with known ...
4
votes
2
answers
2k
views
Trapezoidal rule for set of data
Here is the question from the book of Mark Newman-Computational Physics Exc 5.1
a) Read in the data and, using the trapezoidal rule, calculate from them the approximate distance traveled by the ...
1
vote
1
answer
205
views
Ensuring performance of sketching/streaming algorithm (countSketch) [closed]
I have implemented what is know as a countSketch in Python (page 17: https://arxiv.org/pdf/1411.4357.pdf) but my implementation is currently lacking in performance.
The algorithm is to compute the ...
6
votes
1
answer
944
views
Choosing evenly distributed points from a million points on a sphere
I have \$10^5\$ to \$10^6\$ points on a sphere, and want to choose some points from them which are as close as uniformly distributed as possible. For that reason, I do the following: at each step I ...
6
votes
1
answer
591
views
Searching extreme points of polyhedron
In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
17
votes
1
answer
516
views
Efficiently selecting spatially distributed weighted points
Background:
Motivation behind writing the following code is originated in the area of computer vision. More specifically – image rectification. In order to obtain rectified images, one has to find a ...