819 views

### Good way to create a similarity / distance matrix for a large dataset [duplicate]

I have a large dataset with rows (100k+) for products and columns for features. Now I want to create a similarity matrix with NormalizedSquaredEuclideanDistance. ...
1k views

### How can I get the differences of all elements of list? [duplicate]

I want to get the difference of all elements of a list for example: $L=\{1,2,3,4,5,6\}$ for any $i$ and $j$ $\in L$ return the differences, for example for the first element $1$ we get the difference ...
108 views

### Euclidian distance matrix from a set of points [duplicate]

I have a set of points and I like to compute the (pairwise) euclidian distance for those points. The set has a form like this: ...
3k views

### Character edge finding

The following line of code finds the edge of a character: ...
4k views

### How do I check if any element in a list is positive?

As a simple example of what I would like to do, suppose I have a list a of all real numbers. I would like to perform a simple check to see if some element of ...
2k views

### How to simplify writing LibraryLink code?

LibraryLink is an API for extending Mathematica through C or C++. It is very fast because it gives direct access to Mathematica's packed array data structure, without even needing to make a copy of ...
5k views

### Finding the volume of a sphere using the Monte Carlo algorithm

I used the following code to find the volume of the sphere $x^2+y^2+z^2 \leq 1$ in the first octant: ...
6k views

### Data interpolation and ListContourPlot

I am fairly new to Mathematica and I have two quick questions on using it for a Hydrology and Hydrogeology class. One is about data interpolation and interpolating without any data defined in an area. ...
748 views

### A quicker than outer

I need to get a matrix $\{a(x_i-x_j)\}$, where $x_i$ form a partition of an interval, $a(x)$ is a given function. I use ...
3k views

### Fastest way to measure Hamming distance of integers

I am looking for a fast and robust way to calculate the Hamming distance of integers. The Hamming distance of two integers is the number of matching bits in their binary representations. I expect that ...
1k views

### Efficiently collecting results inside a compiled function

When we don't know the number of results that will be generated, the usual way to collect results is Reap/Sow. Another ...
481 views

### Any faster approach than Outer for my computation

Outer is slowing down considerably when the first argument is Abs[#1 - #2]/Max[#1, #2]& ...
539 views

### How to punch a hole in some 3D distribution of points

Suppose we have a long list of 3D Cartesian coordinates, defining a distribution of random points in 3D space. How could we remove all the points inside a sphere of radius ...
I have a set $S$ of $n$ 2-dimensional points. We can compute a distance matrix (Euclidean distance) for $S$ using say this answer. I wish to form an $n$-vertex graph having the points $S$ as vertices, ...