I know basics of visual studio and c++, but I am not an advanced user or programmer. What I want to do is to perform delaunay triangulation and generate voronoi grids using qhull library (using visual studio c++ in windows). I have no problem with preparing necessary data for calculation. My questions are:
What is the minimum necessary files to be included from qhull? (from what publicly free, the qhull is very powerful and contains a huge amount of files)
How can I easily perform the delaunay triangulation and generate voronoi grids? (like in delaunayn.m file of Matlab it calls " t = qhullmx(x', 'd ', opt); " then get the delaunay triangulation. )
Thank you so much for sharing your experience!
A good starting point is the C++ example in the qhull's GitHub repository: https://github.com/qhull/qhull/tree/master/src/user_eg3
Related
I have many equations with many unknowns (my data is in Excel) and currently I am using matrix method to solve them.
I use inbuilt MMULT (matrix multiply) and MINVERSE (matrix inverse) in following form :- Result = MMULT (MINVERSE(matrix1),matrix2)
Here lies the problem, my matrices are of the order of 2000 x 2000 or more, and Excel takes lot of time in doing inverse (matrix multiplication is very fast).
What is the best way for me to speed up the process? I don't mind exporting data to any external 3rd party program (compatible with Excel) and then importing the inversed matrix back to Excel.
I don't know much C / C++, but I feel if we compile the Matrix Inverse Function into a DLL and then use the same from excel VBA, maybe the speed will improve. Please help.
Please see following link :
Why is MATLAB so fast in matrix multiplication?
It is found that MATLAB has highest speed for matrix calculations. Can we use any such library in Excel / VBA ?
I have found certain libraries such as LAPACK, ARMADILO etc which are in C / C++ / C# or .NET. How can I use compiled versions of these libraries in my Excel VBA?
I am the author of the blog linked by John Coleman. There are quite a few options available, depending on your familiarity with compiling and linking to different languages. I'd say the main options are (in order of ease of implementation):
Use the Python Numpy and Scipy libraries with ExcelPython or xlwings (which now includes ExcelPython). The most recent post on the subject at my blog (including free downloads) is:
https://newtonexcelbach.wordpress.com/2016/01/04/xlscipy-python-scipy-for-excel-update-with-new-functions/
Advantages:
Free
Easy to implement (especially using Anaconda Python, which now includes xlwings).
No compilation required.
The Scipy code is fast, and includes packages for sparse matrices, which where applicable makes a huge difference to solving time, and the maximum size of matrix that can be handled.
Free and open-source spreadsheet implementation available on my blog.
Disadvantages:
The overhead in transferring large data sets from VBA to Python can be significant, in fact for small to medium sized matrices it is often greater than the solution time.
Use the Python version of the Alglib library. Search my blog for Alglib for recent examples using Python, and older examples using C++ and C#.
Advantages and disadvantages:
As for Numpy and Scipy, except there is a commercial version available as well, which may offer performance advantages (I haven't tried it).
Use Numpy/Scipy with Pyxll.
https://newtonexcelbach.wordpress.com/2013/09/10/python-matrix-functions-using-pyxll/ for sample spreadsheet.
Advantages:
The data transfer overhead should be much reduced.
More mature and documentation is better than the current xlwings.
Disadvantages:
Commercial package (but free for evaluation and non-commercial use)
Not open source.
Use open source C++ or Fortran packages with Visual Studio or other compiler, to produce xll based functions.
Advantages:
Potentially the best all-round performance.
Disadvantages:
More coding required.
Implementation more difficult, especially if you want to distribute to others.
32 bit/ 64 bit issues likely to be much harder to resolve.
As mentioned in the comments, matrix inversion is much slower than other matrix solution methods, but even allowing for that, the built in Excel Matrix functions are very slow compared with alternative compiled routines, and the advantages of installing one of the alternatives listed above is well worth the effort.
I have had good experiences with Apple's vDSP primitives under OS X and iOS.
http://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html
Now I am trying to port some code that relies on vDSP to Linux and I wonder if any equivalents are available built into one of the standard libraries.
While there is not presently any library that matches vDSP, there are several alternatives you might explore. A couple off the top of my head:
OpenCV is an impressive collection of image processing and computer vision
routines with a vibrant user and research community.
Eigen is a C++11 template library for linear algebra:
matrices, vectors, numerical solvers, and related algorithms.
My personal recommendation would be Eigen.
http://en.wikipedia.org/wiki/Constructive_solid_geometry
I'm much interested in doing what the first pictures describe on this article, only that I'm only interested in doing it on parallelepipeds (cube-like shapes), so no sphere or tube or circular shapes whatsoever.
There is this library, http://www.cgal.org/ , but it has a lot of features, and I don't know if it does what I'm looking for, and if yes, what parts could I use ?
Do you know any other library that does what I want ?
C/C++ is preferred over C#/java, but I'm open... The goal being to not reinvent the wheel.
If you need only rendering (no mesh generation), look at this.
If you need to generate new mesh:
UnBBoolean/J3DBool (Java)
J3DBool ported to C++, modified for QT, modified for Ogre
Carve (C++) (it is used in Blender, but I was unable to make it work + obsolete documentation)
GTS Library (C++) (maybe too overkill)
Personaly, I picked Ogre version, rewrote to use STL containers (it use fixed size for face count) and slightly optimized.
A list of libraries can be found here
I am looking for a tool/framework to do some simple, yet rather intensive visualization.
I have ~10000 points in a 2D space. All I need to do is plot these points, then have them animate from place to place on a second by second basis. Up until ~1000 points I was able to achieve this using Raphael.js in a web-browser, however I need a more powerful solution now.
Does anyone have any ideas where I should be looking for such a tool?
Preferred interface languages: Ruby, C, Java, Haskell or a REST API
You could give Processing a try. If you're familiar with Java and C the processing syntax should be comfortable. Alternatively there is a JavaScript version, processing.js you could try.
TK -- typically used with Tcl. A very simple cross platform GUI scripting language. I have been using it successfully for a variety of 2D UIs capable of displaying 10e6+ shapes on a canvas and have recently used it for C++ heap map visualizer GUI. Lots of cut/paste code fragments available on the wiki page. There are multiple ways to use it from within C++, including SWIG-based binding.
I want to play around with some graphics stuff. Simple animations and things. I want to fool around with raytracing too. I need help finding a library that will help me do these things. I have a few requirements:
Must be able to do raytracing
Must be for a high level language (python, .NET, etc.). Please no C/C++
Must have good documentation, preferably with examples.
Does anyone know of a good library i can use to fool around with?
Have a look at blender.org - it's an open-source 3d project with python scripting capabilities.
First thing that come to my mind is the popular open source P.O.V Raytracer (www.povray.org). POV scenes are defined entirely with script files, and some people made Python code to generate them easily.
http://code.activestate.com/recipes/205451/
http://jabas-unblog.blogspot.com/2007/04/easy-procedural-graphics-python-and-pov.html
I'm not aware of any libraries that satisfy your request (at least not unless I decide to publish the code for my own tracer...).
Writing a tracer isn't actually that hard anyway. I'd strongly recommend getting hold of a copy of "An Introduction to Ray Tracing" by Glassner. It goes through the actual math in relatively easy to understand terms, and also has a whole section on "how to write a ray tracer".
In any event, a "library" isn't all that much use on its own - pretty much every ray tracer has its own internal libraries but they're specific to the tracer. They typically include:
a base class to represent 3D objects
subclasses of that for each geometric primitive
vector and matrix classes (3D and 4D)
texturing functions and/or classes
light classes of various types (point light, spot light, etc)
For my own tracer I actually used the javax.vecmath packages for #3 above, but had to write my own code for #1 and #2 based on the Glassner book. The whole thing is well under 2k lines of code, and most of the individual classes are about 40 lines long.
I believe there are few people putting together ray-tracers using XNA Game Studio.
One example of this with code can be seen over at:
Bespoke Software ยป Ray Tracing - Materials
The well developed raytracers that are open source are
Yafray
Povray
For realtime 3D (it will be language dependant of course) there is JMonkeyEngine (Java) not sure whether that meets your "high level language" requirement.
You could consider a 3D game scripting language too, like GameCore or BlitzBasic