Signature based search for C++ [closed] - c++

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
Is there a tool that would allow searching a C++ code base on type signature? Someone recently pointed me to the powerful Haskell tool Hoogle and I'd love to have something similar for our codebase.
To expand, I'm interested in doing queries of the following type:
I have a class Foo, and I know there exists a function that maps it to an associated Bar, but I can't recall the name of the function. I'd like to be able to ask something: "Give me all the functions that take a Foo, and provide a Bar.
A couple of notes:
This is pretty much exactly my question, but for Java. Unfortunately, the solution presented there requires reflection.
It seems like Doxygen has the information to do something like this, however, I'm not sure how one would configure it to provide this. Is there a tool that consumes Doxygen XML to provide this kind of functionality?
Fuzzy answers are acceptable! C++ has a complex enough feature set that the tool may not be 100% accurate -- but it may still be better than nothing.

You can test CppDepend, it has a powerful code query language(CQLinq) to query as you want your code, for example in your case you can execute query like this one:
from m in Methods where m.Params.Where(p=>p.ParamType=="Foo").Count()>0
&& m.ReturnType.Name=="Bar"
select m

Related

Implementation of scipy.signla.filtfilt in 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 10 months ago.
Improve this question
I am trying to implement scipy.signal.filtfilt function in c++ and I am wondering if there is already an implementation available of this?
I know its a long time. but maybe you find this repository useful:
FiltFilt in C++
filtfilt applies an IIR filter twice, once going forward, once going backward. The nontrivial part is how to initialize the IIR filter at the boundaries.
As a starting point, look at how scipy.signal.filtfilt does it. Here is the code:
https://github.com/scipy/scipy/blob/master/scipy/signal/signaltools.py#L3870
You might also find it useful to look at the source code for Octave's filtfilt (M code):
https://sourceforge.net/p/octave/signal/ci/default/tree/inst/filtfilt.m
To reproduce filtfilt in C++, you need a C++ implementation of IIR filtering to take the role of scipy's lfilter plus some boundary handling logic. I don't know about an existing C++ implementation of filtfilt, but at least for the default method='pad' logic, the core computation seems simple enough to consider porting directly.
Scipy's filtfilt is similar to Matlab's filtfilt.
A question for MATLAB's filtfilt was previously asked
An implementation for the same was previously shared on Stackoverflow by #darien-pardinas
Do note I say similar because as mentioned by #paco-wong
The difference is in the default padding length. In matlab's filtfilt, it is 3*(max(len(a), len(b)) - 1), and in scipy's filtfilt, it is 3*max(len(a), len(b)).
So you will have to account for that

How to read MATHEMATICAL functions in C++? [duplicate]

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 5 years ago.
Improve this question
Okay, so what I want to do is to use a string as input (for instance "16*12+25"), convert it to a mathematical evaluation that the computer can comprehend and return the evaluated value. I could probably write this myself, but it would most likely take quite a while and in the end, it still wouldn't end up as good as I'd like it to unless I want to put even more time into it.
So my question is, is there any script, library or api that you know can do this for C++? I have found some for both java, python and .NET. But I am not working with any of these languages and I would like to remain within C++ for as long (hopefully throughout the entire project) as possible. Do you have any good ideas or links?
I found what I was looking for! The downloadable source is C++ and a CodeBlocks project. You can find it here: http://www.speqmath.com/tutorials/expression_parser_cpp/index.html
A far more sophisticated expression parser recommended by Jared: http://www.partow.net/programming/exprtk/index.html
There is nothing built into C++ for this; all the expression parsing code belongs in the compiler. You will need to use some external library. A quick Google search brings up muParser which looks pretty reasonable.

I need a library much like Java's GregorianCalendar but in C or 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
While this might not seem exactly like a programming question, non-programmers won't know what I'm talking about. If you can suggest a more appropriate stack* forum, I'll happily ask there, but I think this is my best shot.
libical is a good start, but it doesn't have anywhere near what I need.
I do not want to reinvent tons of calendar math functions if they already exist, and I also do not want to suck in boost or roguewave or anything like that just to do calendaring.
Any suggestions? I've looked and looked and found nothing, but my google-fu isn't supreme.
By rejecting Boost you're rejecting a library that's had not only extensive design review but also probably extensive testing by people who you can guess (hope) have experience with the picky picky details of datetime calculations.
But ok, I can actually understand the desire to avoid Boost if possible.
But you're entering a world where you have even more responsibility than usual to validate the design and implementation.
That said, this library looks like its promising for your purposes: Howard Hinnant's date library on github (see also his pages here for a man page and here for a description of the algorithms used. I have not used it, of course. (If you do take this suggestion, please report back here, so we'll all know about this library's worth.)
I suspect the best answer is going to be Boost's date_time library. Though you should see if your C++ framework has something already first. Always try to match your framework when you can.

Is there any clear, entry level documentation available for boost-spirit? [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 5 years ago.
Improve this question
I've tried to wade through the official documentation on the Boost Spirit page, but I find it completely unintelligible (despite 25+ years programming experience and an English Language degree) -- it's clearly written by somebody who knows the system well (good) but assumes that the reader also knows the system well (bad). I need something that won't throw sentences like
Parsers and generators in Spirit are fully attributed
clearly a meaning of "attributed" I am unaware of, and a web search doesn't help. Or
Sequences require an attribute type to expose the concept of a fusion sequence, where all elements of that fusion sequence have to be compatible with the corresponding element of the component sequence
What is a fusion sequence? The only one I know is happening in the Sun. How in C++ does one "expose" a "concept"?
Are there any good tutorials describing Boost Spirit from a beginner's perspective?
I've found this documentation to be a good read for Boost.
http://en.highscore.de/cpp/boost/parser.html

Convert string to mathematical evaluation [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 5 years ago.
Improve this question
Okay, so what I want to do is to use a string as input (for instance "16*12+25"), convert it to a mathematical evaluation that the computer can comprehend and return the evaluated value. I could probably write this myself, but it would most likely take quite a while and in the end, it still wouldn't end up as good as I'd like it to unless I want to put even more time into it.
So my question is, is there any script, library or api that you know can do this for C++? I have found some for both java, python and .NET. But I am not working with any of these languages and I would like to remain within C++ for as long (hopefully throughout the entire project) as possible. Do you have any good ideas or links?
I found what I was looking for! The downloadable source is C++ and a CodeBlocks project. You can find it here: http://www.speqmath.com/tutorials/expression_parser_cpp/index.html
A far more sophisticated expression parser recommended by Jared: http://www.partow.net/programming/exprtk/index.html
There is nothing built into C++ for this; all the expression parsing code belongs in the compiler. You will need to use some external library. A quick Google search brings up muParser which looks pretty reasonable.