shogun icon indicating copy to clipboard operation
shogun copied to clipboard

Drop CMath.

Open iglesias opened this issue 11 years ago • 6 comments

The class contains a bunch of methods like floor, ceil, sine, and a large etc. that I think we should not be implementing in our own, and rather use the ones that are available in the standard libraries. In this way, we reduce the code to maintain, the amount of methods to export to the interfaces, etc.

Actually, the header of this class contains an includes the standard math.h. It might be interesting to analyse if preventing SWIG from going through this include (e.g. guarding it with a ifndef SWIG directive) save us some compile time.

At first sight, this task should be easy as it only involves substituting calls to CMath::method(...) for method(...). However, some of these calls are in header files and in principle we do not want to include in our headers those from the standard libraries. This might become delicate in template classes.

Somewhat related to #2577.

iglesias avatar Oct 30 '14 21:10 iglesias

Just a quick thought, I think it is good to have things like CMath::sin because it makes us backend independent. However, it should only be accessible from c++, and therefore hidden from SWIG

karlnapf avatar Oct 31 '14 10:10 karlnapf

That is a point. However, I think that for rather common operations (like the sine) which are included in the C++ standard, we can just go along using the C++ ones. Is there any reason why we would like to use the sine implemented somewhere else instead of the standard one?

iglesias avatar Oct 31 '14 12:10 iglesias

thats a good point. We for sure rely on c++. But there for sure is a reason why we have those things - might be deprecated by now @sonney2k @lisitsyn what are your thoughts?

karlnapf avatar Oct 31 '14 15:10 karlnapf

partly it's done... but i believe we should just drop sooner or later the whole CMath, as now everything that's there is available in std:: since c++11

vigsterkr avatar Dec 14 '17 10:12 vigsterkr

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 26 '20 16:02 stale[bot]

@vigsterkr will we replace these calls with the graph stuff? might be overkill? Then again the overhead might not be massive, mostly if there is JIT happening in the background...

gf712 avatar Feb 26 '20 17:02 gf712