Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
2answers
125 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 ...
4
votes
2answers
126 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 ...
1
vote
5answers
139 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 ...
1
vote
0answers
70 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 ...
2
votes
2answers
685 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: ...
6
votes
2answers
284 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 ...
1
vote
0answers
123 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 ...
9
votes
3answers
355 views

Are HDF5 files suitable for git revision control?

I am not familiar with the file format used in HDF5, but I am wondering if HDF5 files are suitable for revision control with git (or for example Mercurial or Subversion)? I guess what I mean is: are ...
1
vote
0answers
54 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 ...
9
votes
2answers
314 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 ...
7
votes
2answers
550 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 ...
12
votes
5answers
328 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, ...
5
votes
3answers
141 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 ...
9
votes
2answers
373 views

What are some good data-types for unstructured cell-centered FVM CFD code?

I'm interested in an advice for efficient data structures for cell browsing in unstructured cell-based finite volume CFD. One example that I encountered (in dolfyn cfd code) goes like this (I'll show ...
4
votes
2answers
377 views

Extracting a 2D matrix from a multidimensional array in C

In my c language program, I have to store multiple dense $m\times m$ matrices corresponding to gridpoints $x_i$ with $i=1,...,n$. I decided to create a three dimensional array $A\in R^{n\times ...
4
votes
3answers
191 views

How to efficiently structure simulation data in memory for cells with varying degrees of freedom?

For a discontinuous Galerkin-based simulation I need to store cell-based simulation data in memory. Since the order of the polynomial approximation $N_p$ may vary between cells, I wonder what the most ...