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 6 years ago.
Improve this question
Are there any good sources containg C++ versions of MATLAB functions? I am only looking for some basic functions i.e. fzero.
fzero is non trivial.
If your function is polynomial, try GSL http://www.gnu.org/software/gsl/
Try looking at GNU Octave. It's a FLOSS alternative to MATLAB and has a lot of the same functionality. Take a look at its implementation of fzero, keeping in mind that the code is GPL'ed.
I do a lot of work in C++ for science and engineering applications. One of my favorite references is Numerical Recipes nr.com. Some of the older versions of the book included code that looked like Fortran but was written in C, for example indexes of arrays started at 1. The latest version from 2007 (C++ only 3rd edition) corrected many of the complaints like 1 indexed arrays and confusing namespace. Even if you don’t like the code the simple explanations of the math make the book worth buying. Be warned some people consider the license for the code harsh but compared to Matlab it is a giant leap forward. Other things to try is GSL and Intel Math Kernel Lib. Good luck.
Check out the embedded matlab subset. It allows you to convert matlab scripts into C code. I use it to make libraries out of matlab functions which I link to form C++ projects. It only supports a subset of functions, but fzero is included in the list with some limitations . . .
http://www.mathworks.com/help/toolbox/eml/ug/bq1h2z7-9.html
This allows you to do all of your algorithmic development in the warm and cozy Matlab environment. Matlab will even build the C library. All you have to do is link to it. This is WAY easier than learning a bunch of C++ numerical libraries if you're already familiar with Matlab.
I don't think it contains an fzero equivalent, but Armadillo does have many C++ versions of MATLAB functions (so may do for some instances). See, for example, this conversion table.
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 4 years ago.
Improve this question
As a first time programming using vi with a raw Linux terminal in C++, what is the simplest way to recurse through a filesystem and get results such as file size, date, directory date etc?
I imagine I'm missing a library or two that would handle this pretty cleanly which would be great to know. Even better would be knowing where to find a solid reference for the basics like this.
If you have a modern compiler you can use std::filesystem:
https://en.cppreference.com/w/cpp/filesystem
Otherwise you can use boost::filesystem, which is very similar but non standard:
https://www.boost.org/doc/libs/1_67_0/libs/filesystem/doc/index.htm
Boost is a collection of libraries with various purposes and a focus on quality. Boost libraries regularly end up in the new C++ standards so it's good thing to learn.
You might consider (on Linux at least) to use nftw(3). You could use opendir(3) + readdir(3) + closedir with stat(2) (and nftw is using all these). See also syscalls(2) (and read some Linux programming book, perhaps the old ALP). Notice that on Linux (and POSIX systems), the operating system API is in C, not in C++.
Of course, you might use the C++ functions given in f4's answer (they are are based on functions above).
And you could use C++ frameworks such as boost, poco, Qt (also using the functions above).
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 1 year ago.
Improve this question
I'm wondering what if any GPU integration libraries exist for Clojure?
I've seen examples of this that involve hand-rolling OpenCL code, but I'm specifically I'm looking for something similar to Anacoda accelerate, which translates Numpy Python expressions to CUDA code relatively seamlessly.
I'm open to either OpenCL or Cuda approaches.
here is a project that recently started on github https://github.com/JulesGosnell/clumatra. Its seems more like an experiment and its quite impressive!
There is a Google Summer of Code project proposal to add a GPU matrix implementation to core.matrix:
http://dev.clojure.org/display/community/Project+Ideas
Once completed, this project would allow large vector/matrix expressions to be optimised and executed on GPUs.
Disclaimer: I'm a possible mentor for this project.
clojureCL was released a few months after this question was posted. It looks like it offers a more idiomatic interpretation of the standard interface, but it is not a tool that would transform Clojure math / vector operations into OpenCL operations (I think that that is what the OP is looking for?)
[ClojureCL] brings a lot of power, but do not expect it to be an easy ride if you’ve never programmed anything on the GPU or embedded devices. With ClojureCL, it is not [as] difficult as in C (OpenCL Hello World in C is a hundred lines of source code, in ClojureCL it’s only a few), ...
The good news is that you can use any OpenCL book to learn ClojureCL, and we even provide ClojureCL code for the examples used in the OpenCL in Action book.
An old topic but now we have clojurecuda, which is a wrapper on JCuda!
It won't give you automagic speedup on things but at least Neanderthal is a higher level library for linear algebra.
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
Which of these languages is better for opengl game with primary platform linux?
I would like if you compared them in performance and libraries support.
C++ is a low-level, highly flexible and powerful language. It compiles native code (it's fast) and has a large array of helpful libraries. I would recommend it for any OpenGL project. You may also look into other c-family languages, that share many of the same benefits.
(I sound like an ad)
If you don't know enough about C++ and C# to answer this question yourself then I suggest you go for C#.
In C++ you may get slightly better performance, but only if you have enough experience with it. Otherwise it'll probably end up being slower.
C++ libraries can be easily called from Mono using pInvoke, but Mono libraries cannot be used from C++ (without embedding entire mono in your game).
Library support is about the same, all of the 3d rendering libraries I can think of have .net bindings. If you want lower level libraries(openGL, openAL etc.) OpenTk has bindings for just about everything you need. A quick look at the programming language shootout looks like mono is 1/2 the speed of G++ I would be really surprised if that held in the general case though.
I would say it largely depend on the code to be developed, I mean, the rest of the app. For pro gaming stuff and so on C++ seems to be the stronger choice.
I've used OpenGL + C# to render our version tree (plastic scm) on Linux, Windows, Mac with very good results, but we're not doing a game! :)
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 have coding for fortran 77 but i want to converted to fortran 90..where can i donwload the converter software??
Here is a python solution that I helped write: https://github.com/arktools/fortran_tools
It successfully converted the entire airforce f77 datcom code to f90, so it is well tested. I will be adding some more features as I have time.
If anyone finds it useful/ and makes modifications, feel free to contribute to the project.
The first hit on a Google query for "fortran 77 convert 90" returned this page, which has 3 free tools and 2 commercial ones listed (after clicking the link for "Subprograms, Converters, Key Works"). I've not used Fortran in quite a while, and can't vouch for the quality of any of these tools.
I'd recommend Lemon Lab f2f. I'm a bit biased, since I was the original developer, but my motivation was due to the fact that I didn't think the alternatives worked very well. Give it a try if you like.
The free program convert (http://www.nag.co.uk/nagware/Examples/convert.f90) will convert from Fortran 77 fixed-source form to Fortran 90/95/2003 free-source form and make some simple transformations, such as declarations. There are also some commercial products, such as SPAG (http://www.polyhedron.com/spag0html).
I have found and used three programs convert.f90 (Michael Metcalf), preconvert.f90 (Purple Sage Computing Solutions, Inc.) and to_f90.f90 (Alan Miller).
None of them worked 100% like I expected. Results depends on how closely your source matches what the programs expect to see.
For your convenience I have zipped the source files up and hosted them here:
Source Files
I have used Compaq Visual Fortran 6.5 to compile into three separate projects. If you want the projects also use this link
CVF 6.5 Projects
Best of luck.
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
what popular advance mathematics libraries for c++ are present out there, so that they can be used as a 1 stop solution and avoiding reinventing the wheel ?
Check out GNU Scientific Library -- it's in C, but I use it all the time to avoid re-writing the Numerical Recipes code.
Intel's MKL (Math Kernel Library) is to be looked at especially if doing large scale matrix operations; it's C based, but should not really be an issue IMO.
Other than that, maybe the boost math library could be interesting as it is free. (but I have no experience with it, so YMMV).
Max.
Like others have said, you will probably not find a single library to handle all of the areas you listed. For matrix algebra, I've heard good things about the Eigen C++ library from coworkers who are using it.
For commercial libraries, both NAG (Numerical Algorithms Group, http://www.nag.co.uk/) and IMSL ( http://www.vni.com/products/imsl/ ) are standards and provide industrial-strength numerical analysis algorithms.
look through the list and mix-and-match. You want very many things, unlikely any single package is going to do them all.
http://www.oonumerics.org/
octave is the only one that is going to be more or less comprehensive (functionality comparable/clone to Matlab)
http://www.mathias-michel.de/download/howto-octave-c++.ps
For group theory there is GAP.