Questions tagged [n-dimensional]

n-dimensional involves computation in higher dimensions

Usually used in math,physics,machine learning and computer graphics. Its common to downgrade n-dimensional problems down to 4D/3D/2D/1D using techniques like:

  • projection
  • cross-section
  • PCA

either to lower the needed processing or storage power needed to handle it or to visualize or just to simplify.

96 questions
25
votes
5 answers

How to distribute points evenly on the surface of hyperspheres in higher dimensions?

I am interested in evenly distributing N points on the surface of spheres in dimensions 3 and higher. To be more specific: Given a number of points N and number of dimensions D (where D > 1, N > 1) The distance of every point to the origin must be…
Karl
  • 352
  • 4
  • 16
15
votes
1 answer

OpenCL: Work items, Processing elements, NDRange

My classmates and me are being confronted with OpenCL for the first time. As expected, we ran into some issues. Below I summarized the issues we had and the answers we found. However, we're not sure that we got it all right, so it would be great if…
lkbaerenfaenger
  • 5,652
  • 5
  • 21
  • 33
13
votes
3 answers

Find all n-dimensional lines and diagonals with NumPy

Using NumPy, I would like to produce a list of all lines and diagonals of an n-dimensional array with lengths of k. Take the case of the following three-dimensional array with lengths of three. array([[[ 0, 1, 2], [ 3, 4, 5], […
2Cubed
  • 2,871
  • 6
  • 18
  • 38
12
votes
3 answers

How do I get the two last dimensions of an N-D array as a 2D array?

I have a 3D array in MATLAB, with size(myArray) = [100 100 50]. Now, I'd like to get a specific layer, specified by an index in the first dimension, in the form of a 2D matrix. I tried myMatrix = myArray(myIndex,:,:);, but that gives me a 3D array…
Tomas Aschan
  • 53,075
  • 51
  • 214
  • 362
7
votes
1 answer

Cluster high dimensional data with python and DBSCAN

I have a dataset with 1000 dimensions and I am trying to cluster the data with DBSCAN in Python. I have a hard time understanding what metric to choose and why. Can someone explain this? And how should I decide what values to set eps to? I am…
Ekgren
  • 914
  • 1
  • 8
  • 12
5
votes
5 answers

n-dimensional matching algorithm

Looking for some advice here. Does anyone know a good place to start looking into matching algorithm in a n-dimensional space. For example, any dating site out there must be using some sort of algorithm to match 2 people. What I have read is that…
Herman
  • 2,944
  • 5
  • 35
  • 48
5
votes
1 answer

Finding the k-longest sequences in an one-dimensional array?

In context of the realization of a project I need to find the k-longest sequences in PHP. There are many ways to implement this - but which algorithm is the fastest for PHP? Which algorithm would you implement? (overview) Which one is most-efficient…
19h
  • 819
  • 9
  • 20
5
votes
3 answers

C++ How to generate the set of cartesian product of n-dimensional tuples

I wish to generate some data that represents the co-ordinates of a cloud of points representing an n-cube of n dimensions. These points should be evenly distributed throughout the n-space and should be able to be generated with a user-defined…
Ben
  • 107
  • 1
  • 12
5
votes
3 answers

Calculate n-dimensional arc path

I'm implementing a driver for a CNC mill, and I'm having trouble implementing the G-code arc commands. I have found several implementations of the midpoint circle algorithm, but it is not really usable as-is. The problem with the midpoint circle…
Pepijn
  • 3,909
  • 4
  • 30
  • 60
4
votes
1 answer

How to implement flat shading in OpenGL without duplicate vertices?

I am trying to render 3D prisms in LWJGL OpenGL with flat shading. For example, I have a cube indexed as following: I only have 8 vertices in the vertex buffer, which I have indexed as above. Is there any way to implement flat normal shading on…
Sibh
  • 173
  • 1
  • 2
  • 9
4
votes
2 answers

Matlab convert columnar data into ndarray

Is there a simple (ideally without multiple for loops) way to group a vector of values according to a set of categories in Matlab? I have data matrix in the form CATEG_A CATEG_B CATEG_C ... VALUE 1 1 1 ... 0.64 …
Sanjay Manohar
  • 6,614
  • 2
  • 32
  • 54
4
votes
1 answer

Fastest way to iterate over n-dimensional array of arbitrary extents?

In C++ I wish to iterate an n-dimensional array with arbitrary extents ranging from min[n] to max[n] respectively, maintaining the ordinates in ord[n] respectively throughout. Ie. a general solution to: for (int x = 0; x < 10; x++) for (int y = 3; y…
3
votes
0 answers

Farthest point from (potentially-overlapping) spheres

I am looking for a reasonably efficient algorithm (and likely associated data structure) to accomplish the following in a reasonably low dimension (d<10; generally d=2 or 3): Given a set of (potentially-overlapping!) spheres and a fixed bounding…
TLW
  • 1,111
  • 8
  • 19
3
votes
3 answers

C++ 2D vector and operations

How can one create a 2D vector in C++ and find its length and coordinates? In this case, how are the vector elements filled with values? Thanks.
Simplicity
  • 41,347
  • 81
  • 231
  • 358
3
votes
1 answer

How to make Numpy treat each row/tensor as a value

Many functions like in1d and setdiff1d are designed for 1-d array. One workaround to apply these methods on N-dimensional arrays is to make numpy to treat each row (something more high dimensional) as a value. One approach I found to do so is in…
Tai
  • 6,494
  • 3
  • 23
  • 40
1
2 3 4 5 6 7