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.

110 questions
28
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…
F Chopin
  • 574
  • 7
  • 23
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…
typeduke
  • 6,494
  • 6
  • 25
  • 34
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
  • 3,401
  • 7
  • 23
  • 40
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
  • 58,548
  • 56
  • 243
  • 402
10
votes
2 answers

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
  • 393
  • 1
  • 4
  • 12
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
  • 1,024
  • 1
  • 9
  • 13
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
  • 3,004
  • 5
  • 37
  • 49
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
  • 4,145
  • 5
  • 36
  • 64
4
votes
1 answer

Algorithm to dynamically generate m-face list for n-dimensional hypercube

I'm attempting to design an algorithm that, given n, m, and vertices (where n = the dimension of a hypercube, m = the dimension of the faces we're trying to generate, and vertices is an ordered list of vertices in an n-dimensional hypercube),…
4
votes
0 answers

How to store a set of images and labels dynamically in zarr format?

I have read zarr documentation,but could not able do this. I want something like this tree format: ---dataset --- sample1 --frames( 10 rgb frames) --labels (1/0) --- sample2 --frames( 10 rgb frames ) …
4
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
  • 7,684
  • 3
  • 29
  • 49
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,920
  • 3
  • 35
  • 58
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…
1
2 3 4 5 6 7 8