strings strangle sac
|Created on||Mar 07, 2006 20:54|
|Resolved on||May 11, 2006 16:10|
1. The attached kills sac2c w/-O3 and -noOPT. 2..The QUADfi function shows what I think is a good example of why the semantics of strtod are wrong: I start out with a character vector that I want to convert to a numeric vector. This requires repeated calls to strtod until the string is exhausted. Meanwhile... - I either have to do repeated catenations into the result, as each result element is built, or - Count the number of transitions from white space to non-white-space to compute final result size. - The fact that strtod returns a string means that the termination test is 0 != strlen(string). If this is like C, it means that the dumb thing has to iterate over the string looking for the NULL. This is really really expensive, when you do it N times. This whole class of functions should really work this way: - define their behavior so that they're based on character vectors (or matrices where that's appropriate - not sure I can think of one offhand), rather tha strings - Instead of returning a shorter string (as in strtod), return an offset into the argument where scanning stopped. Thus, the termination condition becomes: strtodres == shape(strtodarg).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information