From: Andreas K. <and...@ac...> - 2009-05-25 16:13:34
|
Michał Antoniewski wrote: > Hello. > > Today, I started my work and I've got some questions. Ok. I will answer to the best of my abilities. I may explicitly draw in other people and their expertise, depending on the context. As of now I will copy our conversation to tcllib-devel, allowing the community to chime in as well. > As it is in > timeline I started with Bellman-Ford and Johnson's. > > 1. What about infinity values... In my implementation of Bellman Fords I > just added string "inf", as a value of infinity ( in initialization we > assign value of infinity on each distance we are searching for). Is it > okay, or you've got other way to assign those values? Let me check something ... I believe that in Tcl 8.5 we have standard strings for the infinities already. Matching these would be a good thing, even if we are working with Tcl 8.4 ... % tclsh % info patchlevel 8.5.7 % expr log(0) -Inf Yes. The standard strings are "Inf" and "-Inf". Kevin, do you have anything to add here, as one of the guys knowing the math stuff in the Tcl core better than most ? > > 2. Documentation. Should I just extend those html files in tcllib ( > graphops.html ) or write my documantation? As we talked it over before - > documentation will be made at the end. Looking over the Tcllib sources I have here I do not see any file named "graphops.html". Can you tell me where you found it ? The documentation format for Tcllib modules and packages is 'doctools'. The packages needed to handle this format are in Tcllib itself. All the files ending in '.man' in Tcllib are in this format. The 'sak' tool has some commands to validate this format, and to convert from doctools to HTML, nroff, etc. > 3. Generally, I'm implementing algorithms as normal procedures. Then > after writing tests and checking if those procedures work well, they > should be placed in tcllib ( just like hierarchy at SVN says). Do you > accept this approach? Let me have a look at what you committed so far and then I will come back to you on that. In other words, I would like to defer an answer on this one until I had a look at the code and have a seen a more concrete example of what you are talking about here. > 4. Tests ( with tcltest package ). I'm going to construct some special > cases and build some graphs, where especially algorithm could fail. For > approximation algorithms, surely will be needed Tight Examples ( cases > where algorithm gets it's maximum approximation factor ). If you can > give me some remarks about tests I would appreciate. I will definitely try. This one is also a point where I have to think a bit more before writing, thus not an immediate answer in this mail. Andreas. |