This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TR1 Math


Benjamin Kosnik wrote:
Hi Ed! This looks great. It's encouraging to see somebody working on
this difficult piece of TR1.

I have a couple of comments in addition to Paolo's feedback.

1) attribution:
+// Written by Edward Smith-Rowland based on numerous mathematics books.

A bit more detail, please.

2) namespace macro confusion

this:
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+_GLIBCXX_BEGIN_NAMESPACE(tr1)

should instead be consistent with the other tr1 headers:

+ namespace std
+ {
+_GLIBCXX_BEGIN_NAMESPACE(tr1)


In general, this looks like it is ready to start being checked in, to
me. Do you have your assignment in place?
My assignment is in place. I am in the middle of making corrections as suggested by you and Paolo.
Also, what is the plan WRT GSL? Is there a plan for cooperation, or is
this just going to be a separate code base? Insights appreciated.
The GSL is a great piece of work and I am looking at it as I go. The GSL is in C and only supports double precision. I chose to use template functions to support the three floating point types that TR1 calls for. I like the idea of having a single generic algorithm. With this decision I think there will be just to many differences to support any real immediate sharing. Maybe as I add attributions to the commentary I could note corresponding functions in GSL as appropriate. I think I'll do this.

OTOH perhaps if the GSL folks want to make three versions of everything we could import the relevant part of the GSL library in a scheme much like libgcc-math and our functions would call these. Obviously this is a ways off because I've seen no such movement in GSL. It might however be the long term best structure if, as I've heard suggested, the C standard follows C++ and adds these functions to its library.

But for now, I think wrapping template functions will put us in position faster and is just the right (C++) way to do it in my opinion. It seems wrong to code things three times. Maybe they (C) can use m4. Ugh.

You say:

I think it would be worthwhile to have a GSL-TR1 deathmatch although
this might not be appropriate for the testsuite.
Can you elaborate?
I'm hoping to build a test application or set of applications that will compare the results of TR1 versus GSL.
These would do a lot of spot checking of these functions and could also be used for timing trials. This could be one way that GSL and TR1 could share work. If a discrepancy is observed we could sort it out and pass the info on. To be honest though, I expect GSL to correct *me* rather than the other way around most of the time ;-).
-benjamin



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]