What visualization libraries are available for Fortran? [closed] - fortran

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What visualization open sources or free software libraries are available for the Fortran programming language? Are there any similar to MatPlotLib for Python, for Fortran?
If not, most scientists require visualization not only to generate some outputs but also to investigate data trends, which is missing in Fortran although its speed in computation is well-known.
Note:
This question is intended to discover available, or planned to be available, graphical libraries for Fortran. It is clearly not going to compare different packages among different programming languages.
The flexibility, quality of outputs, interactivity, multi-dimensionality, free/open source etc are of factors to be discovered.

Just to make this list, a bit more complete ...
PLPLOT
GINO Suite
Winteracter
NCAR (outdated)

There is also gtk-fortran.
gtk-fortran offers also an interface to PLplot (>=5.13 in the GTK 3 branch).

I think there are some libraries available, which allow you to do directly some rendering of data from Fortran, however nothing like MatPlotLib, as far as I know.
Edit: Here is a short link collection:
http://www.astro.caltech.edu/~tjp/pgplot/
http://sourceforge.net/projects/gnuplotfortran/
http://www.mps.mpg.de/dislin/
http://www.vigyan.com/desl/FLAVOR.HTM (maybe not exactly matching here)
But the main point of the typical Fortran application is not the visualization of the data, but its generation. Typically you produce some output file, which can then be read by gnuplot or some other visualization tool. A common data container format is for example HDF5.
If there is still some need for direct visualization from within the Fortran application, you can use the ISO_C_Binding to interface with any C-Library, which should provide you with plentiful options. Still for these cases it is likely, that you will need to generate some wrapping layer around the C-API to provide an convenient usage in the Fortran application.

Free: Mjograph (2d plots only) and Veusz (2d and 3d plots)
Perhaps you can generate csv or simple space-delimited files with your Python/Compiled-Fortran code, and process using 2d plotting software like Mjograph and/or 2d/3d software like Veusz. Mjograph is only available via Mac and/or Java platform. Veusz is scriptable with Python, it was built using Python with Qt & Numpy, in fact the save file is just a plain Python script, and is comparable to gnuplot (at least in terms of ease of use). The tutorial with veusz clearly shows what the capabilities are. I like that it starts you off with the GUI, but you can wean off to pure scripting afterwards.
Mjograph: http://www.ochiailab.dnj.ynu.ac.jp/mjograph/
Veusz: https://veusz.github.io/
Veusz seems a little more natural compared to dumping data into Matlab or Mathematica. At least if you are used to pushing python and Fortran around with Bash scripts on linux.
If you insist on 3d data, I would take a second look at DISLIN, it can work quite well depending on what you need to visualize. The license is quite affordable for commericial-use. If using for academic use it's free.

Typically, a Fortran user creates massive data files then uses some 3rd party visualization software that fits the application. There are a couple of libraries that directly link to Fortran. Dislin is a fantastic one (particularly on Windows). It has a ton of documentation and once the learning curve is over you can create great GUI's as well. GnuplotFortran is an interface from Fortran to the standard gnuplot. I've yet to use it, but hear good things.

My choice would be something like PV-WAVE from Visual Numerics Inc. -- lately bought out by Rogue Wave Solutions.
This uses a big library of Fortran routines and employs its own special 4G language to speed up coding your own custom data displays.
This product is not cheap -- it was developed for applications like seismic data analysis, wind speed/direction data representation, simulation of things like airfoil flow, injection-molding cooling, stress analysis, etc -- but it is the best that I've seen.
Very clear documentation, examples supplied for each library sub-program, good help guide, direct line to tech support.
Leaves MatLab for dead.

Related

A stand alone software using fortran / C/ C++

I need to build a standalone Windows-based software, using the Fortran and or C/C ++. I expect users to download the program, install it and use it generically in a Windows environment.
Main aim of the software is to perform complex nonlinear optimization, and possibly constrained optimization. I expect users to interact with the program using a highly interactive graphics user interface. Practically, depicting results user high-end graphics is a necessity.
I want to know whether it is possible to achieve these using freely available libraries for Fortran/C/C++.
Many, if not most, of the (freely available) open source optimization codes are written in Fortran and or C/C++. For a quick overview, please have a look at Hans Mittelmann's Decision Tree for Optimization Software.
There is also the COIN-OR Foundation, which hosts many optimization codes (most written in C/C++, I believe) and support tools. You can find the list of available projects here.
If by complex optimization you refer to complex numbers, please have a look at this SO question for further elaboration on how to formulate optimization problems involving complex numbers.
You can use Fortran to write routines for computation and transform everything into a dll.
The application can be written in C++ (for example GUI in Qt).
For visualization there are good libraries in C++, like VTK, otherwise you can use OpenGl.
If you want numerical libraries additionally, you can use LAPACK for example.

