jachapmanii / barnes-hut Goto Github PK
View Code? Open in Web Editor NEWImplementation of the Barnes-Hut algorithm in C++
Home Page: JAChapmanII.net/code/barnes-hut
License: GNU General Public License v3.0
Implementation of the Barnes-Hut algorithm in C++
Home Page: JAChapmanII.net/code/barnes-hut
License: GNU General Public License v3.0
This is a threaded implementation of the Barnes-Hut algorithm, as it would need to be implmented if I were in Analysis of Algorithms. Meant to give me experience for when I try to do something similar (unless this works out to be what I was thinking the fast multipole method was) in Universum Meum. Compile: To compile, you will need the Qt library for threading support To compile without SFML GUI: make To compile with SFML GUI: make gui=yes To switch between GUI/non GUI versions you must make clean between them It is possible to run the GUI compiled version without opening any windows Run: ./bin/barnes-hut [filename] [tau] [arg4] [arg5] If you do not specify a file containing the initial particle descriptions, this program will prompt you to spceify the file on stdin. If you do not specify a tau value, 0.5 will be assumed. arg4 is a special arg that makes the program print the particle system after running the Barnes-Hut algorithm to stdout arg5 is a special arg that makes the program display the quadtree after running the Barnes-Hut algorithm if it was compiled with gui=yes When run this way, this program creates 4 worker threads to split up the work of applying the Barnes-Hut algorithm to particles in the system. -- THIS IS NOT SUGGESTED FOR END USERS -- If any argument after tau is "-t", then the program will run a test of the root mean square error. Run this way, the program currently tries to divide the problem space and do it in chunks that are saved in between. Each calculation uses the multithreaded Barnes-Hut algorithm for speed. -- THIS IS NOT SUGGESTED FOR END USERS -- Input/output format: Input format should be a series of lines with three floats on each line. The first float will be used as the x, the next y, and the final will be mass. Technically, white space doesn't matter but it looks better ;) The output will be the same as the input, except on each line the instantaneous x and y forces will be appended Warning: I haven't done much file IO, so don't run this on something you don't want to turn into a radioactive sheep-cheese. (it has been tested repeatedly, and it hasn't done this up to this point, still, don't run it on anything not in the right format) License: GPL3, see COPYING Notes: Pay attention to compiler warnings about using == and != on floating point values if you ever make something like this!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.