Tagged Questions
3
votes
2answers
156 views
How to replace Do loops by Inner
I need to replace Do loops by something else because it takes forever with big programs. I have been hinted towards Inner, but ...
2
votes
2answers
104 views
Importing several huge files with headers & footers
having here several files in ASCII format
http://ge.tt/91rv0Jf/v/0
I want to import, while removing headers and footers and then join the several lists.
...
10
votes
4answers
346 views
Finding Local Minima / Maxima in Noisy Data
I'm trying to find local minima / maxima in noisy data, consisting of data values taken at certain time intervals. Ideally, the function should take a pair of lists (one containing time values and one ...
1
vote
2answers
149 views
What ways are there to convert an Integer to a list of digits?
How can I convert an Integer to list of numbers? For example:
781049 ==> {7, 8, 1, 0, 4, 9}
What are the possible ways of ...
1
vote
1answer
171 views
1
vote
2answers
91 views
Speeding up a simple simulation with random extractions
I wonder if anybody can help, I need a hand with a simple simulation I am writing with Mathematica (I am using version 8). Basically it creates a list (called l) with numbers from 1 to n and a random ...
12
votes
5answers
198 views
Faster way to convert triangle list to edge list with no duplicates
I have a list of triangles returned by a Delaunay triangulator, in the following format:
...
17
votes
3answers
347 views
How to efficiently find positions of duplicates?
Is there an efficient way to find the positions of the duplicates in a list?
I would like the positions grouped according to duplicated elements. For instance, given
...
2
votes
3answers
142 views
Selecting subsets of a list containing a specific element
I'm trying to generate all the subsets of a set containing a specific element.
For example, for the set {1, 2, 3, 4}, with the specific element I want inside each subset being 4, the required answer ...
2
votes
1answer
95 views
9
votes
2answers
203 views
Speed up 4D matrix/array generation
I have to fill a 4D array, whose entries are $\mathrm{sinc}\left[j(a-b)^2+j(c-d)^2-\phi\right]$ for a fixed value of $\phi$ (normally -15) and a fixed value of $j$ (normally about 0.00005). The way ...
8
votes
4answers
291 views
Passing large list by reference
I have the following problem: I would like to control evaluation of a variable that points to a list. For example, frequently in the code I have functions of the form that are supposed to work on ...
8
votes
5answers
336 views
Counting the population of integers
Suppose that myData is a list of sublists. Each sublist has a length of one or greater and contains any number of replicates of the integers 1, 2, 3, and 4. I ...
13
votes
3answers
271 views
Quick multiple selections from a list
What is the fastest way to make multiple selections from a list? Compiled methods included.
For example, here are two methods for selecting a subset, compared:-
...
6
votes
2answers
326 views
Elegant way to handle columns operations
Inspired by this question from @sjdh and by my recurrent use of columns operations in database sets, I was looking for one way to make columns operations more symetric, so I can handle with matrix and ...
8
votes
1answer
240 views
Vlookup function as Excel in Mathematica
How to create a Vlookup function, similar to what we have in Excel. So if we have a table a and another b, we could add columns ...
5
votes
3answers
212 views
Efficiently extracting an array subset given a separate array
I have two arrays. The first array consists of tens of millions of rows and three columns with a string, a number, and a string.
...
8
votes
3answers
130 views
How can I use the overhang argument to Partition to avoid using PadLeft and PadRight here?
Say I have a list of values v = {v1, v2, v3, ... }. I need to partition these values to perform operations with a sliding window (think ...
2
votes
1answer
113 views
Computing closest set of points to each point in large set — running out of memory (arrays unpacking)
I have a large set of points in 3D and I'm trying to identify all the points that lie within a certain distance of each point. Then using this data store the vector between the pairs of points.
I ...
4
votes
1answer
194 views
speed up iteration with conditionals plus optimize memory usage
Given list1 and list2 whose elements are vectors of a certain (fixed) dimension, I am interested in the behaviour of a scalar ...
4
votes
3answers
174 views
Extracting Pareto elements from a list
How can I extract the Pareto elements from a list?
For example, for that list:
...
1
vote
1answer
120 views
Optimization of correlation calculation
How can I make the following line of code run faster? Is there a way to do this calculation as a matrix vs vector than vector vs vector?
In the code below, f is a ...
4
votes
1answer
179 views
Performance of a Do-Loop of variable length
If I'm changing a basis depending on a (non quadratic) matrix $\mathbf{M}\in\mathbb Z^{d\times k}$ and some $\mu\in\mathbb N^k$, i.e. i have an array a of the same ...
7
votes
8answers
327 views
Thread over list in different levels
I have these two lists, both with the same length in the first dimension:
...
8
votes
4answers
289 views
What's fastest way of defining 10^5 down values?
I want to define
isGood[___] = False;
isGood[#] = True & /@ list
where list is a list of several million integers. ...
6
votes
1answer
128 views
Elementwise, compilable min function
I am trying to implement efficiently a transfer-matrix like algorithm. On each iteration, I have two vectors $x=\{x_1,\dots,x_n\}$, $y=\{y_1,\dots,y_n\}$ with real numbers and I need to compute the ...
1
vote
2answers
129 views
Combining lists with common elements efficiently [duplicate]
Possible Duplicate:
Computing the equivalence classes of the symmetric transitive closure of a relation
I am required to process sets consisting of 2-element subsets of integers by ...
8
votes
0answers
178 views
Using Compile to speed up Function with PermutationProduct
I have the following fairly simple routine dot involving PermutationProduct that I wish to speed up using ...
7
votes
1answer
251 views
Very fast way to do a coordinate frame transform
I need a function that rotates and translates a huge amount of line segments.
For example, I have a set of line segments in the form {{x0,y0,z0},{x1,y1,z1}}
...
10
votes
5answers
904 views
Best way to create symmetric matrices
From time to time I need to generate symmetric matrices with relatively expensive cost of element evaluation. Most frequently these are Gram matrices where elements are $L_2$ dot products. Here are ...
8
votes
1answer
417 views
Rapidly binning 3D data
I have a set of data (about 20 million datapoints for my real data) of the form {x, y, z, m}. There are 3 spatial coordinates x, ...
19
votes
3answers
388 views
Is there a faster way to create a matrix of indices from ragged data?
I have data that is given as a list of ordered pairs mixed with scalars. The pairs can contain infinite bounds. My goal is to convert the data into an index used in future computations.
...
18
votes
6answers
778 views
efficient way to count the number of zeros at the (right) end of a very large number
If I want to count the number of zeros at the (right) end of a large number, like $12345!$, I can use something like:
Length[Last[Split[IntegerDigits[12345!]]]]
...

