# Questions tagged [data-structures]

The tag has no usage guidance.

23 questions
86 views

### How to generate a face list from vertices?

I have a little background in writing toy finite volume CFD codes. In 2D Cartesian scenarios, I typically take $x_{\min}$, $x_{\max}$, $y_{\min}$, $y_{\max}$, and the number of points in $x$ and $y$ ...
126 views

### bit-packing and compression of data structures in scientific computing

I recently came across this paper, which describes a scheme for saving memory in representing sparse matrices. A 32-bit integer can store numbers up to ~4 billion. But when you solve a PDE you've gone ...
86 views

### Union of closed intervals on $\mathbb{R}$

Suppose there are multiple intervals on $\mathbb{R}$, e.g., $[0,0.5]$, $[0.4,1]$, $[1.5,2]$, the union of them should be $[0,1]$ and $[1.5,2]$. Is there a specific datastructure (or algorithm) for ...
46 views

### Which data structure contains of one parent node and many child nodes [closed]

I like to represent the following numbers in a data structure, like in trees or list but with one parent node and possibly many child nodes 1.3.1.1.0 1.3.1.1.1 1.3.1.1.2 1.3.1.2.0 ...
62 views

### Efficient Representation of (spatially sparse) spatial time series

Background I have a huge dataset consisting of points (on a plane) together with a timestamp for each point. This is a collection of car GPS measures, giving us the location (latitude/longitude) of ...
128 views

### How to handle 2D and 3D models efficiently

My coworkers and I have developed a c++ library implementing a "3D Geological Model" class. Goal of this library is to provide a data structure that is used in computational codes (such as Finite ...
236 views

### Algorithm for face based data-structure - CFD

Good morning I'm trying to develop an unstructured CFD code to solve Euler equations in a finite-volume (cell-centered) context (learning purposes). I was able to build from a cgns file some basic ...
64 views

### Data format for Cartesian mesh with cut cells

Is there a mesh data format which is particularly well suited for Cartesian meshes with Dey-Mittra style cut-cells? Ideally, one which does not require converting the cut-cells into a more general ...
6k views

### Programming Finite Element Methods in C++

I am trying to develop a library for finite element methods in C++ and for that I am looking at the data structures for meshes. Based on what I've read up on fenics and deal.ii, the general ...
214 views

### K-nearest neighbours search in subspaces of a high-dimensional space

I'm looking for a good way to partition a large, fairly high-dimensional dataset in order to perform fast kNN searches not just in the full $N$-dimensional space, but also in lower-dimensional ...
883 views

### Algorithm for efficient weighted sampling from a collection that can efficiently be updated

I'm writing a Monte Carlo simulation in which I have to maintain a large collection of items. This collection contains a great many duplicates, and it will most likely be best to store some or all of ...
409 views

### data structures for efficient/easy implementation of finite volume method for 2D Poisson equation

My question is about implementation alone. Consider a square domain with regular square, cell centred finite volumes. This is for the multiscale finite volume method (Jenny and Lunati) I need to ...
9k views

### Implement the Huffman code in Python or Numpy?

The Huffman code is a way of compressing data streams by encoding the more frequent items with shorter words. Here is a distribution on the letters A thru J and the code I obtained: ...
1k views

### adaptive Gauss-Kronrod quadrature with vector-valued integrand

So I'm trying to implement a Gauss-Kronrod adaptive quadrature. That is, I want to calculate $$\int_a^b f(x) dx = \sum_i f(x_i) w_i$$ where f(x) is evaluated at multiple points at once for ...
332 views

### Practical implementation of spatial binning for rectangular range queries

I have a bunch of polygons and a coarse uniform grid. I want to implement two different range queries, for a rectangle aligned with the uniform grid: Does the rectangle intersect with any polygon at ...
62 views

### Minimum path in an undirected graph with 2 kinds of edges (locked and unlocked)

Given an undirected graph with positive weights, there are 2 kinds of edges: locked edges and unlocked edges. Determination if a given edge is either locked or unlocked edge takes O(1). For given ...
1k views

### Data structures for finite volume code: Arrays vs Classes

I have to write a finite volume code for Magnetohydrodynamics (MHD). I have written numerical code before but not at this scale. I just wanted to ask which will be a good choice, using a data ...
2k views

### Proper data-structure and algorithm for 3-D Delaunay triangulation

I have worked out some poor code to achieve the goal of 3D Delauney triangulation(random points in E3), but the time consuming is huge, and when five points are exactly (or nearly due to the round-off ...
646 views

### Repeated nearest neighbor calculation for millions of data points too slow

I have a dataset running into millions of data points in 3D. For the calculation I am doing, I need to calculate neighbor (range search) to each data point in a radius, try to fit a function, ...
182 views

### Where do I find data to start a graph data structure to practice on?

I am interested in learning firsthand about graph data structures but have no data to put into the database. Can anyone recommend a source for a beginner to find graph data? (Preferably a source that ...