How to parse C++ source in Python? [closed]

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 years ago.
Improve this question
We want to parse our huge C++ source tree to gain enough info to feed to another tool to make diagrams of class and object relations, discern the overall organization of things etc.
My best try so far is a Python script that scans all .cpp and .h files, runs regex searches to try to detect class declarations, methods, etc. We don't need a full-blown analyzer to capture every detail, or some heavy UML diagram generator - there's a lot of detail we'd like to ignore and we're inventing new types of diagrams. The script sorta works, but by gosh it's true: C++ is hard to parse!
So I wonder what tools exist for extracting the info we want from our sources? I'm not a language expert, and don't want something with a steep learning curve. Something we low-brow blue-collar programmer grunts can use :P
Python is preferred as one of the standard languages here, but it's not essential.
I'll simply recommend Clang.
It's a C++ library-based compiler designed with ease of reuse in mind. It notably means that you can use it solely for parsing and generating an Abstract Syntax Tree. It takes care of all the tedious operator overloading resolution, template instantiation and so on.
Clang exports a C-based interface, which is extended with Python Bindings. The interface is normally quite rich, but I haven't use it. Anyway, contributions are welcome if you wish to help extending it.
You could check out GccXML and OpenC++, as well as doxygen.
Can you run a preprocessing step? Doxygen parses most C++ syntax and creates xml with all the relationships. Compilers also create debug databases (typically dwarf format from gcc and codeview format from MSC).
From what you say of our requirements, Tony's answer of GccXML will probably be the best option. If that doesn't work, you could try to generate an outline of your program with cscope or ctags, and then work your way to the info you want from it's output.
You asked for tools that can extract information from C++.
Our DMS Software Reengineering Toolkit is configurable compiler technology for building custom analyzers. It has a full C++ Front End with a preprocesser, full C++ parsing with AST construction (including capture of comments), and full symbol table. These could be used to extract such structural information, and export it to whatever you want to process it.
EDIT: One of the comments is that there are only 3 full C++ parsers in the world. I suspect more; surely IBM has one that works. DMS's C++ front end has been used in anger on large applications in both MS Visual Studio and on GNU C++ source codes, so it might reasonably qualify, too :-}
I've had good experience with PLY:
http://www.dabeaz.com/ply/
But this requires some experience with lex and yacc
If you can bring yourself to run this analysis using a Windows-platform application, save yourself a lot of time and trouble, and spend $200 on Enterprise Architect by Sparx Systems (I have no affiliation with this company, just a satisfied customer). (Note: this should not be confused with Microsoft's own "Enterprise Architect" bundle for Visual Studio.)
EA can reverse-engineer a number of languages, including C++, C, Java, and Python, generating some very nice UML class diagrams. (EA comes in a number of different packages, Desktop is the cheapest but you have to by Professional, the 2nd cheapest, to get the code engineering feature included.) I also like the integration between the generated class diagrams and sequence diagramming, where you can drag a line between object lifelines and a menu of defined methods is presented to you based on the class definition of the target object. At my former consulting business, we used this tool quite a bit to develop system architectural proposals which we then included as part of our project bid (just copy/paste the diagram into a Word doc). It wont take long to make back your $200.

Open source libraries for sound effects in games [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
does aybody know about an open source sound library in C++ or some other popular language that can be used in open source games for recreating sounds and especifically in car racing games to recreate engine sound?
Thanks
A long time ago, there was OpenAL and was moderately successful on Linux.
It's fairly easy, modelled around the OpenGL library principles.
While you got a few answers regarding how to output sound I believe that wasn't your question.
If I got your question correctly I think "Sound Synthesis" is what you are looking for.
All you need is a bunch of generators (e.g. Sine, Sawtooth, Noise)
and filters (low,high,band); And combine these.
Next step would be adding LFOs (Low-Frequency-Oscillators) to modulate parameters of the generators and filters.
I'm aware that this is not the full answer you looked for, but sound synthesis is a science in itself and the above keywords should get you started on the right track.
As for realtime synthesis of SFX for games. Simple answer:
Don't do it!
It's a waste of resources and - unless you have very strict size limits - the size of the samples used for SFX won't kill you.
For our current game the average sample has a(n on disk) size of around 7KB.
(We use 16KHz, mono, ADPCM wavs most of the time.)
I've only trivially poked around with it, but SDL is a very popular, cross-platform, C++ game dev library. It includes support for graphics, sound, input.
I also recall that it's very modular. That is, it's less of a framework and more of a library than some other solutions. Give it a look.
Is there a specific reason you need open source, or is "source available" good enough? A popular one is fmod http://www.fmod.org
It is free for non-commercial products, and also offers sourcecode under a license. It is very popular and isused in many well known games.
The irrKlang sound engine is very popular amoung independent developers. It is free for non-commercial use and still very cheap, if you want to start earning some money with your game.
It supports all major plattforms (Windows, Linux, Mac) and has APIs for C++ and .Net languages.
I know it's an old question, but I think SFML needs to be represented here. SFML is available in C++, C, .Net (C#, VB.Net, C++/CLI, etc), Python, D, and Ruby, and is designed to be small and fast.
Features specific to audio:
Uses hardware acceleration whenever possible
Can load and save standard sound formats : ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64
Can load all audio resources directly from files in memory
3D sound spacialization
Easy interface for capturing audio
Manages memory efficiently, so that you don't have to worry about resources lifetime or storage
Supports streaming for big files ; you can even write your custom streaming class for any source (network, ...)
Supports multi-channels formats (mono, stereo, 4.0, 5.1, 6.1, 7.1)
For the specific question of recreating engine sounds, usually games take a single looping sound and adjust the pitch. An open source game that does this very well is VDrift.
SDL is Good Option for Graphics/Sound
QT frame work has also good support for sound and graphics
PortAudio is also good option

Matlab vs. Visual C++? [closed]

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
I'm doing a Windows Application the uses lots of charts. Its practically a dataviewer. I started doing Matlab, because its easier, but I realized it's too slow. I wanted to change to another language. Somebody recommended me Visual C++ or Java. But Im not sure. What language should I use??
In my opinion the speed gain from going to another "faster" language is not as much as refining your algorithm.
The "problem" with MATLAB is that it allows you to do some nasty things, such as resizing your matrix in a tight loop. You should really try to pinpoint your bottlenecks using the following command:
profile on
... run your program
profile off
profile report
This will give you nice information about which function takes how long to execute and which line creates the biggest bottleneck. You can also see how many times a function is called and a M-Lint Code Check Report is included.
These measurements and hints can show you the bottlenecks of your algorithm. if your sure there isn't a way to reduce the callcount/speed of a function using a smarter algorithm. Such as do I really need that big 2d matrix where a smart vector would be large enough, or if I found a artifact, why would I still continue searching for artifacts. You could write the functions you're experiencing the most performance problems with in c/c++ and use it as a function in matlab. You can get a big speedup out of correctly choosing which functions to implement in c/c++. There is an amount of overhead with calling a c/c++ function from MATLAB, or more correctly there is a overhead in c/c++ to get the data from MATLAB, so a function which is called 10000 times will not be the best to implement in c/c++, you'd be better of with the function higher up the callstack.
It depends on what your requirements are.
The advantage of using matlab is that it's strong in numerical calculations. If you don't need that, then there is no advantage to using matlab. In this case, all those languages are okay, and many others (Python, C#, ...) as well. It depends on which language you are most comfortable with.
If you do want the advantages of matlab then:
Try optimizing in matlab. Most optimization techniques are language independent.
There are tools to translate matlab to C automatically. You can then try to compile with all optimizations on. I seriously doubt this will help much, however, especially considering the GUI part.
First and foremost, as other answers have mentioned, you need to profile your code to find out where the bottleneck is. I would check out Doug Hull's blog at The MathWorks, specifically this entry about using the profiler. This will help you find out where all the work is being done in your code.
If the source of the slowdown is associated with data processing, there may be a number of ways to speed things up (vectorizing, writing a mex file, etc.).
If the source of the slowdown is your GUI, this may be even easier to solve. There are a number of blog posts, both from Doug and other MathWorkers, which I've seen that deal with GUI design. There have also been a few questions on SO dealing with it (here's one). If you're dealing with displaying very large data sets, this submission from Jiro Doke on The MathWorks File Exchange may help speed things up.
It's hard to give you more specific advice since I don't know how you are designing your GUI, but if that turns out to be the bottleneck in displaying your data there are many resources to turn to for improving its speed before you go through the hassle of switching to a whole other language.
Don't forget that you can create functions in C++ that can be called from Matlab. And TADA, you have access to both environments !
I would use C#. It is easier than C++ and integrates well with the Windows platform. Just find a free graphing library for it and you're good to go.
There are plenty of other options depending on your preference of language. Eg. Qt with Python or C++.
As far as I know, the most common methodology is to first do the proof of concept or just the main algorithm on Matlab, because of its ease of use and convenience for math calculations, and after that to translate it to a "real" programming language in order to improve the performance. Usually C or C++ act as the "real" language, but in your case, aiming to do a Windows application, perhaps C# will be the best option.
I found that GUI programming in MATLAB can get really nasty if your application gets more complex. BTW MATLAB can also be called from Java easily (and vice versa, current versions basically provide an interactive Java console).
Just as a side note, if you still need the math power of Matlab, you may want to check out Scilab. It's open-source and free, and it has examples of how it can be integrated with other C# or C++. I have created projects on which Scilab was running in the background to perform all the data math operations; and displaying them with C#'s ZedGraph library. Worked like magic!
I suggest you using Java and the JFreeChart (http://www.jfree.org/jfreechart/) library. I found very easy (and fast) developing applications with a lot of charts of different typologies. If you don't need particularly fast performances, you can use Java. I suppose that there are similar libraries for C#, but I'm not sure.
An alternative to Matlab and Scilab is another free software: Octave.
I don't know about Scilab, but Octave syntax is nearly the same as matlab so you can import code with minimal effort.
If you need fancy toolboxes though, Scilab and Octave might let you down, so check this.
You can execute Octave functions in a C++ program:
http://en.wikipedia.org/wiki/GNU_Octave
I do not think that you can call your own m-files functions from your C++ program though. In the past, the Matlab compiler would let users run matlab programs without installing Matlab, but not without installing a huge library (250 MB if I remember correctly). Nevermind if your Matlab program took 20 kB, you had to distribute the huge library.
Please someone edit/comment on the situation today!
It has been a while since I used the GUI "ability" of Matlab, but back then (2005) I found it awful. Ugly, hard to use, very hard to maintain, dependent on user settings of windows parameters.
Please comment or edit on that too, they may have made progress!
If they have not, I believe that Matlab is NOT the way to go for a program that you want to deliver to anyone.
If you can use Visual Studio for doing your GUI, do that. I second the earlier opinions: go with what you're comfortable with.
If you need the Matlab functions, go with what you're comfortable with, that supports Matlab libraries.
First of all Visual C++ is not a language is an IDE for developing applications.
Second... Which languages do you know? You can have several options. Take a look to:
C++ + Qt (Mine preferred option, powerful and easy to understand)
C# + .NET or WPF
Java
If you can tell more information we could find a language that matches your needs.

Is there any 'out-of-the-box' 2D/3D plotting library for C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces".
Looking at what is available, here is what I've found:
wxPlot: Not updated since 2006. But it would be a good candidate if it was...
wxMathPlot: Very new, not mature, few features (still active?)
libgraph: Outdated, not rebust, 2D only and outputs images only.
koolplot: Too basic, no control over the created window.
EasyBMP: Very basic, only images output.
plotutils: Command line only.
plplot: C and C++ API are barely maintained. It is in fact on this that wxPlot is based. Could be a could candidate also if C and C++ interface we're updated.
Any comments? Ideas?
Thanks!
Even though this thread is old but gold. QCustomPlot is very recommendable as well to complement this list.
MathGL have many plot types, C/Fortran interface and basic data analysis
I'm all about ROOT for these needs. Pretty heavy if you don't need all the analysis support, though.
You have Qwt which is mature. There is a 3D version lurking somewhere. However, I have never been satisfied with the aesthetic result.
It may be worth waiting for Qt3D to come out to write something better yourself easily.
I programmatically provide required input files to GNUPlot executable and invoke it using system() function. It is suitable to my situation since I only want to visualize my data during research. But if you want the plotting functionality integrated into your executable file, maybe this is not for you :)
u can use DISLIN
it is quite neat!
Might wxChart be an option? I have not used it myself however and it looks like it hasnt been updated for a while.
Just an idea: Use Python as embeddable scripting language to plot your graphs. Python has a plethora of plotting libraries.
I found the game library Allegro easy to use back in the day. Might be worth a look.
We use an ancient version of ComponentOne Chart.
AntiGrain Geometry (AGG). http://www.antigrain.com/. Its an opensource 2D vector graphics library. Its a standalone library with no additional dependencies. Has good documentation. Python plotting library matplotlib uses AGG as one of backends.
Have a look at wxArt2d it is a complete framework for 2d editing and plotting. See the screenshots for more examples.
Some interesting features:
Reading and writing SVG and CVG
Several views of the same document
Changes are updated when idle
Optimized drawing of 2d objects
Hey! I'm the developer of wxMathPlot! The project is active: I just took a long time to get a new release, because the code needed a partial rewriting to introduce new features. Take a look to the new 0.1.0 release: it is a great improvement from old versions. Anyway, it doesn't provide 3D (even if I always thinking about it...).
OpenGL. It WILL be hard and possibly rewriting the wheel, though.
Keep in mind that OpenGL is a general 3D library, and not a specific plot library, but you can implement plotting based on it.