next up previous contents
Next: Implementing Branch and Bound Up: Implementation Previous: Target platforms   Contents

Choice of languages

I chose C as the implementation language for the optimizer. This language is readily available on any platform I have ever heard of, and most of the platforms support the standardized ANSI C.

The C programming language allows for sophisticated data structures like trees etc. that would be either very hard or perhaps infeasible to implement in a language like Fortran. Because of the run-time efficiency needed in the optimizer, only languages with Fortran- or C like performance could be considered. I chose C because, I at the beginning of this project felt it would meet my demands. Had I known at that time, what I know now, I would not for a second have doubted that C++ would be the language of choice. C++ offers C or Fortran run-time efficiency, but especially the specialized memory handling I implemented would have been a lot cleaner done in C++ with eg. templates.

The Fortran code generator was written in Perl, since this language offers great string-handling capabilities, and completely frees the programmer from even considering allocation of data. Performance is of no importance in this tool, so the fact that Perl is interpreted (rather than compiled) doesn't matter. The Fortran code should only be generated once for every new optimized system, and even though I didn't give performance a second of thought implementing this tool, it easily generates the tens of thousands of lines of Fortran code needed to solve the $56\times 56$ system in a matter of seconds on a standard PC.

The regression test tool was written in Fortran. This choice was made mostly because the automatically generated solver is also a Fortran program. It's a very simple (read: Spartan) piece of software, and I saw no need to complicate matters further by implementing this tool in eg. C.


next up previous contents
Next: Implementing Branch and Bound Up: Implementation Previous: Target platforms   Contents

1999-02-23