home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Dimensional Type Checking
- Message-ID: <1992Jul21.144819.21736@ucc.su.OZ.AU>
- Keywords: dimensional analysis
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <dreamer.0qe8@lhaven.UUmh.Ab.Ca> <1992Jul20.101402.16526@hemlock.cray.com>
- Date: Tue, 21 Jul 1992 14:48:19 GMT
- Lines: 30
-
- In article <1992Jul20.101402.16526@hemlock.cray.com> dsf@cray.com (Dan Frankowski) writes:
- >
- >See IEEE Software, May 1988, pages 21-26, "Dimensional Analysis with
- >C++." They implement a "units" class that checks the dimensions and
- >even converts automatically if there is a simple multiplicative factor
- >(for example feet to inches, but not celsius to fahrenheit).
- >
- >The disadvantage is that it's all at runtime! This means you don't get
- >the line number where the error occurred, you need about 20 bytes of
- >extra storage per variable-with-units (even in arrays, it's 20 bytes
- >per element), it slows down execution, and so on.
- >
- >Is there a better way, folks?
- >
-
- You can fix the array problem with lots of nasties.
-
- However, it SHOULD be possible to do dimmensional analysis
- at compile time and it isnt. So to the experts: WHY NOT?
-
- What extension (to templates?) is required to allow this.
-
- [Um.. we need a reflexive system?]
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-