Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have a large 3D matrix and a small 3D matrix which I want to use 3D fft based convolution to find the best match for my small 3D matrix in the larger matrix. Do you have any code in C++ that can do it?
Stackoverflow is no community where one can request a code then gets it done by us, yet we can help you find the necessary resources and information so you are able to do so for yourself (usually questions on how to use libraries and help on specific topics are ok).
Let's come to your question: you already mentioned that you want to use FFT which is by far the best approach - a suitable library would be FFTW, so please take a look at it and keep the following things in mind:
To improve performace try to pad to powers of two which will speed up the process a lot!
Using real FFT and not complex will simplify and speed up this, too.
Usually single precision should be enough to achieve the desired results.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 months ago.
Improve this question
I need to solve the heat equation for 2D object using C++. I've found many sources explaining the mathematics behind it. I am using the Crank-Nicholson scheme, but given that I need a 1001 x 1001 discretization, the resulting linear system is huge and memory would blow in case of a "traditional" implementation.
Therefore, I am recurring to methods for solving sparse linear systems. I have been looking online and cannot find any source explaining an algorithm to solve this sparse system efficiently. I've found several packages that do solve it (like csparse, eigen, SciPy under-the-hood implementation), but found no theoretical explanation to really code it myself. For the moment I am trying to do "reverse engineering" on the source code of SuperLU.
What I am looking for is an algorithm that you may know to solve sparse linear systems.
Thanks in advance
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
are there any examples of solving heat conduction problems in 2D with fourier's law as main equation with finite elements and using either libmesh or deal.II libraries?
The 2D heat equation is the only way to solve heat conduction problems. Lots of examples using finite difference, finite element, and boundary element methods. All require meshes of some kind. Which one do you want to apply?
OK, so now we know you want to solve 2D heat conduction problems using FEA. It's a three step process:
Pre-process (create the mesh for your geometry, apply material properties, boundary conditions, and initial conditions (if transient or non-linear).
Perform the analysis (formulate and solve the matrix equations for node and element unknowns).
Post-process (graphical display of results is best, since pictures are worth thousands of words).
Which solver do you wish to use? Is your objective to write one or just use one? Do you want open source? Must it be written in C++? (Not likely. FORTRAN is by far the most common language for such programs.)
Is yours a large problem? I'm guessing no, but massive parallelization might be of interest to you:
http://www.cas.usf.edu/~cconnor/parallel/2dheat/2dheat.html
FEMHub likes Python, probably because of the nice libraries NumPy and SciPy.
Here's a site that lists open source libraries for Java.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm looking for a library that will let me cast a ray into a scene model (it happens to be a terrain model in our case) and return the point of intersection in the scene. It does not have to be super-efficient (although I'd rather it not be super-inefficient). Ideally it would not have dependencies on other libraries (like OpenGL). I'm really looking for something that has just the functionality I need and no more.
Does anyone have any suggestions?
Unless there are other requirements you haven't revealed, use CGAL's AABB tree's support for ray intersections (example).
(Please, don't even think about using this if you're actually trying to do terrain rendering though... there are far more efficient algorithms for ray-casting height fields for the purpose of producing images e.g so-called voxel algorithms).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm looking for a sample code.
It's 3D modeling using camera.
like this: http://mi.eng.cam.ac.uk/~qp202/my_papers/BMVC09/
Hopefully, I want to use c or c++.
Thanks.
openCv is probably the easiest place to start.
There are a few chapters about creatign scenes from stereo pairs (which is a bit easier) in the opencv book otherwise 3d models from image understanding is still possible - but a lot harder mathematically.
You may want to check out OpenCV for computer vision functionality and OpenGL for 3D graphics. Both are widely used APIs with plenty of online documentation and examples, both official and third-party.
You could try contacting the author of the paper to see if he's willing to release his source code to you. It looks like he used CGAL (for the Delauny Tetrahedralisation) so if you go that route, you'll need to get a copy of that.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for a C++ library, and I am dealing with convex objective and constraint functions.
I am guessing your problem is non-linear. Where i work, we use SNOPT, Ipopt and another proprietary solver (not for sale). We have also tried and heard good things about Knitro.
As long as your problem is convex, all these solvers work well.
They all have their own API, but they all ask for the same information : values, first and second derivatives.
Assuming your problems are nonlinear, you can use free and open-sourced OPT++, available from Sandia Lab. I have used it in one project in C++ and it was easy to use and worked well.
From what I know, the CPLEX solver is the best convex optimization solver. Its the state of the art in LP solvers. Does convex optimization really well. While looking for it, I see that its IBM's software now. You can find it here : http://www-01.ibm.com/software/integration/optimization/cplex/